Package anbxj

Class Crypto_KeyStoreBuilder

java.lang.Object
anbxj.Crypto_KeyStoreBuilder
Direct Known Subclasses:
Channel_SSLContextBuilder

public class Crypto_KeyStoreBuilder extends Object
Keystore builder
  • Field Details

    • kss

      protected Crypto_KeyStoreSettings kss
      A local copy of channel properties
    • localKeyStore

      protected KeyStore localKeyStore
      KeyStore for storing our public/private key pair
    • remoteKeyStore

      protected KeyStore remoteKeyStore
      // KeyStore for storing the other public keys
  • Constructor Details

    • Crypto_KeyStoreBuilder

      public Crypto_KeyStoreBuilder(Crypto_KeyStoreSettings kss)
      Constructs a Crypto_KeyStoreBuilder with the given Crypto_KeyStoreSettings.
      Parameters:
      kss - the Crypto_KeyStoreSettings
  • Method Details

    • getKss

      public Crypto_KeyStoreSettings getKss()
      Gets the Crypto_KeyStoreSettings.
      Returns:
      the Crypto_KeyStoreSettings
    • getLocaleCertificate

      public Certificate getLocaleCertificate()
      Gets the local certificate.
      Returns:
      the local certificate
    • getLocalPrivateKey

      public PrivateKey getLocalPrivateKey()
      Gets the local private key.
      Returns:
      the local private key
    • getMyAlias

      public String getMyAlias()
      Gets the alias of the key.
      Returns:
      the alias of the key
    • getRemoteCertificate

      public Certificate getRemoteCertificate(String alias)
      Gets the remote certificate with the specified alias.
      Parameters:
      alias - the alias of the certificate
      Returns:
      the remote certificate
    • getRemotePublicKey

      public PublicKey getRemotePublicKey(String alias)
      Gets the remote public key with the specified alias.
      Parameters:
      alias - the alias of the public key
      Returns:
      the remote public key
    • listAliases

      public void listAliases(KeyStore keystore, String keyStoreFile) throws KeyStoreException
      Lists the aliases in the given keystore.
      Parameters:
      keystore - the keystore
      keyStoreFile - the file name of the keystore
      Throws:
      KeyStoreException - if an error occurs while listing aliases
    • containsAlias

      public boolean containsAlias(String alias)
      Checks if the given alias exists in the remote keystore.
      Parameters:
      alias - the alias to check
      Returns:
      true if the alias exists, false otherwise
    • getCertPath

      public CertPath getCertPath()
      Retrieves the certificate path from the local keystore.
      Returns:
      the certificate path