com.ibm.crypto.pkcs11impl.provider

Class PKCS11ECPrivateKey

  • java.lang.Object
    • com.ibm.security.pkcsutil.PKCSDerObject
      • com.ibm.security.pkcs8.PrivateKeyInfo
        • com.ibm.crypto.pkcs11impl.provider.PKCS11ECPrivateKey
  • All Implemented Interfaces:
    PKCS11Key, PKCS11PrivateKey, com.ibm.pkcs11.P11Key, java.io.Serializable, java.lang.Cloneable, java.security.interfaces.ECKey, java.security.interfaces.ECPrivateKey, java.security.Key, java.security.PrivateKey, javax.security.auth.Destroyable


    public final class PKCS11ECPrivateKey
    extends com.ibm.security.pkcs8.PrivateKeyInfo
    implements PKCS11PrivateKey, java.security.interfaces.ECPrivateKey
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class com.ibm.security.pkcs8.PrivateKeyInfo

        version
    • Constructor Summary

      Constructors 
      Constructor and Description
      PKCS11ECPrivateKey(Session session, com.ibm.pkcs11.PKCS11Object object, byte[] id, byte[] subject, java.lang.String label, byte[] parms) 
      PKCS11ECPrivateKey(Session session, com.ibm.pkcs11.PKCS11Object object, byte[] id, byte[] subject, java.lang.String label, byte[] parms, java.math.BigInteger value) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String getAlgorithm() 
      java.lang.Boolean getAlwaysSensitive()
      Returns always sensitive
      java.lang.Integer getAuthPinFlags()
      Returns the auth pin flags
      java.lang.Boolean getDecrypt()
      Returns decrypt
      java.lang.Boolean getDerive()
      Returns true if key supports key derivation
      byte[] getEncoded() 
      java.util.Date getEndDate()
      Returns the end date
      java.lang.Boolean getExtractable()
      Returns if this key can be wrapped by another key
      java.lang.String getFormat() 
      byte[] getID()
      Return the ID
      java.lang.Integer getKeyType()
      Return the key type
      java.lang.String getLabel()
      Returns 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 modifiable
      java.lang.Boolean getNeverExtractable()
      Returns never extractable
      com.ibm.pkcs11.PKCS11Object getObject()
      Returns the key object
      java.security.spec.ECParameterSpec getParams() 
      java.lang.Boolean getPrivate()
      Returns private
      java.math.BigInteger getS() 
      java.lang.Boolean getSecondaryAuth()
      Returns secondary auth
      java.lang.Boolean getSensitive()
      Returns sensitive
      SessionManager getSessionManager()
      Returns the session manager associated with the key
      java.lang.Boolean getSign()
      Returns sign
      java.lang.Boolean getSignRecover()
      Returns sign recover
      java.util.Date getStartDate()
      Returns the start date
      byte[] getSubject()
      Returns the subject.
      java.lang.Boolean getToken()
      Returns token
      java.lang.Boolean getUnwrap()
      Returns unwrap
      void rm()
      Delete the hardware key object and release the session associated with this PKCS11 key
      void setKeyAsToken(boolean token)
      Sets the token attribute within a Java software key
      • Methods inherited from class com.ibm.security.pkcs8.PrivateKeyInfo

        addAttribute, addAttributes, clone, encode, equals, getAlgorithmId, getAttribute, getAttributes, getKeyBytes, hasAttribute, hasAttributes, hashCode, parseKey, parseKey, toString
      • Methods inherited from class com.ibm.security.pkcsutil.PKCSDerObject

        encode, getObjectIdentifier, write
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface javax.security.auth.Destroyable

        destroy, isDestroyed
    • Constructor Detail

      • PKCS11ECPrivateKey

        public PKCS11ECPrivateKey(Session session,
                                  com.ibm.pkcs11.PKCS11Object object,
                                  byte[] id,
                                  byte[] subject,
                                  java.lang.String label,
                                  byte[] parms)
                           throws java.security.InvalidKeyException
        Throws:
        java.security.InvalidKeyException
      • PKCS11ECPrivateKey

        public PKCS11ECPrivateKey(Session session,
                                  com.ibm.pkcs11.PKCS11Object object,
                                  byte[] id,
                                  byte[] subject,
                                  java.lang.String label,
                                  byte[] parms,
                                  java.math.BigInteger value)
                           throws java.security.InvalidKeyException
        Throws:
        java.security.InvalidKeyException
    • Method Detail

      • getLocal

        public java.lang.Boolean getLocal()
        Description copied from interface: PKCS11Key
        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
        Specified by:
        getLocal in interface com.ibm.pkcs11.P11Key
        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
      • getSensitive

        public java.lang.Boolean getSensitive()
        Returns sensitive
        Specified by:
        getSensitive in interface PKCS11PrivateKey
        Returns:
        true if sensitive; false otherwise
      • getSubject

        public byte[] getSubject()
        Returns the subject.
        Specified by:
        getSubject in interface PKCS11PrivateKey
        Returns:
        the subject
      • getAlwaysSensitive

        public java.lang.Boolean getAlwaysSensitive()
        Returns always sensitive
        Specified by:
        getAlwaysSensitive in interface PKCS11PrivateKey
        Returns:
        true if key has always had the CKA_SENSITIVE attribute set to TRUE; false otherwise
      • getSign

        public java.lang.Boolean getSign()
        Returns sign
        Specified by:
        getSign in interface PKCS11PrivateKey
        Returns:
        true if key supports signatures; false otherwise
      • getSecondaryAuth

        public java.lang.Boolean getSecondaryAuth()
        Returns secondary auth
        Specified by:
        getSecondaryAuth in interface PKCS11PrivateKey
        Returns:
        true if the key requires a secondary authentication to take place before its use it allowed.
      • getAuthPinFlags

        public java.lang.Integer getAuthPinFlags()
        Returns the auth pin flags
        Specified by:
        getAuthPinFlags in interface PKCS11PrivateKey
        Returns:
        mask indicating the current state of the secondary authentication PIN.
      • getDecrypt

        public java.lang.Boolean getDecrypt()
        Returns decrypt
        Specified by:
        getDecrypt in interface PKCS11PrivateKey
        Returns:
        true if key supports decryption
      • getSignRecover

        public java.lang.Boolean getSignRecover()
        Returns sign recover
        Specified by:
        getSignRecover in interface PKCS11PrivateKey
        Returns:
        true if key supports signatures where the data can be recovered from the signature; false otherwise
      • getUnwrap

        public java.lang.Boolean getUnwrap()
        Returns unwrap
        Specified by:
        getUnwrap in interface PKCS11PrivateKey
        Returns:
        true if key supports unwrapping; false otherwise
      • getExtractable

        public java.lang.Boolean getExtractable()
        Returns if this key can be wrapped by another key
        Specified by:
        getExtractable in interface PKCS11PrivateKey
        Returns:
        true if key is can be wrapped by another key; false otherwise
      • getNeverExtractable

        public java.lang.Boolean getNeverExtractable()
        Returns never extractable
        Specified by:
        getNeverExtractable in interface PKCS11PrivateKey
        Returns:
        true if key has never had the CKA_EXTRACTABLE attribute set to TRUE; false otherwise
      • getAlgorithm

        public java.lang.String getAlgorithm()
        Specified by:
        getAlgorithm in interface java.security.Key
        Overrides:
        getAlgorithm in class com.ibm.security.pkcs8.PrivateKeyInfo
      • getFormat

        public java.lang.String getFormat()
        Specified by:
        getFormat in interface java.security.Key
        Overrides:
        getFormat in class com.ibm.security.pkcs8.PrivateKeyInfo
      • getEncoded

        public byte[] getEncoded()
        Specified by:
        getEncoded in interface java.security.Key
        Overrides:
        getEncoded in class com.ibm.security.pkcs8.PrivateKeyInfo
      • getS

        public java.math.BigInteger getS()
        Specified by:
        getS in interface java.security.interfaces.ECPrivateKey
      • getParams

        public java.security.spec.ECParameterSpec getParams()
        Specified by:
        getParams in interface java.security.interfaces.ECKey
      • getObject

        public com.ibm.pkcs11.PKCS11Object getObject()
        Description copied from interface: PKCS11Key
        Returns the key object
        Specified by:
        getObject in interface PKCS11Key
        Specified by:
        getObject in interface com.ibm.pkcs11.P11Key
        Returns:
        the key object
      • getID

        public byte[] getID()
        Return the ID
        Specified by:
        getID in interface PKCS11Key
        Specified by:
        getID in interface com.ibm.pkcs11.P11Key
        Returns:
        the ID
      • getDerive

        public java.lang.Boolean getDerive()
        Returns true if key supports key derivation
        Specified by:
        getDerive in interface PKCS11Key
        Specified by:
        getDerive in interface com.ibm.pkcs11.P11Key
        Returns:
        true if key supports key derivation; false otherwise
      • getModifiable

        public java.lang.Boolean getModifiable()
        Description copied from interface: PKCS11Key
        Returns modifiable
        Specified by:
        getModifiable in interface PKCS11Key
        Specified by:
        getModifiable in interface com.ibm.pkcs11.P11Key
        Returns:
        true if object can be modified; false otherwise
      • getLabel

        public java.lang.String getLabel()
        Description copied from interface: PKCS11Key
        Returns label
        Specified by:
        getLabel in interface PKCS11Key
        Specified by:
        getLabel in interface com.ibm.pkcs11.P11Key
        Returns:
        the description of the object
      • getSessionManager

        public SessionManager getSessionManager()
        Description copied from interface: PKCS11Key
        Returns the session manager associated with the key
        Specified by:
        getSessionManager in interface PKCS11Key
        Returns:
        the session manager associated with the key
      • getToken

        public java.lang.Boolean getToken()
        Description copied from interface: PKCS11Key
        Returns token
        Specified by:
        getToken in interface PKCS11Key
        Specified by:
        getToken in interface com.ibm.pkcs11.P11Key
        Returns:
        true if object is a token object; false if object is a session object
      • getStartDate

        public java.util.Date getStartDate()
        Returns the start date
        Specified by:
        getStartDate in interface PKCS11Key
        Specified by:
        getStartDate in interface com.ibm.pkcs11.P11Key
        Returns:
        the start date
      • getEndDate

        public java.util.Date getEndDate()
        Returns the end date
        Specified by:
        getEndDate in interface PKCS11Key
        Specified by:
        getEndDate in interface com.ibm.pkcs11.P11Key
        Returns:
        the end date
      • getKeyType

        public java.lang.Integer getKeyType()
        Return the key type
        Specified by:
        getKeyType in interface PKCS11Key
        Specified by:
        getKeyType in interface com.ibm.pkcs11.P11Key
        Returns:
        the key type
      • getPrivate

        public java.lang.Boolean getPrivate()
        Description copied from interface: PKCS11Key
        Returns private
        Specified by:
        getPrivate in interface PKCS11Key
        Specified by:
        getPrivate in interface com.ibm.pkcs11.P11Key
        Returns:
        true if object is a private object; false if object is a public object.
      • rm

        public void rm()
        Delete the hardware key object and release the session associated with this PKCS11 key
        Specified by:
        rm in interface PKCS11Key
        Specified by:
        rm in interface com.ibm.pkcs11.P11Key

© Portions Copyright 2003, 2017 IBM Corporation. All rights reserved.
© Portions Copyright 2003, 2017, Oracle and/or its affiliates. All rights reserved.