Class RsaRawEncryptor
- java.lang.Object
-
- org.springframework.security.rsa.crypto.RsaRawEncryptor
-
- All Implemented Interfaces:
org.springframework.security.crypto.encrypt.BytesEncryptor,org.springframework.security.crypto.encrypt.TextEncryptor,RsaKeyHolder
public class RsaRawEncryptor extends Object implements org.springframework.security.crypto.encrypt.BytesEncryptor, org.springframework.security.crypto.encrypt.TextEncryptor, RsaKeyHolder
- Author:
- Dave Syer
-
-
Constructor Summary
Constructors Constructor Description RsaRawEncryptor()RsaRawEncryptor(String pemData)RsaRawEncryptor(String encoding, PublicKey publicKey, PrivateKey privateKey)RsaRawEncryptor(String encoding, PublicKey publicKey, PrivateKey privateKey, RsaAlgorithm algorithm)RsaRawEncryptor(KeyPair keyPair)RsaRawEncryptor(KeyPair keyPair, RsaAlgorithm algorithm)RsaRawEncryptor(PublicKey publicKey)RsaRawEncryptor(RsaAlgorithm algorithm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]decrypt(byte[] encryptedByteArray)Stringdecrypt(String encryptedText)byte[]encrypt(byte[] byteArray)Stringencrypt(String text)StringgetPublicKey()
-
-
-
Constructor Detail
-
RsaRawEncryptor
public RsaRawEncryptor(RsaAlgorithm algorithm)
-
RsaRawEncryptor
public RsaRawEncryptor()
-
RsaRawEncryptor
public RsaRawEncryptor(KeyPair keyPair, RsaAlgorithm algorithm)
-
RsaRawEncryptor
public RsaRawEncryptor(KeyPair keyPair)
-
RsaRawEncryptor
public RsaRawEncryptor(String pemData)
-
RsaRawEncryptor
public RsaRawEncryptor(PublicKey publicKey)
-
RsaRawEncryptor
public RsaRawEncryptor(String encoding, PublicKey publicKey, PrivateKey privateKey)
-
RsaRawEncryptor
public RsaRawEncryptor(String encoding, PublicKey publicKey, PrivateKey privateKey, RsaAlgorithm algorithm)
-
-
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
-
-