com.ibm.crypto.pkcs11impl.provider
Class DSAPublicKey

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

public final class DSAPublicKey
extends com.ibm.security.x509.X509Key
implements PKCS11DSAPublicKey, java.io.Serializable

A PKCS #11 DSA Public Key

See Also:
Serialized Form

Constructor Summary
DSAPublicKey(com.ibm.pkcs11.PKCS11Session session, com.ibm.pkcs11.PKCS11Object object, byte[] ID, byte[] subject, java.lang.String label, java.lang.Boolean isToken, java.math.BigInteger prime, java.math.BigInteger subprime, java.math.BigInteger base, java.math.BigInteger value)
          Defines a DSA public key
 
Method Summary
 java.lang.String getAlgorithm()
          Get algorithm which is DSA
 java.math.BigInteger getBase()
          Returns the base
 java.lang.Boolean getDerive()
          Returns if key supports key derivation
 java.lang.Boolean getEncrypt()
          Return if the key supports encryption
 java.util.Date getEndDate()
          Returns the end date
 java.lang.String getFormat()
          Get format which is PKCS #11
 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 is the key has modifiable attributes
 com.ibm.pkcs11.PKCS11Object getObject()
          Return the PKCS# 11 object
 java.security.interfaces.DSAParams getParams()
          Return the DSA parameters for the receiver.
 java.math.BigInteger getPrime()
          Return the prime.
 java.lang.Boolean getPrivate()
          Returns if the key is private
 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.math.BigInteger getSubprime()
          Return the subprime
 java.lang.Boolean getToken()
          Returns if this key a token object
 java.math.BigInteger getValue()
          Returns the value
 java.lang.Boolean getVerify()
          Return if the key can verify a signature
 java.lang.Boolean getVerifyRecover()
          Returns if the key supports verify recover
 java.lang.Boolean getWrap()
          Returns if the key can wrap another key
 java.math.BigInteger getY()
          Return the value of the public key.
 java.lang.String toString()
          Returns the key in human readable format
 
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
 

Constructor Detail

DSAPublicKey

public DSAPublicKey(com.ibm.pkcs11.PKCS11Session session,
                    com.ibm.pkcs11.PKCS11Object object,
                    byte[] ID,
                    byte[] subject,
                    java.lang.String label,
                    java.lang.Boolean isToken,
                    java.math.BigInteger prime,
                    java.math.BigInteger subprime,
                    java.math.BigInteger base,
                    java.math.BigInteger value)
             throws java.security.InvalidKeyException
Defines a DSA public key

Parameters:
session - the PKCS#11 session associated with the key
object - the PKCS11 object that is the actaully representation of the key to the hardware.
ID - The identifier for this key.
subject - Subject of this key
label - Label of this key
isToken - is this key a token?
prime - P of the DSA parameters
subprime - Q of the DSA Parameters
base - G of the DSA Parameters
value - Public key value.
Throws:
java.security.InvalidKeyException
Method Detail

getObject

public com.ibm.pkcs11.PKCS11Object getObject()
Return the PKCS# 11 object

Specified by:
getObject in interface PKCS11Key
Returns:
object

getToken

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

Specified by:
getToken in interface PKCS11Key
Returns:
true if object is a token object; false if object is a session object

getPrivate

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

Specified by:
getPrivate in interface PKCS11Key
Returns:
true if object is a private object; false if object is a public object.

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 is the key has modifiable attributes

Specified by:
getModifiable in interface PKCS11Key
Returns:
true if object can be modified; false otherwise

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 if key supports key derivation

Specified by:
getDerive in interface PKCS11Key
Returns:
true if key supports key derivation; false otherwise

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 the key supports encryption

Specified by:
getEncrypt in interface PKCS11PublicKey
Returns:
Boolean of value true if the key supports encryption; false otherwise

getVerify

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

Specified by:
getVerify in interface PKCS11PublicKey
Returns:
Boolean of value true if the key supports verifying; false otherwise

getVerifyRecover

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

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

getWrap

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

Specified by:
getWrap in interface PKCS11PublicKey
Returns:
true if key supports wrapping; false otherwise

getPrime

public java.math.BigInteger getPrime()
Return the prime.

Specified by:
getPrime in interface PKCS11DSAPublicKey
Returns:
the prime.

getSubprime

public java.math.BigInteger getSubprime()
Return the subprime

Specified by:
getSubprime in interface PKCS11DSAPublicKey
Returns:
the subprime.

getBase

public java.math.BigInteger getBase()
Returns the base

Specified by:
getBase in interface PKCS11DSAPublicKey
Returns:
the base.

getValue

public java.math.BigInteger getValue()
Returns the value

Specified by:
getValue in interface PKCS11DSAPublicKey
Returns:
the value.

getY

public java.math.BigInteger getY()
Return the value of the public key.

Specified by:
getY in interface java.security.interfaces.DSAPublicKey
Parameters:
the - value of y

getParams

public java.security.interfaces.DSAParams getParams()
Return the DSA parameters for the receiver.

Specified by:
getParams in interface java.security.interfaces.DSAKey
Returns:
DSAParams the DSA parameters of this instance

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 the key in human readable format

Overrides:
toString in class com.ibm.security.x509.X509Key
Returns:
returns a human readable DSA Public Key.

getFormat

public java.lang.String getFormat()
Get format which is PKCS #11

Specified by:
getFormat in interface java.security.Key
Overrides:
getFormat in class com.ibm.security.x509.X509Key

getAlgorithm

public java.lang.String getAlgorithm()
Get algorithm which is DSA

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