public abstract class CapiPrivateKey
extends java.lang.Object
implements com.entrust.toolkit.security.provider.EntrustPrivateKey
CapiPrivateKey class represents a private key that is
stored in Microsoft's CAPI.
Private key operations, such as signing and decryption, are performed in CAPI. Private keys cannot be extracted from CAPI, there is no way to get the private key information in to Java.
Despite implementing the java.security.Key interface, instances
of this class cannot be serialized. Attempting to do so will result in a
SecurityException being thrown.
| Modifier and Type | Method and Description |
|---|---|
void |
delete() |
void |
destroyCriticalData()
Destroys the critical data of this key.
|
CryptKey |
getCryptKey()
Returns the
CryptKey object associated with this key. |
CryptProvider |
getCryptProvider()
Returns the
CryptProvider object associated with this key. |
byte[] |
getEncoded()
Part of the
Key interface, always returns null
as keys cannot be extracted from CAPI. |
java.lang.String |
getFormat()
Part of the
Key interface, always returns null
as keys cannot be extracted from CAPI. |
static CapiPrivateKey |
getInstance(CryptKey cryptKey)
Creates and returns a
CapiPrivateKey using with an already initialized
CAPI provider and key. |
java.lang.String |
getType()
Returns the key type.
|
public static CapiPrivateKey getInstance(CryptKey cryptKey) throws CapiException
CapiPrivateKey using with an already initialized
CAPI provider and key.cryptKey - the handle to the key within that providerCapiPrivateKey of the correct type.CapiException - if there is no private key type associated with cryptKey.public java.lang.String getFormat()
Key interface, always returns null
as keys cannot be extracted from CAPI.getFormat in interface java.security.Keynullpublic byte[] getEncoded()
Key interface, always returns null
as keys cannot be extracted from CAPI.getEncoded in interface java.security.Keynullpublic final void destroyCriticalData()
public final void delete()
throws java.security.KeyException
delete in interface com.entrust.toolkit.security.provider.EntrustPrivateKeyjava.security.KeyExceptionpublic final java.lang.String getType()
public CryptKey getCryptKey()
CryptKey object associated with this key. This
object is required to use CAPI functions that require a key.CryptKey object associated with this key.public CryptProvider getCryptProvider()
CryptProvider object associated with this key.
This object is required for CAPI functions that require a provider.CryptProvider object associated with this key.