IAIK PKCS#11 Provider API Documentation
version 1.6

iaik.pkcs.pkcs11.provider.keys
Class IAIKPKCS11SecretKey

java.lang.Object
  extended by iaik.pkcs.pkcs11.provider.keys.IAIKPKCS11Key
      extended by iaik.pkcs.pkcs11.provider.keys.IAIKPKCS11SecretKey
All Implemented Interfaces:
java.io.Serializable, java.security.Key, javax.crypto.SecretKey

public class IAIKPKCS11SecretKey
extends IAIKPKCS11Key
implements javax.crypto.SecretKey

A Java key object that is associated with a PKCS#11 key object. This class uses the PKCS#11 wrapper from IAIK.

Author:
Karl Scheibelhofer
See Also:
Serialized Form

Field Summary
 
Fields inherited from class iaik.pkcs.pkcs11.provider.keys.IAIKPKCS11Key
AES, BATON, BLOWFISH, CAST, CAST128, CAST3, CAST5, CDMF, DES, DES2, DESede, DH, DSA, ECDSA, GENERIC_SECRET, IDEA, JUNIPER, KEA, RC2, RC4, RC5, RSA, SKIPJACK, TWOFISH, VENDOR_DEFINED
 
Fields inherited from interface javax.crypto.SecretKey
serialVersionUID
 
Method Summary
static IAIKPKCS11SecretKey create(TokenManager tokenManager, iaik.pkcs.pkcs11.objects.SecretKey secretKeyObject)
          Create a new instance of a IAIKPKCS11SecretKey which's token managed by the given token manager and is based on the given PKCS#11 key object.
 byte[] getEncoded()
          Get the encoded key.
 java.lang.String getFormat()
          Get the encoding name.
 
Methods inherited from class iaik.pkcs.pkcs11.provider.keys.IAIKPKCS11Key
create, destroy, finalize, getAlgorithm, getAlgorithmCode, getAlgorithmName, getAlias, getKeyID, getKeyObject, getSession, getTokenManager, isAutoDestroy, isDestroyed, setAutoDestroy, setSession, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.Key
getAlgorithm
 

Method Detail

create

public static IAIKPKCS11SecretKey create(TokenManager tokenManager,
                                         iaik.pkcs.pkcs11.objects.SecretKey secretKeyObject)
Create a new instance of a IAIKPKCS11SecretKey which's token managed by the given token manager and is based on the given PKCS#11 key object.

Parameters:
tokenManager - The token manager of the token where the key is.
secretKeyObject - The PKCS#11 key object.
Returns:
A new IAIKPKCS11SecretKey that can be used with this provider.
Postconditions
(result <> null)

getFormat

public java.lang.String getFormat()
Get the encoding name. This is "RAW" for all secret keys, what means that that the encoding is the raw key value as byte array.

Specified by:
getFormat in interface java.security.Key
Overrides:
getFormat in class IAIKPKCS11Key
Returns:
"RAW".
Postconditions
(result <> null) and (result.equals("RAW"))

getEncoded

public byte[] getEncoded()
Get the encoded key. This is the raw key value.

Specified by:
getEncoded in interface java.security.Key
Overrides:
getEncoded in class IAIKPKCS11Key
Returns:
The encoded key or null, if this key cannot be encoded; e.g if some parameters of this key are unavailable or not accessible.

IAIK PKCS#11 Provider API Documentation
version 1.6

IAIK JavaSecurity Website http://jce.iaik.tugraz.at/

IAIK at Graz University of Technology, Austria, Europe
Copyright 2001-2004, IAIK, Graz University of Technology, Inffeldgasse 16a, 8010 Graz, Austria. All Rights Reserved.
version 1.6