Getting an Instance of a Key Object
You can get an instance for the following keys:
AES
DESede
HMAC
RSA
EC
For example, to get an instance of an AES key:
Create a new
NaeRijndaelKey
object.Pass the session object and the name of the key on the CipherTrust Manager server.
NaeRijndaelKey aeskey = new NaeRijndaelKey(session, keyName);
It creates an instance of the
NaeRijndaelKey
object that can be used to encrypt and decrypt the data.The operation will fail and throw an exception, if:
The
keyName
passed does not match an actual key on the CipherTrust Manager server.Key name matches but the type of the key is different on the CipherTrust Manager server.
The key object can be used as a
Rijndael
, which is the superclass of theNaeRijndaelKey
class.
Similarly, you can get an instance for DESede, RSA, EC, and HMAC keys.
Refer to Alternative Method to Get an Instance of a Key Object for an alternative method.