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
-
-
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.StringgetAlgorithm()java.lang.BooleangetAlwaysSensitive()Returns always sensitivejava.lang.IntegergetAuthPinFlags()Returns the auth pin flagsjava.lang.BooleangetDecrypt()Returns decryptjava.lang.BooleangetDerive()Returns true if key supports key derivationbyte[]getEncoded()java.util.DategetEndDate()Returns the end datejava.lang.BooleangetExtractable()Returns if this key can be wrapped by another keyjava.lang.StringgetFormat()byte[]getID()Return the IDjava.lang.IntegergetKeyType()Return the key typejava.lang.StringgetLabel()Returns labeljava.lang.BooleangetLocal()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 TRUEjava.lang.BooleangetModifiable()Returns modifiablejava.lang.BooleangetNeverExtractable()Returns never extractablecom.ibm.pkcs11.PKCS11ObjectgetObject()Returns the key objectjava.security.spec.ECParameterSpecgetParams()java.lang.BooleangetPrivate()Returns privatejava.math.BigIntegergetS()java.lang.BooleangetSecondaryAuth()Returns secondary authjava.lang.BooleangetSensitive()Returns sensitiveSessionManagergetSessionManager()Returns the session manager associated with the keyjava.lang.BooleangetSign()Returns signjava.lang.BooleangetSignRecover()Returns sign recoverjava.util.DategetStartDate()Returns the start datebyte[]getSubject()Returns the subject.java.lang.BooleangetToken()Returns tokenjava.lang.BooleangetUnwrap()Returns unwrapvoidrm()Delete the hardware key object and release the session associated with this PKCS11 keyvoidsetKeyAsToken(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
-
-
-
-
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:PKCS11KeyReturns 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
-
getSensitive
public java.lang.Boolean getSensitive()
Returns sensitive- Specified by:
getSensitivein interfacePKCS11PrivateKey- Returns:
- true if sensitive; false otherwise
-
getSubject
public byte[] getSubject()
Returns the subject.- Specified by:
getSubjectin interfacePKCS11PrivateKey- Returns:
- the subject
-
getAlwaysSensitive
public java.lang.Boolean getAlwaysSensitive()
Returns always sensitive- Specified by:
getAlwaysSensitivein interfacePKCS11PrivateKey- 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:
getSignin interfacePKCS11PrivateKey- Returns:
- true if key supports signatures; false otherwise
-
getSecondaryAuth
public java.lang.Boolean getSecondaryAuth()
Returns secondary auth- Specified by:
getSecondaryAuthin interfacePKCS11PrivateKey- 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:
getAuthPinFlagsin interfacePKCS11PrivateKey- Returns:
- mask indicating the current state of the secondary authentication PIN.
-
getDecrypt
public java.lang.Boolean getDecrypt()
Returns decrypt- Specified by:
getDecryptin interfacePKCS11PrivateKey- Returns:
- true if key supports decryption
-
getSignRecover
public java.lang.Boolean getSignRecover()
Returns sign recover- Specified by:
getSignRecoverin interfacePKCS11PrivateKey- 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:
getUnwrapin interfacePKCS11PrivateKey- 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:
getExtractablein interfacePKCS11PrivateKey- Returns:
- true if key is can be wrapped by another key; false otherwise
-
getNeverExtractable
public java.lang.Boolean getNeverExtractable()
Returns never extractable- Specified by:
getNeverExtractablein interfacePKCS11PrivateKey- Returns:
- true if key has never had the CKA_EXTRACTABLE attribute set to TRUE; false otherwise
-
getAlgorithm
public java.lang.String getAlgorithm()
- Specified by:
getAlgorithmin interfacejava.security.Key- Overrides:
getAlgorithmin classcom.ibm.security.pkcs8.PrivateKeyInfo
-
getFormat
public java.lang.String getFormat()
- Specified by:
getFormatin interfacejava.security.Key- Overrides:
getFormatin classcom.ibm.security.pkcs8.PrivateKeyInfo
-
getEncoded
public byte[] getEncoded()
- Specified by:
getEncodedin interfacejava.security.Key- Overrides:
getEncodedin classcom.ibm.security.pkcs8.PrivateKeyInfo
-
getS
public java.math.BigInteger getS()
- Specified by:
getSin interfacejava.security.interfaces.ECPrivateKey
-
getParams
public java.security.spec.ECParameterSpec getParams()
- Specified by:
getParamsin interfacejava.security.interfaces.ECKey
-
getObject
public com.ibm.pkcs11.PKCS11Object getObject()
Description copied from interface:PKCS11KeyReturns the key object
-
getID
public byte[] getID()
Return the ID
-
getDerive
public java.lang.Boolean getDerive()
Returns true if key supports key derivation
-
getModifiable
public java.lang.Boolean getModifiable()
Description copied from interface:PKCS11KeyReturns modifiable- Specified by:
getModifiablein interfacePKCS11Key- Specified by:
getModifiablein interfacecom.ibm.pkcs11.P11Key- Returns:
- true if object can be modified; false otherwise
-
getLabel
public java.lang.String getLabel()
Description copied from interface:PKCS11KeyReturns label
-
getSessionManager
public SessionManager getSessionManager()
Description copied from interface:PKCS11KeyReturns the session manager associated with the key- Specified by:
getSessionManagerin interfacePKCS11Key- Returns:
- the session manager associated with the key
-
getToken
public java.lang.Boolean getToken()
Description copied from interface:PKCS11KeyReturns token
-
getStartDate
public java.util.Date getStartDate()
Returns the start date- Specified by:
getStartDatein interfacePKCS11Key- Specified by:
getStartDatein interfacecom.ibm.pkcs11.P11Key- Returns:
- the start date
-
getEndDate
public java.util.Date getEndDate()
Returns the end date- Specified by:
getEndDatein interfacePKCS11Key- Specified by:
getEndDatein interfacecom.ibm.pkcs11.P11Key- Returns:
- the end date
-
getKeyType
public java.lang.Integer getKeyType()
Return the key type- Specified by:
getKeyTypein interfacePKCS11Key- Specified by:
getKeyTypein interfacecom.ibm.pkcs11.P11Key- Returns:
- the key type
-
getPrivate
public java.lang.Boolean getPrivate()
Description copied from interface:PKCS11KeyReturns private- Specified by:
getPrivatein interfacePKCS11Key- Specified by:
getPrivatein interfacecom.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
-
setKeyAsToken
public void setKeyAsToken(boolean token)
Description copied from interface:PKCS11PrivateKeySets the token attribute within a Java software key- Specified by:
setKeyAsTokenin interfacePKCS11PrivateKey
-
-