- java.lang.Object
-
- com.appslandia.common.base.InitializeObject
-
- com.appslandia.common.crypto.RsaEncryptor
-
- All Implemented Interfaces:
InitializeSupport,Encryptor
public class RsaEncryptor extends InitializeObject implements Encryptor
- Author:
- Loc Ha
-
-
Constructor Summary
Constructors Constructor Description RsaEncryptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RsaEncryptorcopy()byte[]decrypt(byte[] message)byte[]decrypt(byte[] message, byte[] salt)voiddestroy()byte[]encrypt(byte[] message)byte[]encrypt(byte[] message, Out<byte[]> salt)protected voidinit()RsaEncryptorsetPrivateKey(String privateKeyPem)RsaEncryptorsetPrivateKey(PrivateKey privateKey)RsaEncryptorsetProvider(String provider)RsaEncryptorsetPublicKey(String publicKeyPem)RsaEncryptorsetPublicKey(PublicKey publicKey)RsaEncryptorsetTransformation(String transformation)-
Methods inherited from class com.appslandia.common.base.InitializeObject
assertNotInitialized, initialize
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.appslandia.common.base.InitializeSupport
initialize
-
-
-
-
Method Detail
-
init
protected void init() throws Exception- Specified by:
initin classInitializeObject- Throws:
Exception
-
destroy
public void destroy() throws DestroyException- Specified by:
destroyin interfaceInitializeSupport- Overrides:
destroyin classInitializeObject- Throws:
DestroyException
-
encrypt
public byte[] encrypt(byte[] message) throws CryptoException- Specified by:
encryptin interfaceEncryptor- Throws:
CryptoException
-
decrypt
public byte[] decrypt(byte[] message) throws CryptoException- Specified by:
decryptin interfaceEncryptor- Throws:
CryptoException
-
encrypt
public byte[] encrypt(byte[] message, Out<byte[]> salt) throws CryptoException- Specified by:
encryptin interfaceEncryptor- Throws:
CryptoException
-
decrypt
public byte[] decrypt(byte[] message, byte[] salt) throws CryptoException- Specified by:
decryptin interfaceEncryptor- Throws:
CryptoException
-
setTransformation
public RsaEncryptor setTransformation(String transformation)
-
setProvider
public RsaEncryptor setProvider(String provider)
-
setPrivateKey
public RsaEncryptor setPrivateKey(PrivateKey privateKey)
-
setPrivateKey
public RsaEncryptor setPrivateKey(String privateKeyPem)
-
setPublicKey
public RsaEncryptor setPublicKey(PublicKey publicKey)
-
setPublicKey
public RsaEncryptor setPublicKey(String publicKeyPem)
-
copy
public RsaEncryptor copy()
-
-