public class KeychainKey extends KeychainHandle
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the handle to the native key object, releasing memory.
|
java.security.PublicKey |
exportPublicKey()
Exports the public key from the Keychain
FIPS 140-2:
FIPS Service: Key Input/Output (logical port)
This API is part of the logical interface to the Toolkit's FIPS 140-2
cryptographic module; use of this API causes the caller to assume the
FIPS 140-2 user role and accesses the following FIPS 140-2
logical interfaces:
control input interface (API call)
data output interface (return value)
status output interface (exceptions)
|
static java.security.KeyPair |
generateKeyPair(EntrustAsymKeyType keyType)
Generates a key pair in the Keychain
FIPS 140-2:
FIPS Service: Key Generation
This API is part of the logical interface to the Toolkit's FIPS 140-2
cryptographic module; use of this API causes the caller to assume the
FIPS 140-2 crypto officer role and accesses the following FIPS 140-2
logical interfaces:
control input interface (API call, parameters)
data input interface (parameters)
data output interface (return value)
status output interface (exceptions)
|
java.lang.String |
getAlgorithmName()
Returns the algorithm associated with this key, or
null if
the algorithm is not recognized. |
static KeychainKey |
getInstance(X509Certificate cert)
Creates and returns a
KeychainKey object associated with a
public/private key pair that already exists in the Keychain
FIPS 140-2:
FIPS Service: Query Object
This API is part of the logical interface to the Toolkit's FIPS 140-2
cryptographic module; use of this API causes the caller to assume the
FIPS 140-2 user role and accesses the following FIPS 140-2 logical
interfaces:
control input interface (API call, parameters)
status output interface (exceptions)
|
byte[] |
getKeyChainAttributeTypeAndValue(KeychainAttribute attribute)
Gets the value of a parameter associated with this key in the JniKeyChain.
|
java.security.spec.AlgorithmParameterSpec |
getParams() |
static KeychainKey |
importPrivateKeyAndCert(java.security.PrivateKey key,
java.lang.String keychainLabel,
X509Certificate cert,
java.lang.String certLabel,
boolean exportable,
java.lang.String keychainContainerName,
SecureStringBuffer password)
Import the private key and Certificate into the Keychain.
|
void |
setKeyAttribute(KeychainAttributeTypeAndValue keychainAttrTypeAndValue)
Sets the value of a parameter associated with this key in the KeyChain.
|
debugInfo, debugInfo, equals, setExtendedDebuggingclearHandle, finalize, getHandle, hashCodepublic static KeychainKey getInstance(X509Certificate cert) throws KeychainException
KeychainKey object associated with a
public/private key pair that already exists in the Keychain
cert - [FIPS 140-2 control input] the X509Certificate of the
associated private key that resides in the KeychainCryptKey
object.KeychainException - [FIPS 140-2 status output] if the key could not be created.Fips140ErrorStateException - [FIPS 140-2 status output] thrown if the Toolkit is not
allowed to perform cryptographic operationsCryptGetUserKeypublic static KeychainKey importPrivateKeyAndCert(java.security.PrivateKey key, java.lang.String keychainLabel, X509Certificate cert, java.lang.String certLabel, boolean exportable, java.lang.String keychainContainerName, SecureStringBuffer password) throws KeychainException
key - The PrivateKey to add into the KeychainkeychainLabel - The label to add the Keychain keycert - The certificatecertLabel - the label for the Certificate in the Keychainexportable - A boolean value to indicate if it is exportablekeychainContainerName - A containerName to use to for Keychain keypassword - A password used to store the keyKeychainExceptionpublic static java.security.KeyPair generateKeyPair(EntrustAsymKeyType keyType) throws KeychainException
keyType - [FIPS 140-2 data input] the key type; identifies the type of
key pair (e.g. RSA-1024) being generatedKeychainException - [FIPS 140-2 status output] if the key pair generation
operation failsFips140ErrorStateException - [FIPS 140-2 status output] thrown if the Toolkit is not
allowed to perform cryptographic operationspublic void close()
public java.lang.String getAlgorithmName()
throws KeychainException
null if
the algorithm is not recognized.
KeychainException - [FIPS 140-2 status output] if the call to
CryptGetKeyParam to obtain the key algorithm id
fails.Fips140ErrorStateException - [FIPS 140-2 status output] thrown if the Toolkit is not
allowed to perform cryptographic operationspublic java.security.spec.AlgorithmParameterSpec getParams()
throws KeychainException
KeychainExceptionpublic byte[] getKeyChainAttributeTypeAndValue(KeychainAttribute attribute) throws KeychainException
attribute - [FIPS 140-2 control input] The Keychain attribute to set with this key;KeychainException - [FIPS 140-2 status output] if the key parameter get operation
failsFips140ErrorStateException - [FIPS 140-2 status output] thrown if the Toolkit is not
allowed to perform cryptographic operationspublic java.security.PublicKey exportPublicKey()
throws KeychainException
KeychainException - [FIPS 140-2 status output] if the public key export operation
failsFips140ErrorStateException - [FIPS 140-2 status output] thrown if the Toolkit is not
allowed to perform cryptographic operationspublic void setKeyAttribute(KeychainAttributeTypeAndValue keychainAttrTypeAndValue) throws KeychainException
keychainAttrTypeAndValue - [FIPS 140-2 control input] A keychain attribute type and value
settings for this KeykeyParamValue - [FIPS 140-2 data input] the value of the key parameter being
setKeychainException - [FIPS 140-2 status output]if the key parameter set operation
failsFips140ErrorStateException - [FIPS 140-2 status output] thrown if the Toolkit is not
allowed to perform cryptographic operations