Class KeystoreParameters

java.lang.Object
de.hda.fbi.ucs.eucrite.parameters.KeystoreParameters
All Implemented Interfaces:
StorageParameters

public class KeystoreParameters
extends Object
implements StorageParameters
This class contains the necessary parameters to use the EasySigner or EasyEncrypter with an KeyStore. An object of this class specifies the location of the KeyStore on disk, Passwords to load the KeyStore and the Private or Secret key and the aliases of a corresponding Private or Secret and Public Key and the Certificate. The location path and the KeyStore password are mandatory, for all the other parameters default values are available.

When using the EasySigner, EasyEncrypter or KeyManager to create a new key pair with these parameters, a self signed certificate will be created as a placeholder.

Author:
Alexander Zeier
  • Constructor Details

    • KeystoreParameters

      public KeystoreParameters​(File file, String keystorePassword)
      This constructor only takes the path to the KeyStore file and the password for the KeyStore. For all other parameters, default values will be used. These are: "PublicKey" as the alias for the public key, "PrivateKey" as the alias for the private key, "SecretKey" as the alias for the secret key, "Certificate" as the alias for the certificate. The password for the private key will be the same as for the KeyStore.

      When using the EasySigner or KeyManager to create a new key pair with these parameters, a self signed certificate will be created as a placeholder.

      Parameters:
      file - The KeyStore file.
      keystorePassword - The KeyStore password.
    • KeystoreParameters

      public KeystoreParameters​(File file, String keystorePassword, String publicKeyAlias, String certificateAlias, String privateKeyAlias, String privateKeyPassword)
      This constructor takes all the parameters to access the key pair stored in the KeyStore file. Instead, KeystoreParameters(File file, String keystorePassword) can be used, providing default values for most of the parameters.

      When using the EasySigner or KeyManager to create a new key pair with these parameters, a self signed certificate will be created as a placeholder.

      Parameters:
      file - The KeyStore file.
      keystorePassword - The KeyStore password.
      publicKeyAlias - The alias of the public key.
      certificateAlias - The alias of the certificate.
      privateKeyAlias - The alias of the private key.
      privateKeyPassword - The private key password.
  • Method Details

    • getFile

      public File getFile()
    • setFile

      public void setFile​(File file)
    • getKeystorePassword

      public String getKeystorePassword()
    • setKeystorePassword

      public void setKeystorePassword​(String keystorePassword)
    • getPublicKeyAlias

      public String getPublicKeyAlias()
    • setPublicKeyAlias

      public void setPublicKeyAlias​(String publicKeyAlias)
    • getCertificateAlias

      public String getCertificateAlias()
    • setCertificateAlias

      public void setCertificateAlias​(String certificateAlias)
    • getPrivateKeyAlias

      public String getPrivateKeyAlias()
    • setPrivateKeyAlias

      public void setPrivateKeyAlias​(String privateKeyAlias)
    • getPrivateKeyPassword

      public String getPrivateKeyPassword()
    • setPrivateKeyPassword

      public void setPrivateKeyPassword​(String privateKeyPassword)
    • getSecretKeyAlias

      public String getSecretKeyAlias()
    • setSecretKeyAlias

      public void setSecretKeyAlias​(String secretKeyAlias)