Wednesday, November 21, 2001 02:14 AM
Julien is right, this book is very good, so I recommend you run to your nearest book store and buy it.
But here's the javacard.security package in a nutshell.
The javacard.security package provides you with these functionalities :
- Key management
- Signature & verification operations
- Message digest & hashing operations
- Random number generation
To create keys, you use either the KeyBuilder.buildKey() method or the KeyPair class.
To initialize the keys, you use all the setXXX() methods (setKey, setExponent, etc...) according to the type of key you are manipulating (DES, RSA, RSA CRT or DSA), or you can use the genKeyPair() method from the KeyPair class (if supported by the platform).
To generate or verify a signature, you :
- create a Signature object with Signature.getInstance()
- initialize the Signature object in signature or verification mode with the appropriate key
- generate a signature with the update() and sign() methods
- verify a signature with the verify() method
To create a message digest (or hash) :
- create a MessageDigest object with MessageDigest.getInstance()
- generate the hash with the update and doFinal() methods
To generate random numbers, you :
- create a RandomData object with RandomData.getInstance()
- generate random bytes with the generateData() method.
This is just a general overview of the package. Feel free to ask more specific questions. :-)