IAIK PKCS#11 Provider API Documentation
version 1.6

iaik.pkcs.pkcs11.provider.keys
Class IAIKPKCS11PrivateKey

java.lang.Object
  extended by iaik.pkcs.pkcs11.provider.keys.IAIKPKCS11Key
      extended by iaik.pkcs.pkcs11.provider.keys.IAIKPKCS11PrivateKey
All Implemented Interfaces:
java.io.Serializable, java.security.Key, java.security.PrivateKey
Direct Known Subclasses:
IAIKPKCS11DhPrivateKey, IAIKPKCS11DsaPrivateKey, IAIKPKCS11ECPrivateKey, IAIKPKCS11RsaPrivateKey

public class IAIKPKCS11PrivateKey
extends IAIKPKCS11Key
implements java.security.PrivateKey

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 java.security.PrivateKey
serialVersionUID
 
Method Summary
static IAIKPKCS11PrivateKey create(TokenManager tokenManager, iaik.pkcs.pkcs11.objects.PrivateKey privateKeyObject)
          Create a new instance of a IAIKPKCS11PrivateKey which's token managed by the given token manager and is based on the given PKCS#11 key object.
 byte[] getEncoded()
          Get the PKCS#8 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 IAIKPKCS11PrivateKey create(TokenManager tokenManager,
                                          iaik.pkcs.pkcs11.objects.PrivateKey privateKeyObject)
Create a new instance of a IAIKPKCS11PrivateKey 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.
privateKeyObject - The PKCS#11 key object.
Returns:
A new IAIKPKCS11PrivateKey that can be used with this provider.
Postconditions
(result <> null)

getEncoded

public byte[] getEncoded()
Get the PKCS#8 encoded key.

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.

getFormat

public java.lang.String getFormat()
Get the encoding name.

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

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