com.ibm.crypto.pkcs11impl.provider
Class RSAPublicKey
- java.lang.Object
-
- com.ibm.security.x509.X509Key
-
- com.ibm.crypto.pkcs11impl.provider.RSAPublicKey
-
- All Implemented Interfaces:
- PKCS11Key, PKCS11PublicKey, PKCS11RSAPublicKey, com.ibm.pkcs11.P11Key, 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
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.StringgetAlgorithm()Get the Algorithm typejava.lang.BooleangetDerive()Returns true if key supports key derivationjava.lang.BooleangetEncrypt()Return if this key can do encryptionjava.util.DategetEndDate()Returns the end datejava.lang.StringgetFormat()Get format of the keybyte[]getID()Return the IDjava.lang.IntegergetKeyType()Return the key typejava.lang.StringgetLabel()Return the label.java.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 if the attribuites of the key are modifiablejava.math.BigIntegergetModulus()Return the modulus of the key.java.lang.IntegergetModulusBits()Return the modulus bits.com.ibm.pkcs11.PKCS11ObjectgetObject()Return the PKCS11Objectjava.lang.BooleangetPrivate()Returns if the key is private object.java.math.BigIntegergetPublicExponent()Returns the public exponent.SessiongetSession()Return the session associated with the key.SessionManagergetSessionManager()Returns the session manager associated with the keyjava.util.DategetStartDate()Returns the start datebyte[]getSubject()Return the subject in DER encoding byte arrayjava.lang.BooleangetToken()Returns if the key is a token object.java.lang.BooleangetVerify()Return if this key can verify a signature.java.lang.BooleangetVerifyRecover()Returns if this key supports verify recoverjava.lang.BooleangetWrap()Returns if this key can wrap another keyvoidrm()Delete the hardware key object and release the session associated with this PKCS11 keyjava.lang.StringtoString()Returns a human readable version of the RSA Public key.
-
-
-
Method Detail
-
getObject
public com.ibm.pkcs11.PKCS11Object getObject()
Return the PKCS11Object
-
getToken
public java.lang.Boolean getToken()
Returns if the key is a token object.
-
rm
public void rm()
Delete the hardware key object and release the session associated with this PKCS11 key
-
getPrivate
public java.lang.Boolean getPrivate()
Returns if the key is private object.- Specified by:
getPrivatein interfacePKCS11Key- Specified by:
getPrivatein interfacecom.ibm.pkcs11.P11Key- Returns:
- true if object is a private object; null if not assigned..
-
getLabel
public java.lang.String getLabel()
Return the label.
-
getModifiable
public java.lang.Boolean getModifiable()
Returns if the attribuites of the key are modifiable- Specified by:
getModifiablein interfacePKCS11Key- Specified by:
getModifiablein interfacecom.ibm.pkcs11.P11Key- Returns:
- true if object can be modified; null if not assigned.
-
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
-
getID
public byte[] getID()
Return the ID
-
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
-
getDerive
public java.lang.Boolean getDerive()
Returns true if key supports key derivation
-
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
-
getSubject
public byte[] getSubject()
Return the subject in DER encoding byte array- Specified by:
getSubjectin interfacePKCS11PublicKey- Returns:
- the subject
-
getEncrypt
public java.lang.Boolean getEncrypt()
Return if this key can do encryption- Specified by:
getEncryptin interfacePKCS11PublicKey- 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:
getVerifyin interfacePKCS11PublicKey- 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:
getVerifyRecoverin interfacePKCS11PublicKey- 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:
getWrapin interfacePKCS11PublicKey- Returns:
- true if key supports wrapping; null if not assigned.
-
getModulus
public java.math.BigInteger getModulus()
Return the modulus of the key.- Specified by:
getModulusin interfacePKCS11RSAPublicKey- Specified by:
getModulusin interfacejava.security.interfaces.RSAKey- Returns:
- the modulus
-
getModulusBits
public java.lang.Integer getModulusBits()
Return the modulus bits.- Specified by:
getModulusBitsin interfacePKCS11RSAPublicKey- Returns:
- the modulus bits of the key
-
getPublicExponent
public java.math.BigInteger getPublicExponent()
Returns the public exponent.- Specified by:
getPublicExponentin interfacePKCS11RSAPublicKey- Specified by:
getPublicExponentin interfacejava.security.interfaces.RSAPublicKey- Returns:
- the public exponent.
-
getSession
public Session getSession()
Return the session associated with the key.
-
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
-
toString
public java.lang.String toString()
Returns a human readable version of the RSA Public key.- Overrides:
toStringin classcom.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:
getFormatin interfacejava.security.Key- Overrides:
getFormatin classcom.ibm.security.x509.X509Key- Returns:
- Always returns PKCS#11
-
getAlgorithm
public java.lang.String getAlgorithm()
Get the Algorithm type- Specified by:
getAlgorithmin interfacejava.security.Key- Overrides:
getAlgorithmin classcom.ibm.security.x509.X509Key- Returns:
- Always returns RSA
-
-