Package com.appslandia.common.crypto
Class RsaEncryptor
- 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
-
-
Field Summary
-
Fields inherited from class com.appslandia.common.base.InitializeObject
mutex
-
-
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(java.lang.String privateKeyPem)RsaEncryptorsetPrivateKey(java.security.PrivateKey privateKey)RsaEncryptorsetProvider(java.lang.String provider)RsaEncryptorsetPublicKey(java.lang.String publicKeyPem)RsaEncryptorsetPublicKey(java.security.PublicKey publicKey)RsaEncryptorsetTransformation(java.lang.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 java.lang.Exception- Specified by:
initin classInitializeObject- Throws:
java.lang.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(java.lang.String transformation)
-
setProvider
public RsaEncryptor setProvider(java.lang.String provider)
-
setPrivateKey
public RsaEncryptor setPrivateKey(java.security.PrivateKey privateKey)
-
setPrivateKey
public RsaEncryptor setPrivateKey(java.lang.String privateKeyPem)
-
setPublicKey
public RsaEncryptor setPublicKey(java.security.PublicKey publicKey)
-
setPublicKey
public RsaEncryptor setPublicKey(java.lang.String publicKeyPem)
-
copy
public RsaEncryptor copy()
-
-