java.security
Class KeyStoreSpi
java.lang.Object
|
+--java.security.KeyStoreSpi
public abstract class
KeyStoreSpiextends
ObjectKeyStoreSpi is the Service Provider Interface (SPI) for the
KeyStore class. This is the interface for providers to
supply to implement a keystore for a particular keystore
type.
Since:Author:KeyStoreSpi
public KeyStoreSpi()
Constructs a new KeyStoreSpi
engineAliases
public Enumeration engineAliases()
Generates a list of all the aliases in the keystore.
Returns:
- an Enumeration of the aliases
engineContainsAlias
public boolean engineContainsAlias(java.lang.String alias)
Determines if the keystore contains the specified alias.
Parameters:
Returns:
- true if it contains the alias, false otherwise
engineDeleteEntry
public void engineDeleteEntry(java.lang.String alias)
Deletes the entry for the specified entry.
Parameters:
Throws:
engineGetCertificate
public Certificate engineGetCertificate(java.lang.String alias)
Gets a Certificate for the specified alias.
If there is a trusted certificate entry then that is returned.
it there is a key entry with a certificate chain then the
first certificate is return or else null.
Parameters:
Returns:
- a Certificate or null if the alias does not exist
or there is no certificate for the alias
engineGetCertificateAlias
public String engineGetCertificateAlias(java.security.cert. Certificate cert)
Determines if the keystore contains the specified certificate
entry and returns the alias.
It checks every entry and for a key entry checks only the
first certificate in the chain.
Parameters:
Returns:
- alias of first matching certificate, null if it
does not exist.
engineGetCertificateChain
public Certificate[] engineGetCertificateChain(java.lang.String alias)
Gets a Certificate chain for the specified alias.
Parameters:
Returns:
- a chain of Certificates ( ordered from the user's
certificate to the Certificate Authority's ) or
null if the alias does not exist or there is no
certificate chain for the alias ( the alias refers
to a trusted certificate entry or there is no entry).
engineGetCreationDate
public Date engineGetCreationDate(java.lang.String alias)
Gets entry creation date for the specified alias.
Parameters:
engineGetKey
public Key engineGetKey(java.lang.String alias, char[] )
Returns the key associated with given alias using the
supplied password.
Parameters:
Returns:
- the requested key, or null otherwise
Throws:
engineIsCertificateEntry
public boolean engineIsCertificateEntry(java.lang.String alias)
Determines if the keystore contains a certificate entry for
the specified alias.
Parameters:
Returns:
- true if it is a certificate entry, false otherwise
engineIsKeyEntry
public boolean engineIsKeyEntry(java.lang.String alias)
Determines if the keystore contains a key entry for
the specified alias.
Parameters:
Returns:
- true if it is a key entry, false otherwise
engineLoad
public void engineLoad(java.io.InputStream stream, char[] )
Loads the keystore from the specified input stream and it
uses the specified password to check for integrity if supplied.
Parameters:
Throws:
engineSetCertificateEntry
public void engineSetCertificateEntry(java.lang.String alias, java.security.cert. Certificate cert)
Assign the certificate to the alias in the keystore. It
will overwrite an existing entry.
Parameters:
Throws:
engineSetKeyEntry
public void engineSetKeyEntry(java.lang.String alias, byte[] , java.security.cert. Certificate[]chain)
Assign the key to the alias in the keystore. It will overwrite
an existing entry and if the key is a PrivateKey, also
add the certificate chain representing the corresponding
public key.
Parameters:
Throws:
engineSetKeyEntry
public void engineSetKeyEntry(java.lang.String alias, java.security.Key key, char[] , java.security.cert. Certificate[]chain)
Assign the key to the alias in the keystore, protecting it
with the given password. It will overwrite an existing
entry and if the key is a PrivateKey, also add the
certificate chain representing the corresponding public key.
Parameters:
Throws:
engineSize
public int engineSize()
Returns the number of entries in the keystore.
engineStore
public void engineStore(java.io.OutputStream stream, char[] )
Stores the keystore in the specified output stream and it
uses the specified key it keep it secure.
Parameters:
Throws: