Class RsaSecretEncryptor
- java.lang.Object
-
- org.springframework.security.rsa.crypto.RsaSecretEncryptor
-
- All Implemented Interfaces:
org.springframework.security.crypto.encrypt.BytesEncryptor,org.springframework.security.crypto.encrypt.TextEncryptor,RsaKeyHolder
public class RsaSecretEncryptor extends Object implements org.springframework.security.crypto.encrypt.BytesEncryptor, org.springframework.security.crypto.encrypt.TextEncryptor, RsaKeyHolder
- Author:
- Dave Syer
-
-
Constructor Summary
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanDecrypt()byte[]decrypt(byte[] encryptedByteArray)Stringdecrypt(String encryptedText)byte[]encrypt(byte[] byteArray)Stringencrypt(String text)StringgetPublicKey()
-
-
-
Constructor Detail
-
RsaSecretEncryptor
public RsaSecretEncryptor(RsaAlgorithm algorithm, String salt, boolean gcm)
-
RsaSecretEncryptor
public RsaSecretEncryptor(RsaAlgorithm algorithm, String salt)
-
RsaSecretEncryptor
public RsaSecretEncryptor(RsaAlgorithm algorithm, boolean gcm)
-
RsaSecretEncryptor
public RsaSecretEncryptor(RsaAlgorithm algorithm)
-
RsaSecretEncryptor
public RsaSecretEncryptor()
-
RsaSecretEncryptor
public RsaSecretEncryptor(KeyPair keyPair, RsaAlgorithm algorithm, String salt, boolean gcm)
-
RsaSecretEncryptor
public RsaSecretEncryptor(KeyPair keyPair, RsaAlgorithm algorithm, String salt)
-
RsaSecretEncryptor
public RsaSecretEncryptor(KeyPair keyPair, RsaAlgorithm algorithm)
-
RsaSecretEncryptor
public RsaSecretEncryptor(KeyPair keyPair)
-
RsaSecretEncryptor
public RsaSecretEncryptor(String pemData, RsaAlgorithm algorithm, String salt)
-
RsaSecretEncryptor
public RsaSecretEncryptor(String pemData, RsaAlgorithm algorithm)
-
RsaSecretEncryptor
public RsaSecretEncryptor(String pemData)
-
RsaSecretEncryptor
public RsaSecretEncryptor(PublicKey publicKey, RsaAlgorithm algorithm, String salt, boolean gcm)
-
RsaSecretEncryptor
public RsaSecretEncryptor(PublicKey publicKey, RsaAlgorithm algorithm, String salt)
-
RsaSecretEncryptor
public RsaSecretEncryptor(PublicKey publicKey, RsaAlgorithm algorithm)
-
RsaSecretEncryptor
public RsaSecretEncryptor(PublicKey publicKey)
-
RsaSecretEncryptor
public RsaSecretEncryptor(String encoding, PublicKey publicKey, PrivateKey privateKey)
-
RsaSecretEncryptor
public RsaSecretEncryptor(String encoding, PublicKey publicKey, PrivateKey privateKey, RsaAlgorithm algorithm)
-
RsaSecretEncryptor
public RsaSecretEncryptor(String encoding, PublicKey publicKey, PrivateKey privateKey, RsaAlgorithm algorithm, String salt, boolean gcm)
-
-
Method Detail
-
getPublicKey
public String getPublicKey()
- Specified by:
getPublicKeyin interfaceRsaKeyHolder
-
encrypt
public String encrypt(String text)
- Specified by:
encryptin interfaceorg.springframework.security.crypto.encrypt.TextEncryptor
-
decrypt
public String decrypt(String encryptedText)
- Specified by:
decryptin interfaceorg.springframework.security.crypto.encrypt.TextEncryptor
-
encrypt
public byte[] encrypt(byte[] byteArray)
- Specified by:
encryptin interfaceorg.springframework.security.crypto.encrypt.BytesEncryptor
-
decrypt
public byte[] decrypt(byte[] encryptedByteArray)
- Specified by:
decryptin interfaceorg.springframework.security.crypto.encrypt.BytesEncryptor
-
canDecrypt
public boolean canDecrypt()
-
-