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 Summary
Constructors Constructor Description KeystoreParameters(File file, String keystorePassword)
This constructor only takes thepath
to theKeyStore
file and the password for the KeyStore.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 theKeyStore
file. -
Method Summary
Modifier and Type Method Description String
getCertificateAlias()
File
getFile()
String
getKeystorePassword()
String
getPrivateKeyAlias()
String
getPrivateKeyPassword()
String
getPublicKeyAlias()
String
getSecretKeyAlias()
void
setCertificateAlias(String certificateAlias)
void
setFile(File file)
void
setKeystorePassword(String keystorePassword)
void
setPrivateKeyAlias(String privateKeyAlias)
void
setPrivateKeyPassword(String privateKeyPassword)
void
setPublicKeyAlias(String publicKeyAlias)
void
setSecretKeyAlias(String secretKeyAlias)
-
Constructor Details
-
KeystoreParameters
This constructor only takes thepath
to theKeyStore
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
orKeyManager
to create a new key pair with these parameters, a self signed certificate will be created as a placeholder.- Parameters:
file
- TheKeyStore
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 theKeyStore
file. Instead,KeystoreParameters(File file, String keystorePassword)
can be used, providing default values for most of the parameters.When using the
EasySigner
orKeyManager
to create a new key pair with these parameters, a self signed certificate will be created as a placeholder.- Parameters:
file
- TheKeyStore
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
-
setFile
-
getKeystorePassword
-
setKeystorePassword
-
getPublicKeyAlias
-
setPublicKeyAlias
-
getCertificateAlias
-
setCertificateAlias
-
getPrivateKeyAlias
-
setPrivateKeyAlias
-
getPrivateKeyPassword
-
setPrivateKeyPassword
-
getSecretKeyAlias
-
setSecretKeyAlias
-