Files
income_payments_applet/assets/js/jsencrypt/rsa.js
T
2021-09-15 09:58:01 +08:00

9 lines
328 B
JavaScript

// import JSEncrypt from '../jsencrypt/jsencrypt'
// import JSEncrypt from '../jsencrypt/jsencryptInit'
import JSEncrypt from '../jsencrypt/jsencryptInit'
export function encrypt(publicKey, message) {
const encrypt = new JSEncrypt()
encrypt.setPublicKey(publicKey) // publicKey为公钥
return encrypt.encrypt(message)
}