|
|||||||||
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", "IAIK");
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", "IAIK");
If you want to use OAEP es encryption scheme you have to specify "OAEP" as padding scheme when instantiating the cipher object:
Cipher rsa = Cipher.getInstance("RSA/ECB/OAEP");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()
Default constructor. |
Method Summary | |
static void |
main(String[] argv)
Starts the RSA cipher implementation test. |
void |
rsa(String transformation)
RSA cipher test. |
void |
start()
Performs the RSA cipher implementation test. |
void |
testOAEPParametersCreate()
Test of OAEP parameter creation. |
void |
testOAEPParametersParse()
Test of OAEP parameter parsing. |
void |
testOAEPPSourceParameters()
Test of OAEP PSourceAlgorithm parameters. |
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()
public void rsa(String transformation)
transformation
- the Cipher transformation string (e.g. "RSA/ECB/OAEP");public void testOAEPParametersParse()
public void testOAEPParametersCreate()
public void testOAEPPSourceParameters()
public static void main(String[] argv)
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |