Class RsaRawEncryptor
java.lang.Object
org.springframework.security.crypto.encrypt.RsaRawEncryptor
- All Implemented Interfaces:
BytesEncryptor
,RsaKeyHolder
,TextEncryptor
- Since:
- 6.3
-
Constructor Summary
ConstructorsConstructorDescriptionRsaRawEncryptor
(String pemData) RsaRawEncryptor
(String encoding, PublicKey publicKey, @Nullable PrivateKey privateKey) RsaRawEncryptor
(String encoding, PublicKey publicKey, @Nullable PrivateKey privateKey, RsaAlgorithm algorithm) RsaRawEncryptor
(KeyPair keyPair) RsaRawEncryptor
(KeyPair keyPair, RsaAlgorithm algorithm) RsaRawEncryptor
(PublicKey publicKey) RsaRawEncryptor
(RsaAlgorithm algorithm) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
decrypt
(byte[] encryptedByteArray) Decrypt the byte array.Decrypt the encrypted text string.byte[]
encrypt
(byte[] byteArray) Encrypt the byte array.Encrypt the raw text string.static int
getByteLength
(@Nullable RSAKey key)
-
Constructor Details
-
RsaRawEncryptor
-
RsaRawEncryptor
public RsaRawEncryptor() -
RsaRawEncryptor
-
RsaRawEncryptor
-
RsaRawEncryptor
-
RsaRawEncryptor
-
RsaRawEncryptor
-
RsaRawEncryptor
public RsaRawEncryptor(String encoding, PublicKey publicKey, @Nullable PrivateKey privateKey, RsaAlgorithm algorithm)
-
-
Method Details
-
getPublicKey
- Specified by:
getPublicKey
in interfaceRsaKeyHolder
-
encrypt
Description copied from interface:TextEncryptor
Encrypt the raw text string.- Specified by:
encrypt
in interfaceTextEncryptor
-
decrypt
Description copied from interface:TextEncryptor
Decrypt the encrypted text string.- Specified by:
decrypt
in interfaceTextEncryptor
-
encrypt
public byte[] encrypt(byte[] byteArray) Description copied from interface:BytesEncryptor
Encrypt the byte array.- Specified by:
encrypt
in interfaceBytesEncryptor
-
decrypt
public byte[] decrypt(byte[] encryptedByteArray) Description copied from interface:BytesEncryptor
Decrypt the byte array.- Specified by:
decrypt
in interfaceBytesEncryptor
-
getByteLength
-