|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--demo.RSA
This class tests the RSA cipher implementation.
IAIK-JCE allows to use the javax.crypto.Cipher
class
for working with RSA ciphers. Creating a RSA cipher is done in the
same way as creating a, for instance, DES or IDEA cipher by calling
a proper getInstance
factory method, e.g.:
Cipher rsa = Cipher.getInstance("RSA");
The supplied transformation string may be expanded to perform block formatting according to PKCS#1 with block type 1 or blocktype 2, i.e.:
Cipher rsa = Cipher.getInstance("RSA/ECB/PKCS1Padding");
The further proceeding uses cipher initialization, cipher update and cipher finishing as used with any other cipher, e.g.:
rsa.init(Cipher.ENCRYPT_MODE, public_key); byte[] encrypted = rsa.doFinal(plain_data);
Constructor Summary | |
RSA()
|
Method Summary | |
static void |
main(String[] argv)
Starts the RSA cipher implementation test. |
void |
start()
Performs the RSA cipher implementation test. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RSA()
Method Detail |
public void start()
First a RSA key pair for 512 bit modulus is generated, which may last a few moments. Subsequently, a RSA cipher object is created for encrypting some test data. For verifying the result of the encryption process, it is decrypted again and compared with the original data.
true
if no errors occurs during en/decryption,
false
otherwisepublic static void main(String[] argv)
|
This Javadoc may contain text parts from IETF Internet Standard specifications, see copyright note) and RSA Data Security Public-Key Cryptography Standards (see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |