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 Details

    • TrustedCertificateKeyStoreSpi

      public TrustedCertificateKeyStoreSpi()
  • Method Details

    • engineGetKey

      public Key engineGetKey​(String alias, char[] password)
      Description copied from class: KeyStoreSpi
      Returns the key with the given alias, using the password to recover the key from the store.
      Specified by:
      engineGetKey in class KeyStoreSpi
      Parameters:
      alias - the alias for the entry.
      password - the password used to recover the key.
      Returns:
      the key with the specified alias, or null if the specified alias is not bound to an entry.
    • engineGetCertificateChain

      public Certificate[] engineGetCertificateChain​(String alias)
      Description copied from class: KeyStoreSpi
      Returns the certificate chain for the entry with the given alias.
      Specified by:
      engineGetCertificateChain in class KeyStoreSpi
      Parameters:
      alias - the alias for the entry
      Returns:
      the certificate chain for the entry with the given alias, or null if the specified alias is not bound to an entry.
    • engineGetCertificate

      public Certificate engineGetCertificate​(String alias)
      Description copied from class: KeyStoreSpi
      Returns the trusted certificate for the entry with the given alias.
      Specified by:
      engineGetCertificate in class KeyStoreSpi
      Parameters:
      alias - the alias for the entry.
      Returns:
      the trusted certificate for the entry with the given alias, or null if the specified alias is not bound to an entry.
    • engineGetCreationDate

      public Date engineGetCreationDate​(String alias)
      Description copied from class: KeyStoreSpi
      Returns the creation date of the entry with the given alias.
      Specified by:
      engineGetCreationDate in class KeyStoreSpi
      Parameters:
      alias - the alias for the entry.
      Returns:
      the creation date, or null if the specified alias is not bound to an entry.
    • engineSetKeyEntry

      public void engineSetKeyEntry​(String alias, Key key, char[] password, Certificate[] chain)
      Description copied from class: KeyStoreSpi
      Associates the given alias with the key, password and certificate chain.

      If the specified alias already exists, it will be reassigned.

      Specified by:
      engineSetKeyEntry in class KeyStoreSpi
      Parameters:
      alias - the alias for the key.
      key - the key.
      password - the password.
      chain - the certificate chain.
    • engineSetKeyEntry

      public void engineSetKeyEntry​(String alias, byte[] key, Certificate[] chain)
      Description copied from class: KeyStoreSpi
      Associates the given alias with a key and a certificate chain.

      If the specified alias already exists, it will be reassigned.

      Specified by:
      engineSetKeyEntry in class KeyStoreSpi
      Parameters:
      alias - the alias for the key.
      key - the key in an encoded format.
      chain - the certificate chain.
    • engineSetCertificateEntry

      public void engineSetCertificateEntry​(String alias, Certificate cert)
      Description copied from class: KeyStoreSpi
      Associates the given alias with a certificate.

      If the specified alias already exists, it will be reassigned.

      Specified by:
      engineSetCertificateEntry in class KeyStoreSpi
      Parameters:
      alias - the alias for the certificate.
      cert - the certificate.
    • engineDeleteEntry

      public void engineDeleteEntry​(String alias)
      Description copied from class: KeyStoreSpi
      Deletes the entry identified with the given alias from this KeyStoreSpi.
      Specified by:
      engineDeleteEntry in class KeyStoreSpi
      Parameters:
      alias - the alias for the entry.
    • engineAliases

      public Enumeration<String> engineAliases()
      Description copied from class: KeyStoreSpi
      Returns an Enumeration over all alias names stored in this KeyStoreSpi.
      Specified by:
      engineAliases in class KeyStoreSpi
      Returns:
      an Enumeration over all alias names stored in this KeyStoreSpi.
    • engineContainsAlias

      public boolean engineContainsAlias​(String alias)
      Description copied from class: KeyStoreSpi
      Indicates whether the given alias is present in this KeyStoreSpi.
      Specified by:
      engineContainsAlias in class KeyStoreSpi
      Parameters:
      alias - the alias of an entry.
      Returns:
      true if the alias exists, false otherwise.
    • engineSize

      public int engineSize()
      Description copied from class: KeyStoreSpi
      Returns the number of entries stored in this KeyStoreSpi.
      Specified by:
      engineSize in class KeyStoreSpi
      Returns:
      the number of entries stored in this KeyStoreSpi.
    • engineIsKeyEntry

      public boolean engineIsKeyEntry​(String alias)
      Description copied from class: KeyStoreSpi
      Indicates whether the specified alias is associated with either a KeyStore.PrivateKeyEntry or a KeyStore.SecretKeyEntry.
      Specified by:
      engineIsKeyEntry in class KeyStoreSpi
      Parameters:
      alias - the alias of an entry.
      Returns:
      true if the given alias is associated with a key entry.
    • engineIsCertificateEntry

      public boolean engineIsCertificateEntry​(String alias)
      Description copied from class: KeyStoreSpi
      Indicates whether the specified alias is associated with a KeyStore.TrustedCertificateEntry.
      Specified by:
      engineIsCertificateEntry in class KeyStoreSpi
      Parameters:
      alias - the alias of an entry.
      Returns:
      true if the given alias is associated with a certificate entry.
    • engineGetCertificateAlias

      public String engineGetCertificateAlias​(Certificate c)
      Description copied from class: KeyStoreSpi
      Returns the alias associated with the first entry whose certificate matches the specified certificate.
      Specified by:
      engineGetCertificateAlias in class KeyStoreSpi
      Parameters:
      c - the certificate to find the associated entry's alias for.
      Returns:
      the alias or null if no entry with the specified certificate can be found.
    • engineStore

      public void engineStore​(OutputStream stream, char[] password)
      Description copied from class: KeyStoreSpi
      Writes this KeyStoreSpi to the specified OutputStream. The data written to the OutputStream is protected by the specified password.
      Specified by:
      engineStore in class KeyStoreSpi
      Parameters:
      stream - the OutputStream to write the store's data to.
      password - the password to protect the data.
    • engineLoad

      public void engineLoad​(InputStream stream, char[] password)
      Description copied from class: KeyStoreSpi
      Loads this KeyStoreSpi from the given InputStream. Utilizes the given password to verify the stored data.
      Specified by:
      engineLoad in class KeyStoreSpi
      Parameters:
      stream - the InputStream to load this KeyStoreSpi's data from.
      password - the password to verify the stored data, maybe null.