IAIK PKCS#11 Provider API Documentation
version 1.6

iaik.pkcs.pkcs11.provider.keys
Class IAIKPKCS11RsaPrivateKey

java.lang.Object
  extended by iaik.pkcs.pkcs11.provider.keys.IAIKPKCS11Key
      extended by iaik.pkcs.pkcs11.provider.keys.IAIKPKCS11PrivateKey
          extended by iaik.pkcs.pkcs11.provider.keys.IAIKPKCS11RsaPrivateKey
All Implemented Interfaces:
java.io.Serializable, java.security.interfaces.RSAKey, java.security.interfaces.RSAPrivateCrtKey, java.security.interfaces.RSAPrivateKey, java.security.Key, java.security.PrivateKey

public class IAIKPKCS11RsaPrivateKey
extends IAIKPKCS11PrivateKey
implements java.security.interfaces.RSAPrivateCrtKey

A Java RSA private key object that is associated with a PKCS#11 RSA private 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.interfaces.RSAPrivateCrtKey
serialVersionUID
 
Constructor Summary
IAIKPKCS11RsaPrivateKey(TokenManager tokenManager, iaik.pkcs.pkcs11.objects.RSAPrivateKey privateKeyObject)
          Construct a private key object that is associated with the given privatekeyObjecton the given token.
 
Method Summary
static IAIKPKCS11RsaPrivateKey create(TokenManager tokenManager, iaik.pkcs.pkcs11.objects.RSAPrivateKey privateKeyObject)
          Create a new instance of a IAIKPKCS11RsaPrivateKey which's token managed by the given token manager and is based on the given PKCS#11 key object.
 java.lang.String getAlgorithm()
          Get the algorithm name.
 java.math.BigInteger getCrtCoefficient()
          Get the CRT coefficient of this key.
 java.math.BigInteger getModulus()
          Get the modulus of this key.
 java.math.BigInteger getPrimeExponentP()
          Get the prime exponent of P of this key.
 java.math.BigInteger getPrimeExponentQ()
          Get the prime exponent of Q of this key.
 java.math.BigInteger getPrimeP()
          Get the prime P of this key.
 java.math.BigInteger getPrimeQ()
          Get the prime Q of this key.
 java.math.BigInteger getPrivateExponent()
          Get the private exponent of this key.
 java.math.BigInteger getPublicExponent()
          Get the public exponent of this key.
 
Methods inherited from class iaik.pkcs.pkcs11.provider.keys.IAIKPKCS11PrivateKey
create, getEncoded, getFormat
 
Methods inherited from class iaik.pkcs.pkcs11.provider.keys.IAIKPKCS11Key
create, destroy, finalize, 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
getEncoded, getFormat
 

Constructor Detail

IAIKPKCS11RsaPrivateKey

public IAIKPKCS11RsaPrivateKey(TokenManager tokenManager,
                               iaik.pkcs.pkcs11.objects.RSAPrivateKey privateKeyObject)
Construct a private key object that is associated with the given privatekeyObjecton the given token.

Parameters:
tokenManager - The token manager of the token where this key resides.
privateKeyObject - The PKCS#11 key object.
Preconditions
(token <> null) and (privateKeyObject <> null)
Method Detail

create

public static IAIKPKCS11RsaPrivateKey create(TokenManager tokenManager,
                                             iaik.pkcs.pkcs11.objects.RSAPrivateKey privateKeyObject)
Create a new instance of a IAIKPKCS11RsaPrivateKey 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 IAIKPKCS11RsaPrivateKey that can be used with this provider.
Postconditions
(result <> null)

getPublicExponent

public java.math.BigInteger getPublicExponent()
Get the public exponent of this key.

Specified by:
getPublicExponent in interface java.security.interfaces.RSAPrivateCrtKey
Returns:
The public exponent.
Throws:
java.lang.UnsupportedOperationException - If the value is not present or if the value is sensitive.
Postconditions
(result <> null)

getPrimeP

public java.math.BigInteger getPrimeP()
Get the prime P of this key.

Specified by:
getPrimeP in interface java.security.interfaces.RSAPrivateCrtKey
Returns:
The prime P.
Throws:
java.lang.UnsupportedOperationException - If the value is not present or if the value is sensitive.
Postconditions
(result <> null)

getPrimeQ

public java.math.BigInteger getPrimeQ()
Get the prime Q of this key.

Specified by:
getPrimeQ in interface java.security.interfaces.RSAPrivateCrtKey
Returns:
The prime Q.
Throws:
java.lang.UnsupportedOperationException - If the value is not present or if the value is sensitive.
Postconditions
(result <> null)

getPrimeExponentP

public java.math.BigInteger getPrimeExponentP()
Get the prime exponent of P of this key.

Specified by:
getPrimeExponentP in interface java.security.interfaces.RSAPrivateCrtKey
Returns:
The prime exponent of P.
Throws:
java.lang.UnsupportedOperationException - If the value is not present or if the value is sensitive.
Postconditions
(result <> null)

getPrimeExponentQ

public java.math.BigInteger getPrimeExponentQ()
Get the prime exponent of Q of this key.

Specified by:
getPrimeExponentQ in interface java.security.interfaces.RSAPrivateCrtKey
Returns:
The prime exponent of Q.
Throws:
java.lang.UnsupportedOperationException - If the value is not present or if the value is sensitive.
Postconditions
(result <> null)

getCrtCoefficient

public java.math.BigInteger getCrtCoefficient()
Get the CRT coefficient of this key.

Specified by:
getCrtCoefficient in interface java.security.interfaces.RSAPrivateCrtKey
Returns:
The CRT coefficient.
Throws:
java.lang.UnsupportedOperationException - If the value is not present or if the value is sensitive.
Postconditions
(result <> null)

getPrivateExponent

public java.math.BigInteger getPrivateExponent()
Get the private exponent of this key.

Specified by:
getPrivateExponent in interface java.security.interfaces.RSAPrivateKey
Returns:
The private exponent.
Throws:
java.lang.UnsupportedOperationException - If the value is not present or if the value is sensitive.
Postconditions
(result <> null)

getModulus

public java.math.BigInteger getModulus()
Get the modulus of this key.

Specified by:
getModulus in interface java.security.interfaces.RSAKey
Returns:
The modulus.
Throws:
java.lang.UnsupportedOperationException - If the value is not present or if the value is sensitive.
Postconditions
(result <> null)

getAlgorithm

public java.lang.String getAlgorithm()
Get the algorithm name.

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

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