ch.elca.el4j.tests.services.security
Class AESEncryptionTest

java.lang.Object
  extended by ch.elca.el4j.tests.services.security.AESEncryptionTest

public class AESEncryptionTest
extends Object

This class tests the encryption and decryption using AES.

Author:
Dominik Zindel (DZI)
File-location:
AESEncryptionTest
Last check-in date:
2009-08-04 13:59:45 +0200 (Di, 04. Aug 2009) by swismer for revision 3873

Field Summary
private  AESCipher m_cipher
          The cipher used for en- and decryption.
private  String m_key
          The generated key.
private  String m_text
          The text that will be en- and decrypted.
 
Constructor Summary
AESEncryptionTest()
           
 
Method Summary
 void setUp()
          Generates a cipher with a key.
 void testDecryption()
          Tests the decryption of an encrypted text.
 void testEncryption()
          Tests the encryption of a text.
 void testEnDecryption()
          Encrypts and then decrypts a text and checks if the result of the decryption equals the input of the encryption (= the original text).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_cipher

private AESCipher m_cipher
The cipher used for en- and decryption.


m_key

private String m_key
The generated key.


m_text

private String m_text
The text that will be en- and decrypted.

Constructor Detail

AESEncryptionTest

public AESEncryptionTest()
Method Detail

setUp

public void setUp()
           throws Exception
Generates a cipher with a key.

Throws:
Exception

testEnDecryption

public void testEnDecryption()
Encrypts and then decrypts a text and checks if the result of the decryption equals the input of the encryption (= the original text).


testEncryption

public void testEncryption()
Tests the encryption of a text.


testDecryption

public void testDecryption()
Tests the decryption of an encrypted text.



Copyright © 2005-2011 ELCA. All Rights Reserved.