IAIK PKCS#11 Provider API Documentation
version 1.6

iaik.pkcs.pkcs11.provider.keys
Class IAIKPKCS11PublicKey

java.lang.Object
  extended by iaik.pkcs.pkcs11.provider.keys.IAIKPKCS11Key
      extended by iaik.pkcs.pkcs11.provider.keys.IAIKPKCS11PublicKey
All Implemented Interfaces:
java.io.Serializable, java.security.Key, java.security.PublicKey
Direct Known Subclasses:
IAIKPKCS11DhPublicKey, IAIKPKCS11DsaPublicKey, IAIKPKCS11ECPublicKey, IAIKPKCS11RsaPublicKey

public class IAIKPKCS11PublicKey
extends IAIKPKCS11Key
implements java.security.PublicKey

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

getEncoded

public byte[] getEncoded()
Get the X.509 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:
"X.509".
Postconditions
(result <> null) and (result.equals("X.509"))

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