public class RSAEnctryptor extends Object implements AsymmetricEncryptor
public byte[] pubEncode(String data) throws InvalidKeyException, IllegalBlockSizeException, BadPaddingException
pubEncode 在接口中 AsymmetricEncryptordata - 待加密内容LeonaRuntimeException - RSA公钥加密异常InvalidKeyExceptionIllegalBlockSizeExceptionBadPaddingExceptionpublic byte[] priDecode(byte[] data)
throws InvalidKeyException,
IllegalBlockSizeException,
BadPaddingException
priDecode 在接口中 AsymmetricEncryptordata - 待解密内容LeonaRuntimeException - RSA私钥解密异常InvalidKeyExceptionIllegalBlockSizeExceptionBadPaddingExceptionpublic byte[] sign(byte[] data)
throws SignatureException,
InvalidKeyException
sign 在接口中 AsymmetricEncryptordata - 待签名内容LeonaRuntimeException - RSA加签异常SignatureExceptionInvalidKeyExceptionpublic boolean verify(byte[] content,
byte[] sign)
throws SignatureException,
InvalidKeyException
verify 在接口中 AsymmetricEncryptorcontent - 待验签内容sign - 签名LeonaRuntimeException - RSA验签异常SignatureExceptionInvalidKeyExceptionCopyright © 2020. All rights reserved.