net.sourceforge.jaulp.crypto
Class SimpleEncryptor

java.lang.Object
  extended by net.sourceforge.jaulp.crypto.SimpleEncryptor
All Implemented Interfaces:
Encryptor, SecretCryptor

public class SimpleEncryptor
extends java.lang.Object
implements Encryptor

A simple Encryptor object.

Version:
1.0
Author:
Asterios Raptis

Constructor Summary
SimpleEncryptor()
          Default constructor.
SimpleEncryptor(java.lang.String privateKey)
          Default constructor.
 
Method Summary
 java.lang.String encrypt(java.lang.String string)
          Encrpyt the donated String.
 javax.crypto.Cipher getCipher()
          Returns the cipher from the SecretCryptor object.
 java.lang.String getPrivateKey()
          Returns the private key from the SecretCryptor object.
 void setCipher(javax.crypto.Cipher encryptCipher)
          Sets the cipher from the SecretCryptor object.
 void setPrivateKey(java.lang.String privateKey)
          Sets the private key from the SecretCryptor object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleEncryptor

public SimpleEncryptor()
Default constructor.


SimpleEncryptor

public SimpleEncryptor(java.lang.String privateKey)
Default constructor.

Parameters:
privateKey - The private key.
Method Detail

encrypt

public java.lang.String encrypt(java.lang.String string)
Encrpyt the donated String.

Specified by:
encrypt in interface Encryptor
Parameters:
string - The String to encrypt.
Returns:
The encrypted String.
See Also:
Encryptor.encrypt(java.lang.String)

getCipher

public javax.crypto.Cipher getCipher()
Returns the cipher from the SecretCryptor object.

Specified by:
getCipher in interface SecretCryptor
Returns:
Returns the cipher from the SecretCryptor object.
See Also:
SecretCryptor.getCipher()

getPrivateKey

public java.lang.String getPrivateKey()
Returns the private key from the SecretCryptor object.

Specified by:
getPrivateKey in interface SecretCryptor
Returns:
Returns the private key from the SecretCryptor object.
See Also:
SecretCryptor.getPrivateKey()

setCipher

public void setCipher(javax.crypto.Cipher encryptCipher)
Sets the cipher from the SecretCryptor object.

Specified by:
setCipher in interface SecretCryptor
Parameters:
encryptCipher - The cipher to set.
See Also:
SecretCryptor.setCipher(javax.crypto.Cipher)

setPrivateKey

public void setPrivateKey(java.lang.String privateKey)
Sets the private key from the SecretCryptor object.

Specified by:
setPrivateKey in interface SecretCryptor
Parameters:
privateKey - The private key to set.
See Also:
SecretCryptor.setPrivateKey(java.lang.String)


Copyright © 2010. All Rights Reserved.