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

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

public class RSAEncryptionTest
extends Object

This class tests the encryption and decryption using RSA.

Author:
Dominik Zindel (DZI)
File-location:
RSAEncryptionTest
Last check-in date:
2009-12-01 10:59:54 +0100 (Di, 01. Dez 2009) by jonasha for revision 4010

Field Summary
private  RSACipher m_cipher
          The cipher used for en- and decryption.
private  String m_text
          The text that will be en- and decrypted.
 
Constructor Summary
RSAEncryptionTest()
           
 
Method Summary
 void setUp()
          Generates a cipher with a key.
 void testDiffEnDecryption()
          Encrypts a text, modifies the encrypted text, decrypts it and checks if the result is really different from the original input.
 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 RSACipher m_cipher
The cipher used for en- and decryption.


m_text

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

Constructor Detail

RSAEncryptionTest

public RSAEncryptionTest()
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).


testDiffEnDecryption

public void testDiffEnDecryption()
Encrypts a text, modifies the encrypted text, decrypts it and checks if the result is really different from the original input.



Copyright © 2005-2011 ELCA. All Rights Reserved.