KeyStore
class.
All the abstract methods in this class must be implemented by each
cryptographic service provider who wishes to supply the implementation
of a keystore for a particular keystore type.
KeyStore
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
public abstract Enumeration | |
public abstract boolean | Returns: true if the alias exists, false otherwisethe alias name alias)Checks if the given alias exists in this keystore. |
public abstract void | engineDeleteEntry(String
the alias name alias)Deletes the entry identified by the given alias from this keystore. |
public boolean | Returns: true if the keystore Entry for the specified
alias is an instance or subclass of the
specified entryClass , false otherwisethe alias name alias, Class<? extends KeyStore.the entry class entryClass)Determines if the keystore |
public Set | Returns: an unmodifiableSet of attributes. This set is
empty if the given alias does not exist or there are no
attributes associated with the alias. This set may also be
empty for PrivateKeyEntry or SecretKeyEntry
entries that contain protected attributes. These protected
attributes should be populated into the result returned by
engineGetEntry and can be retrieved by calling
the Entry#getAttributes method.the alias name alias)Retrieves the attributes associated with the given alias. |
public abstract Certificate | Returns: the certificate, ornull if the given alias does not
exist or does not contain a certificate.the alias name alias)Returns the certificate associated with the given alias. |
public abstract String | Returns: the alias name of the first entry with matching certificate, ornull if no such entry exists in this keystore.the certificate to match with. cert)Returns the (alias) name of the first keystore entry whose certificate matches the given certificate. |
public abstract Certificate[] | Returns: the certificate chain (ordered with the user's certificate first and the root certificate authority last), ornull if the
given alias * does not exist or does not contain a certificate chainthe alias name alias)Returns the certificate chain associated with the given alias. |
public abstract Date | Returns: the creation date of this entry, ornull
if the given alias does not existthe alias name alias)Returns the creation date of the entry identified by the given alias. |
public KeyStore. | Returns: theKeyStore.Entry for the specified alias,
or null if there is no such entryget the alias, KeyStore.KeyStore.Entry for this aliasthe protParamProtectionParameter
used to protect the Entry ,
which may be null Gets a |
public abstract Key | Returns: the requested key, ornull if the given alias
does not exist or does not identify a key-related entry.the alias name alias, char[] the password for recovering the key password)Returns the key associated with the given alias, using the given password to recover it. |
public abstract boolean | Returns: true if the entry identified by the given alias
contains a trusted certificate, false otherwise.the alias for the keystore entry to be checked alias)Returns |
public abstract boolean | Returns: true if the entry identified by the given alias is a
key-related, false otherwise.the alias for the keystore entry to be checked alias)Returns |
public abstract void | engineLoad(InputStream
the input stream from which the keystore is loaded,
or stream, char[] null the password used to check the integrity of
the keystore, the password used to unlock the keystore,
or password)null Loads the keystore from the given input stream. |
public void | engineLoad(KeyStore.
the paramKeyStore.LoadStoreParameter
that specifies how to load the keystore,
which may be null Loads the keystore using the given
|
pack-priv void | |
public boolean | Returns: true if the keystore data is supported,
otherwise false the keystore data to be probed stream)Probes the specified input stream to determine whether it contains a keystore that is supported by this implementation, or not. |
public abstract void | engineSetCertificateEntry(String
the alias name alias, Certificate the certificate cert)Assigns the given certificate to the given alias. |
public void | engineSetEntry(String
save the alias, KeyStore.KeyStore.Entry under this aliasthe entry,Entry to savethe protParamProtectionParameter
used to protect the Entry ,
which may be null Saves a |
public abstract void | engineSetKeyEntry(String
the alias name alias, Key the key to be associated with the alias key, char[] the password to protect the key password, Certificate[] the certificate chain for the corresponding public
key (only required if the given key is of type
chain)java.security.PrivateKey ).Assigns the given key to the given alias, protecting it with the given password. |
public abstract void | engineSetKeyEntry(String
the alias name alias, byte[] the key (in protected format) to be associated with the alias key, Certificate[] the certificate chain for the corresponding public
key (only useful if the protected key is of type
chain)java.security.PrivateKey ).Assigns the given key (that has already been protected) to the given alias. |
public abstract int | Returns: the number of entries in this keystoreRetrieves the number of entries in this keystore. |
public abstract void | engineStore(OutputStream
the output stream to which this keystore is written. stream, char[] the password to generate the keystore integrity check.
May be password)null if the keystore does not support
or require an integrity check.Stores this keystore to the given output stream, and protects its integrity with the given password. |
public void | engineStore(KeyStore.
the paramKeyStore.LoadStoreParameter
that specifies how to store the keystore,
which may be null Stores this keystore using the given
|
KeyStoreSpi | back to summary |
---|---|
public KeyStoreSpi() Constructor for subclasses to call. |
engineAliases | back to summary |
---|---|
public abstract Enumeration Lists all the alias names of this keystore.
|
engineContainsAlias | back to summary |
---|---|
public abstract boolean engineContainsAlias(String alias) Checks if the given alias exists in this keystore.
|
engineDeleteEntry | back to summary |
---|---|
public abstract void engineDeleteEntry(String alias) throws KeyStoreException Deletes the entry identified by the given alias from this keystore.
|
engineEntryInstanceOf | back to summary |
---|---|
public boolean engineEntryInstanceOf(String alias, Class<? extends KeyStore. Determines if the keystore |
engineGetAttributes | back to summary |
---|---|
public Set Retrieves the attributes associated with the given alias. Implementation Specification The default implementation returns an empty
|
engineGetCertificate | back to summary |
---|---|
public abstract Certificate engineGetCertificate(String alias) Returns the certificate associated with the given alias. If the given alias name identifies an entry
created by a call to If the given alias name identifies an entry
created by a call to
|
engineGetCertificateAlias | back to summary |
---|---|
public abstract String engineGetCertificateAlias(Certificate cert) Returns the (alias) name of the first keystore entry whose certificate matches the given certificate. This method attempts to match the given certificate with each
keystore entry. If the entry being considered was
created by a call to If the entry being considered was
created by a call to
|
engineGetCertificateChain | back to summary |
---|---|
public abstract Certificate[] engineGetCertificateChain(String alias) Returns the certificate chain associated with the given alias.
The certificate chain must have been associated with the alias
by a call to
|
engineGetCreationDate | back to summary |
---|---|
public abstract Date engineGetCreationDate(String alias) Returns the creation date of the entry identified by the given alias. |
engineGetEntry | back to summary |
---|---|
public KeyStore. Gets a
|
engineGetKey | back to summary |
---|---|
public abstract Key engineGetKey(String alias, char[] password) throws NoSuchAlgorithmException, UnrecoverableKeyException Returns the key associated with the given alias, using the given
password to recover it. The key must have been associated with
the alias by a call to
|
engineIsCertificateEntry | back to summary |
---|---|
public abstract boolean engineIsCertificateEntry(String alias) Returns
|
engineIsKeyEntry | back to summary |
---|---|
public abstract boolean engineIsKeyEntry(String alias) Returns
|
engineLoad | back to summary |
---|---|
public abstract void engineLoad(InputStream stream, char[] password) throws IOException, NoSuchAlgorithmException, CertificateException Loads the keystore from the given input stream. A password may be given to unlock the keystore (e.g. the keystore resides on a hardware token device), or to check the integrity of the keystore data. If a password is not given for integrity checking, then integrity checking is not performed.
|
engineLoad | back to summary |
---|---|
public void engineLoad(KeyStore. Loads the keystore using the given
Note that if this KeyStore has already been loaded, it is reinitialized and loaded again from the given parameter. Implementation Specification The default implementation examines
If
|
engineLoad | back to summary |
---|---|
pack-priv void engineLoad(InputStream stream, KeyStore. |
engineProbe | back to summary |
---|---|
public boolean engineProbe(InputStream stream) throws IOException Probes the specified input stream to determine whether it contains a keystore that is supported by this implementation, or not. Implementation Specification This method returns
|
engineSetCertificateEntry | back to summary |
---|---|
public abstract void engineSetCertificateEntry(String alias, Certificate cert) throws KeyStoreException Assigns the given certificate to the given alias. If the given alias identifies an existing entry
created by a call to
|
engineSetEntry | back to summary |
---|---|
public void engineSetEntry(String alias, KeyStore. Saves a If an entry already exists for the specified alias, it is overridden.
|
engineSetKeyEntry | back to summary |
---|---|
public abstract void engineSetKeyEntry(String alias, Key key, char[] password, Certificate[] chain) throws KeyStoreException Assigns the given key to the given alias, protecting it with the given password. If the given key is of type If the given alias already exists, the keystore information associated with it is overridden by the given key (and possibly certificate chain).
|
engineSetKeyEntry | back to summary |
---|---|
public abstract void engineSetKeyEntry(String alias, byte[] key, Certificate[] chain) throws KeyStoreException Assigns the given key (that has already been protected) to the given alias. If the protected key is of type
If the given alias already exists, the keystore information associated with it is overridden by the given key (and possibly certificate chain).
|
engineSize | back to summary |
---|---|
public abstract int engineSize() Retrieves the number of entries in this keystore.
|
engineStore | back to summary |
---|---|
public abstract void engineStore(OutputStream stream, char[] password) throws IOException, NoSuchAlgorithmException, CertificateException Stores this keystore to the given output stream, and protects its integrity with the given password.
|
engineStore | back to summary |
---|---|
public void engineStore(KeyStore. Stores this keystore using the given
Implementation Specification The default implementation throws
an
|