com.ibm.crypto.pkcs11impl.provider
Class RSAPublicKey

java.lang.Object
  extended by com.ibm.security.x509.X509Key
      extended by com.ibm.crypto.pkcs11impl.provider.RSAPublicKey
All Implemented Interfaces:
PKCS11Key, PKCS11PublicKey, PKCS11RSAPublicKey, java.io.Serializable, java.security.interfaces.RSAKey, java.security.interfaces.RSAPublicKey, java.security.Key, java.security.PublicKey

public final class RSAPublicKey
extends com.ibm.security.x509.X509Key
implements PKCS11RSAPublicKey, java.io.Serializable

A PKCS11 RSA Public Key

See Also:
Serialized Form

Method Summary
 java.lang.String getAlgorithm()
          Get the Algorithm type
 java.lang.Boolean getDerive()
          Returns true if key supports key derivation
 java.lang.Boolean getEncrypt()
          Return if this key can do encryption
 java.util.Date getEndDate()
          Returns the end date
 java.lang.String getFormat()
          Get format of the key
 byte[] getID()
          Return the ID
 java.lang.Integer getKeyType()
          Return the key type
 java.lang.String getLabel()
          Return the label.
 java.lang.Boolean getLocal()
          Returns true if key was either: 1, generated locally with a C_GenerateKey or C_GenerateKeyPair call 2, created with a C_CopyObject call as a copy of a key which had its CKA_LOCAL attrobute set to TRUE
 java.lang.Boolean getModifiable()
          Returns if the attribuites of the key are modifiable
 java.math.BigInteger getModulus()
          Return the modulus of the key.
 java.lang.Integer getModulusBits()
          Return the modulus bits.
 com.ibm.pkcs11.PKCS11Object getObject()
          Return the PKCS11Object
 java.lang.Boolean getPrivate()
          Returns if the key is private object.
 java.math.BigInteger getPublicExponent()
          Returns the public exponent.
 com.ibm.pkcs11.PKCS11Session getSession()
          Return the session associated with the key.
 java.util.Date getStartDate()
          Returns the start date
 byte[] getSubject()
          Return the subject
 java.lang.Boolean getToken()
          Returns if the key is a token object.
 java.lang.Boolean getVerify()
          Return if this key can verify a signature.
 java.lang.Boolean getVerifyRecover()
          Returns if this key supports verify recover
 java.lang.Boolean getWrap()
          Returns if this key can wrap another key
 java.lang.String toString()
          Returns a human readable version of the RSA Public key.
 
Methods inherited from class com.ibm.security.x509.X509Key
decode, decode, encode, encode, equals, getAlgorithmId, getEncoded, hashCode, parse, parse, write, writeBASE64
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.Key
getEncoded
 
Methods inherited from interface java.security.Key
getEncoded
 
Methods inherited from interface java.security.Key
getEncoded
 

Method Detail

getObject

public com.ibm.pkcs11.PKCS11Object getObject()
Return the PKCS11Object

Specified by:
getObject in interface PKCS11Key
Returns:
object

getToken

public java.lang.Boolean getToken()
Returns if the key is a token object.

Specified by:
getToken in interface PKCS11Key
Returns:
true if object is a token object; null if not assigned.

getPrivate

public java.lang.Boolean getPrivate()
Returns if the key is private object.

Specified by:
getPrivate in interface PKCS11Key
Returns:
true if object is a private object; null if not assigned..

getLabel

public java.lang.String getLabel()
Return the label.

Specified by:
getLabel in interface PKCS11Key
Returns:
the label.

getModifiable

public java.lang.Boolean getModifiable()
Returns if the attribuites of the key are modifiable

Specified by:
getModifiable in interface PKCS11Key
Returns:
true if object can be modified; null if not assigned.

getKeyType

public java.lang.Integer getKeyType()
Return the key type

Specified by:
getKeyType in interface PKCS11Key
Returns:
the key type

getID

public byte[] getID()
Return the ID

Specified by:
getID in interface PKCS11Key
Returns:
the ID

getStartDate

public java.util.Date getStartDate()
Returns the start date

Specified by:
getStartDate in interface PKCS11Key
Returns:
the start date

getEndDate

public java.util.Date getEndDate()
Returns the end date

Specified by:
getEndDate in interface PKCS11Key
Returns:
the end date

getDerive

public java.lang.Boolean getDerive()
Returns true if key supports key derivation

Specified by:
getDerive in interface PKCS11Key
Returns:
true if key supports key derivation; null if not assigned.

getLocal

public java.lang.Boolean getLocal()
Returns true if key was either: 1, generated locally with a C_GenerateKey or C_GenerateKeyPair call 2, created with a C_CopyObject call as a copy of a key which had its CKA_LOCAL attrobute set to TRUE

Specified by:
getLocal in interface PKCS11Key
Returns:
true if key was either generated locally or created as a copy of a key which had its CKA_local sttribute set to TRUE

getSubject

public byte[] getSubject()
Return the subject

Specified by:
getSubject in interface PKCS11PublicKey
Returns:
the subject

getEncrypt

public java.lang.Boolean getEncrypt()
Return if this key can do encryption

Specified by:
getEncrypt in interface PKCS11PublicKey
Returns:
Boolean of value true if the key supports encryption null if not assigned.

getVerify

public java.lang.Boolean getVerify()
Return if this key can verify a signature.

Specified by:
getVerify in interface PKCS11PublicKey
Returns:
Boolean of value true if the key supports verifying null if not assigned.

getVerifyRecover

public java.lang.Boolean getVerifyRecover()
Returns if this key supports verify recover

Specified by:
getVerifyRecover in interface PKCS11PublicKey
Returns:
true if key supports verification where the data is recovered from the signature; null if not assigned.

getWrap

public java.lang.Boolean getWrap()
Returns if this key can wrap another key

Specified by:
getWrap in interface PKCS11PublicKey
Returns:
true if key supports wrapping; null if not assigned.

getModulus

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

Specified by:
getModulus in interface PKCS11RSAPublicKey
Specified by:
getModulus in interface java.security.interfaces.RSAKey
Returns:
the modulus

getModulusBits

public java.lang.Integer getModulusBits()
Return the modulus bits.

Specified by:
getModulusBits in interface PKCS11RSAPublicKey
Returns:
the modulus bits of the key

getPublicExponent

public java.math.BigInteger getPublicExponent()
Returns the public exponent.

Specified by:
getPublicExponent in interface PKCS11RSAPublicKey
Specified by:
getPublicExponent in interface java.security.interfaces.RSAPublicKey
Returns:
the public exponent.

getSession

public com.ibm.pkcs11.PKCS11Session getSession()
Return the session associated with the key.

Specified by:
getSession in interface PKCS11Key
Returns:
the session associated with the key

toString

public java.lang.String toString()
Returns a human readable version of the RSA Public key.

Overrides:
toString in class com.ibm.security.x509.X509Key
Returns:
String that is the RSA Public key.

getFormat

public java.lang.String getFormat()
Get format of the key

Specified by:
getFormat in interface java.security.Key
Overrides:
getFormat in class com.ibm.security.x509.X509Key
Returns:
Always returns PKCS#11

getAlgorithm

public java.lang.String getAlgorithm()
Get the Algorithm type

Specified by:
getAlgorithm in interface java.security.Key
Overrides:
getAlgorithm in class com.ibm.security.x509.X509Key
Returns:
Always returns RSA