Package org.conscrypt
Class TrustedCertificateKeyStoreSpi
java.lang.Object
java.security.KeyStoreSpi
org.conscrypt.TrustedCertificateKeyStoreSpi
public final class TrustedCertificateKeyStoreSpi extends KeyStoreSpi
A KeyStoreSpi wrapper for the TrustedCertificateStore.
-
Constructor Summary
Constructors Constructor Description TrustedCertificateKeyStoreSpi() -
Method Summary
Modifier and Type Method Description Enumeration<String>engineAliases()Returns anEnumerationover all alias names stored in thisKeyStoreSpi.booleanengineContainsAlias(String alias)Indicates whether the given alias is present in thisKeyStoreSpi.voidengineDeleteEntry(String alias)Deletes the entry identified with the given alias from thisKeyStoreSpi.CertificateengineGetCertificate(String alias)Returns the trusted certificate for the entry with the given alias.StringengineGetCertificateAlias(Certificate c)Returns the alias associated with the first entry whose certificate matches the specified certificate.Certificate[]engineGetCertificateChain(String alias)Returns the certificate chain for the entry with the given alias.DateengineGetCreationDate(String alias)Returns the creation date of the entry with the given alias.KeyengineGetKey(String alias, char[] password)Returns the key with the given alias, using the password to recover the key from the store.booleanengineIsCertificateEntry(String alias)Indicates whether the specified alias is associated with aKeyStore.TrustedCertificateEntry.booleanengineIsKeyEntry(String alias)Indicates whether the specified alias is associated with either aKeyStore.PrivateKeyEntryor aKeyStore.SecretKeyEntry.voidengineLoad(InputStream stream, char[] password)Loads thisKeyStoreSpifrom the givenInputStream.voidengineSetCertificateEntry(String alias, Certificate cert)Associates the given alias with a certificate.voidengineSetKeyEntry(String alias, byte[] key, Certificate[] chain)Associates the given alias with a key and a certificate chain.voidengineSetKeyEntry(String alias, Key key, char[] password, Certificate[] chain)Associates the given alias with the key, password and certificate chain.intengineSize()Returns the number of entries stored in thisKeyStoreSpi.voidengineStore(OutputStream stream, char[] password)Writes thisKeyStoreSpito the specifiedOutputStream.Methods inherited from class java.security.KeyStoreSpi
engineEntryInstanceOf, engineGetEntry, engineLoad, engineSetEntry, engineStore
-
Constructor Details
-
TrustedCertificateKeyStoreSpi
public TrustedCertificateKeyStoreSpi()
-
-
Method Details
-
engineGetKey
Description copied from class:KeyStoreSpiReturns the key with the given alias, using the password to recover the key from the store.- Specified by:
engineGetKeyin classKeyStoreSpi- Parameters:
alias- the alias for the entry.password- the password used to recover the key.- Returns:
- the key with the specified alias, or
nullif the specified alias is not bound to an entry.
-
engineGetCertificateChain
Description copied from class:KeyStoreSpiReturns the certificate chain for the entry with the given alias.- Specified by:
engineGetCertificateChainin classKeyStoreSpi- Parameters:
alias- the alias for the entry- Returns:
- the certificate chain for the entry with the given alias, or
nullif the specified alias is not bound to an entry.
-
engineGetCertificate
Description copied from class:KeyStoreSpiReturns the trusted certificate for the entry with the given alias.- Specified by:
engineGetCertificatein classKeyStoreSpi- Parameters:
alias- the alias for the entry.- Returns:
- the trusted certificate for the entry with the given alias, or
nullif the specified alias is not bound to an entry.
-
engineGetCreationDate
Description copied from class:KeyStoreSpiReturns the creation date of the entry with the given alias.- Specified by:
engineGetCreationDatein classKeyStoreSpi- Parameters:
alias- the alias for the entry.- Returns:
- the creation date, or
nullif the specified alias is not bound to an entry.
-
engineSetKeyEntry
Description copied from class:KeyStoreSpiAssociates the given alias with the key, password and certificate chain.If the specified alias already exists, it will be reassigned.
- Specified by:
engineSetKeyEntryin classKeyStoreSpi- Parameters:
alias- the alias for the key.key- the key.password- the password.chain- the certificate chain.
-
engineSetKeyEntry
Description copied from class:KeyStoreSpiAssociates the given alias with a key and a certificate chain.If the specified alias already exists, it will be reassigned.
- Specified by:
engineSetKeyEntryin classKeyStoreSpi- Parameters:
alias- the alias for the key.key- the key in an encoded format.chain- the certificate chain.
-
engineSetCertificateEntry
Description copied from class:KeyStoreSpiAssociates the given alias with a certificate.If the specified alias already exists, it will be reassigned.
- Specified by:
engineSetCertificateEntryin classKeyStoreSpi- Parameters:
alias- the alias for the certificate.cert- the certificate.
-
engineDeleteEntry
Description copied from class:KeyStoreSpiDeletes the entry identified with the given alias from thisKeyStoreSpi.- Specified by:
engineDeleteEntryin classKeyStoreSpi- Parameters:
alias- the alias for the entry.
-
engineAliases
Description copied from class:KeyStoreSpiReturns anEnumerationover all alias names stored in thisKeyStoreSpi.- Specified by:
engineAliasesin classKeyStoreSpi- Returns:
- an
Enumerationover all alias names stored in thisKeyStoreSpi.
-
engineContainsAlias
Description copied from class:KeyStoreSpiIndicates whether the given alias is present in thisKeyStoreSpi.- Specified by:
engineContainsAliasin classKeyStoreSpi- Parameters:
alias- the alias of an entry.- Returns:
trueif the alias exists,falseotherwise.
-
engineSize
public int engineSize()Description copied from class:KeyStoreSpiReturns the number of entries stored in thisKeyStoreSpi.- Specified by:
engineSizein classKeyStoreSpi- Returns:
- the number of entries stored in this
KeyStoreSpi.
-
engineIsKeyEntry
Description copied from class:KeyStoreSpiIndicates whether the specified alias is associated with either aKeyStore.PrivateKeyEntryor aKeyStore.SecretKeyEntry.- Specified by:
engineIsKeyEntryin classKeyStoreSpi- Parameters:
alias- the alias of an entry.- Returns:
trueif the given alias is associated with a key entry.
-
engineIsCertificateEntry
Description copied from class:KeyStoreSpiIndicates whether the specified alias is associated with aKeyStore.TrustedCertificateEntry.- Specified by:
engineIsCertificateEntryin classKeyStoreSpi- Parameters:
alias- the alias of an entry.- Returns:
trueif the given alias is associated with a certificate entry.
-
engineGetCertificateAlias
Description copied from class:KeyStoreSpiReturns the alias associated with the first entry whose certificate matches the specified certificate.- Specified by:
engineGetCertificateAliasin classKeyStoreSpi- Parameters:
c- the certificate to find the associated entry's alias for.- Returns:
- the alias or
nullif no entry with the specified certificate can be found.
-
engineStore
Description copied from class:KeyStoreSpiWrites thisKeyStoreSpito the specifiedOutputStream. The data written to theOutputStreamis protected by the specified password.- Specified by:
engineStorein classKeyStoreSpi- Parameters:
stream- theOutputStreamto write the store's data to.password- the password to protect the data.
-
engineLoad
Description copied from class:KeyStoreSpiLoads thisKeyStoreSpifrom the givenInputStream. Utilizes the given password to verify the stored data.- Specified by:
engineLoadin classKeyStoreSpi- Parameters:
stream- theInputStreamto load thisKeyStoreSpi's data from.password- the password to verify the stored data, maybenull.
-