1.0.4 • Published 6 years ago

rsa-js-java v1.0.4

Weekly downloads
16
License
ISC
Repository
-
Last release
6 years ago

rsa-js-java

rsa-js-java

NPM 下载包

npm i rsa-js-java --save-dev

js使用

import RSA from 'rsa-js-java'
RSA.setMaxDigits(130)
key = RSA.RSAKeyPair(exponent,'',module)
RSA.encryptedString(key, 'register_pwd')

java使用

Java生成秘钥及存储私钥进Redis
//解密
try {
    PrivateKey privateKey = SecurityKeyUtil.getPrivateKey(UserAspect.privateKeyString);
    aco = SecurityKeyUtil.decrypt(privateKey, aco);
    pwd = SecurityKeyUtil.decrypt(privateKey, pwd);
} catch (Exception e) {
    e.printStackTrace();
    throw new PersonUserException(PersonUserEnum.SESSION_TIMEOUT);
}

For detailed explanation on how things work, checkout the guide and docs for rsa-js-java.