| java.lang.Object java.security.KeyStoreSpi sun.security.mscapi.KeyStore
KeyStore | abstract class KeyStore extends KeyStoreSpi (Code) | | Implementation of key store for Windows using the Microsoft Crypto API.
since: 1.6 |
Inner Class :final public static class MY extends KeyStore | |
Inner Class :final public static class ROOT extends KeyStore | |
Inner Class :class KeyEntry | |
Method Summary | |
public Enumeration | engineAliases() Lists all the alias names of this keystore. | public boolean | engineContainsAlias(String alias) Checks if the given alias exists in this keystore. | public void | engineDeleteEntry(String alias) Deletes the entry identified by the given alias from this keystore. | public Certificate | engineGetCertificate(String alias) Returns the certificate associated with the given alias.
If the given alias name identifies a
trusted certificate entry, the certificate associated with that
entry is returned. | public 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. | public Certificate[] | engineGetCertificateChain(String alias) Returns the certificate chain associated with the given alias. | public Date | engineGetCreationDate(String alias) Returns the creation date of the entry identified by the given alias. | public java.security.Key | engineGetKey(String alias, char[] password) Returns the key associated with the given alias.
A compatibility mode is supported for applications that assume
a password must be supplied. | public boolean | engineIsCertificateEntry(String alias) Returns true if the entry identified by the given alias is a
trusted certificate entry, and false otherwise. | public boolean | engineIsKeyEntry(String alias) Returns true if the entry identified by the given alias is a
key entry, and false otherwise. | public void | engineLoad(InputStream stream, char[] password) Loads the keystore.
A compatibility mode is supported for applications that assume
keystores are stream-based. | public void | engineSetCertificateEntry(String alias, Certificate cert) Assigns the given certificate to the given alias. | public void | engineSetKeyEntry(String alias, java.security.Key key, char[] password, Certificate[] chain) Stores the given private key and associated certificate chain in the
keystore. | public void | engineSetKeyEntry(String alias, byte[] key, Certificate[] chain) Assigns the given key (that has already been protected) to the given
alias.
If the protected key is of type
java.security.PrivateKey , it must be accompanied by a
certificate chain certifying the corresponding public key. | public int | engineSize() Retrieves the number of entries in this keystore. | public void | engineStore(OutputStream stream, char[] password) engineStore is currently a no-op.
Entries are stored during engineSetEntry.
A compatibility mode is supported for applications that assume
keystores are stream-based. |
engineAliases | public Enumeration engineAliases()(Code) | | Lists all the alias names of this keystore.
enumeration of the alias names |
engineContainsAlias | public boolean engineContainsAlias(String alias)(Code) | | Checks if the given alias exists in this keystore.
Parameters: alias - the alias name true if the alias exists, false otherwise |
engineDeleteEntry | public void engineDeleteEntry(String alias) throws KeyStoreException(Code) | | Deletes the entry identified by the given alias from this keystore.
Parameters: alias - the alias name exception: KeyStoreException - if the entry cannot be removed. |
engineGetCertificate | public Certificate engineGetCertificate(String alias)(Code) | | Returns the certificate associated with the given alias.
If the given alias name identifies a
trusted certificate entry, the certificate associated with that
entry is returned. If the given alias name identifies a
key entry, the first element of the certificate chain of that
entry is returned, or null if that entry does not have a certificate
chain.
Parameters: alias - the alias name the certificate, or null if the given alias does not exist ordoes not contain a certificate. |
engineGetCertificateAlias | public String engineGetCertificateAlias(Certificate cert)(Code) | | 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
is a trusted certificate entry, the given certificate is
compared to that entry's certificate. If the entry being considered is
a key entry, the given certificate is compared to the first
element of that entry's certificate chain (if a chain exists).
Parameters: cert - the certificate to match with. the (alias) name of the first entry with matching certificate,or null if no such entry exists in this keystore. |
engineGetCertificateChain | public Certificate[] engineGetCertificateChain(String alias)(Code) | | Returns the certificate chain associated with the given alias.
Parameters: alias - the alias name the certificate chain (ordered with the user's certificate firstand the root certificate authority last), or null if the given aliasdoes not exist or does not contain a certificate chain (i.e., the given alias identifies either a trusted certificate entry or akey entry without a certificate chain). |
engineGetCreationDate | public Date engineGetCreationDate(String alias)(Code) | | Returns the creation date of the entry identified by the given alias.
Parameters: alias - the alias name the creation date of this entry, or null if the given alias doesnot exist |
engineGetKey | public java.security.Key engineGetKey(String alias, char[] password) throws NoSuchAlgorithmException, UnrecoverableKeyException(Code) | | Returns the key associated with the given alias.
A compatibility mode is supported for applications that assume
a password must be supplied. It permits (but ignores) a non-null
password . The mode is enabled by default.
Set the
sun.security.mscapi.keyStoreCompatibilityMode
system property to false to disable compatibility mode
and reject a non-null password .
Parameters: alias - the alias name Parameters: password - the password, which should be null the requested key, or null if the given alias does not existor does not identify a key entry. exception: NoSuchAlgorithmException - if the algorithm for recovering thekey cannot be found, or if compatibility mode is disabled and password is non-null. exception: UnrecoverableKeyException - if the key cannot be recovered. |
engineIsCertificateEntry | public boolean engineIsCertificateEntry(String alias)(Code) | | Returns true if the entry identified by the given alias is a
trusted certificate entry, and false otherwise.
true if the entry identified by the given alias is atrusted certificate entry, false otherwise. |
engineIsKeyEntry | public boolean engineIsKeyEntry(String alias)(Code) | | Returns true if the entry identified by the given alias is a
key entry, and false otherwise.
true if the entry identified by the given alias is akey entry, false otherwise. |
engineLoad | public void engineLoad(InputStream stream, char[] password) throws IOException, NoSuchAlgorithmException, CertificateException(Code) | | Loads the keystore.
A compatibility mode is supported for applications that assume
keystores are stream-based. It permits (but ignores) a non-null
stream or password .
The mode is enabled by default.
Set the
sun.security.mscapi.keyStoreCompatibilityMode
system property to false to disable compatibility mode
and reject a non-null stream or password .
Parameters: stream - the input stream, which should be null . Parameters: password - the password, which should be null . exception: IOException - if there is an I/O or format problem with thekeystore data. Or if compatibility mode is disabled and eitherparameter is non-null. exception: NoSuchAlgorithmException - if the algorithm used to checkthe integrity of the keystore cannot be found exception: CertificateException - if any of the certificates in thekeystore could not be loaded exception: SecurityException - if the security check forSecurityPermission("authProvider.name") does not pass, where name is the value returned bythis provider's getName method. |
engineSetCertificateEntry | public void engineSetCertificateEntry(String alias, Certificate cert) throws KeyStoreException(Code) | | Assigns the given certificate to the given alias.
If the given alias already exists in this keystore and identifies a
trusted certificate entry, the certificate associated with it is
overridden by the given certificate.
Parameters: alias - the alias name Parameters: cert - the certificate exception: KeyStoreException - if the given alias already exists and doesnot identify a trusted certificate entry, or this operationfails for some other reason. |
engineSetKeyEntry | public void engineSetKeyEntry(String alias, java.security.Key key, char[] password, Certificate[] chain) throws KeyStoreException(Code) | | Stores the given private key and associated certificate chain in the
keystore.
The given java.security.PrivateKey key must
be accompanied by a certificate chain certifying the
corresponding public key.
If the given alias already exists, the keystore information
associated with it is overridden by the given key and certificate
chain. Otherwise, a new entry is created.
A compatibility mode is supported for applications that assume
a password must be supplied. It permits (but ignores) a non-null
password . The mode is enabled by default.
Set the
sun.security.mscapi.keyStoreCompatibilityMode
system property to false to disable compatibility mode
and reject a non-null password .
Parameters: alias - the alias name Parameters: key - the private key to be associated with the alias Parameters: password - the password, which should be null Parameters: chain - the certificate chain for the corresponding publickey (only required if the given key is of typejava.security.PrivateKey ). exception: KeyStoreException - if the given key is not a private key, cannot be protected, or if compatibility mode is disabled and password is non-null, or if this operation fails for some other reason. |
engineSetKeyEntry | public void engineSetKeyEntry(String alias, byte[] key, Certificate[] chain) throws KeyStoreException(Code) | | Assigns the given key (that has already been protected) to the given
alias.
If the protected key is of type
java.security.PrivateKey , it must be accompanied by a
certificate chain certifying the corresponding public key. If the
underlying keystore implementation is of type jks ,
key must be encoded as an
EncryptedPrivateKeyInfo as defined in the PKCS #8 standard.
If the given alias already exists, the keystore information
associated with it is overridden by the given key (and possibly
certificate chain).
Parameters: alias - the alias name Parameters: key - the key (in protected format) to be associated with the alias Parameters: chain - the certificate chain for the corresponding publickey (only useful if the protected key is of typejava.security.PrivateKey ). exception: KeyStoreException - if this operation fails. |
engineSize | public int engineSize()(Code) | | Retrieves the number of entries in this keystore.
the number of entries in this keystore |
engineStore | public void engineStore(OutputStream stream, char[] password) throws IOException, NoSuchAlgorithmException, CertificateException(Code) | | engineStore is currently a no-op.
Entries are stored during engineSetEntry.
A compatibility mode is supported for applications that assume
keystores are stream-based. It permits (but ignores) a non-null
stream or password .
The mode is enabled by default.
Set the
sun.security.mscapi.keyStoreCompatibilityMode
system property to false to disable compatibility mode
and reject a non-null stream or password .
Parameters: stream - the output stream, which should be null Parameters: password - the password, which should be null exception: IOException - if compatibility mode is disabled and eitherparameter is non-null. |
Methods inherited from java.security.KeyStoreSpi | abstract public Enumeration<String> engineAliases()(Code)(Java Doc) abstract public boolean engineContainsAlias(String alias)(Code)(Java Doc) abstract public void engineDeleteEntry(String alias) throws KeyStoreException(Code)(Java Doc) public boolean engineEntryInstanceOf(String alias, Class<? extends KeyStore.Entry> entryClass)(Code)(Java Doc) abstract public Certificate engineGetCertificate(String alias)(Code)(Java Doc) abstract public String engineGetCertificateAlias(Certificate cert)(Code)(Java Doc) abstract public Certificate[] engineGetCertificateChain(String alias)(Code)(Java Doc) abstract public Date engineGetCreationDate(String alias)(Code)(Java Doc) public KeyStore.Entry engineGetEntry(String alias, KeyStore.ProtectionParameter protParam) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableEntryException(Code)(Java Doc) abstract public Key engineGetKey(String alias, char[] password) throws NoSuchAlgorithmException, UnrecoverableKeyException(Code)(Java Doc) abstract public boolean engineIsCertificateEntry(String alias)(Code)(Java Doc) abstract public boolean engineIsKeyEntry(String alias)(Code)(Java Doc) abstract public void engineLoad(InputStream stream, char[] password) throws IOException, NoSuchAlgorithmException, CertificateException(Code)(Java Doc) public void engineLoad(KeyStore.LoadStoreParameter param) throws IOException, NoSuchAlgorithmException, CertificateException(Code)(Java Doc) abstract public void engineSetCertificateEntry(String alias, Certificate cert) throws KeyStoreException(Code)(Java Doc) public void engineSetEntry(String alias, KeyStore.Entry entry, KeyStore.ProtectionParameter protParam) throws KeyStoreException(Code)(Java Doc) abstract public void engineSetKeyEntry(String alias, Key key, char[] password, Certificate[] chain) throws KeyStoreException(Code)(Java Doc) abstract public void engineSetKeyEntry(String alias, byte[] key, Certificate[] chain) throws KeyStoreException(Code)(Java Doc) abstract public int engineSize()(Code)(Java Doc) abstract public void engineStore(OutputStream stream, char[] password) throws IOException, NoSuchAlgorithmException, CertificateException(Code)(Java Doc) public void engineStore(KeyStore.LoadStoreParameter param) throws IOException, NoSuchAlgorithmException, CertificateException(Code)(Java Doc)
|
|
|