Package org.projecthusky.xua.pki.impl
Class PkiManagerImpl
java.lang.Object
org.projecthusky.xua.pki.impl.PkiManagerImpl
- All Implemented Interfaces:
PkiManager
Implementation class of PkiManager
Implementations Klasse von PkiManager
-
Field Summary
Fields inherited from interface org.projecthusky.xua.pki.PkiManager
TYPE_JCEKS, TYPE_JKS, TYPE_PKCS12 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClientKeyAndCert(File privateKeyPemPath, File clientCertPemPath, String alias, KeyStore keyStore, String aKeyPassword) voidaddPublicCert(File publiCertPath, String alias, KeyStore keyStore) Method to add a certificate to a keystore. Methode um ein öffentliches Zertifikat im Key Store zu registrieren.createNewStore(String storeType) Method to create a newKeyStore.listCertificateAliases(KeyStore keyStore) Method to list all registered certificates. Methode zum Auflisten der registrierten Zertifikate.listCertificates(KeyStore keyStore) Method to list all registered certificates. Methode zum Auflisten der registrierten Zerifikate.loadStore(InputStream storeInputStream, String storePassword, String storeType) voidremoveCert(String alias, KeyStore keyStore) voidstoreStore(KeyStore keyStore, OutputStream storeOutputStream, String storePassword)
-
Constructor Details
-
PkiManagerImpl
public PkiManagerImpl()
-
-
Method Details
-
addClientKeyAndCert
public void addClientKeyAndCert(File privateKeyPemPath, File clientCertPemPath, String alias, KeyStore keyStore, String aKeyPassword) throws KeyStoreException Method to registers a Client Key/Certificate in theKeyStore.Methode um ein ClientKey/Zertifikat imKeyStorezu registrieren.- Specified by:
addClientKeyAndCertin interfacePkiManager- Parameters:
privateKeyPemPath-the path of the file with the private keyder Pfad des Ffiles mit dem privaten SchlüsselclientCertPemPath-the path of the pem file of the certificateder Pfad des pem Files des Zertifikatesalias-the alias the key and cert should be referenced withder Alias unter dem der Schlüssel und das Zertifikat referenziert werden sollkeyStore-the keystore the client key/certificate should be addded toDer keystore in dem Schlüssel/Zertifikat hinzugefügt werden sollaKeyPassword-the password of the keydas Passwort des Keys- Throws:
KeyStoreException-will be thrown when an error occures storing the KeyStore to filesystemwird geworfen wenn ein Fehler beim Speichern des KeyStores ins Filesystem auftritt- See Also:
-
addPublicCert
public void addPublicCert(File publiCertPath, String alias, KeyStore keyStore) throws KeyStoreException Method to add a certificate to a keystore.Methode um ein öffentliches Zertifikat im Key Store zu registrieren.- Specified by:
addPublicCertin interfacePkiManager- Parameters:
publiCertPath-the path of the file the certificate is stored inder Pfad des Files des Zertifikatesalias-the alias the cert should be referenced withder Alias unter dem das Zertifikat referenziert werden sollkeyStore-the keystore the certificate should be addded toDer Keystore dem das Zertifikat hinzugefügt werden soll- Throws:
KeyStoreException-will be thrown when an error occures storing the KeyStore to filesystemwird geworfen wenn ein Fehler beim Speichern des KeyStores ins Filesystem auftritt- See Also:
-
createNewStore
Method to create a newKeyStore. The Keystore is not saved.Methode um einen neuenKeyStorezu erstellen. Der Keystore wird nicht gespeichert.- Specified by:
createNewStorein interfacePkiManager- Parameters:
storeType-the type of the key store (seePkiManager.TYPE_JKS, @link #TYPE_JCEKS}, @link #TYPE_PKCS12}).- Returns:
- the
KeyStoreloaded from file.derKeyStoregeladen vom File. - Throws:
KeyStoreException-will be thrown when an error occures loading the KeyStore from filesystem.wird geworfen wenn ein Fehler beim Laden des KeyStores aus dem Filesystem auftritt- See Also:
-
listCertificateAliases
Method to list all registered certificates.Methode zum Auflisten der registrierten Zertifikate.- Specified by:
listCertificateAliasesin interfacePkiManager- Parameters:
keyStore-the keystoreDer Keystore- Returns:
- a
Listof all certificate aliasesEineListvon allen Zertifikat Aliases - Throws:
KeyStoreException-will be thrown when an error occures storing the KeyStore to filesystemwird geworfen wenn ein Fehler beim Speichern des KeyStores ins Filesystem auftritt- See Also:
-
listCertificates
Method to list all registered certificates.Methode zum Auflisten der registrierten Zerifikate.- Specified by:
listCertificatesin interfacePkiManager- Parameters:
keyStore-the keystoreDer Keystore- Returns:
- a
Listof all certificatesEineListvon allen Zertifikaten - Throws:
KeyStoreException-will be thrown when an error occures storing the KeyStore to filesystemwird geworfen wenn ein Fehler beim Speichern des KeyStores ins Filesystem auftritt- See Also:
-
loadStore
public KeyStore loadStore(InputStream storeInputStream, String storePassword, String storeType) throws KeyStoreException - Specified by:
loadStorein interfacePkiManager- Parameters:
storeInputStream-the InputStream of theKeyStorefile.der InputStream desKeyStoreFiles.storePassword-the password of theKeyStoredas Passwort desKeyStorestoreType-the type of the key store (seePkiManager.TYPE_JKS, @link #TYPE_JCEKS}, @link #TYPE_PKCS12}).- Returns:
- the
KeyStoreloaded from file.derKeyStoregeladen vom File. - Throws:
KeyStoreException-will be thrown when an error occures loading the KeyStorewird geworfen wenn ein Fehler beim Laden des KeyStores auftritt- See Also:
-
removeCert
Removes an Entry from theKeyStorereferenced by an alias.Entfernt ein Eintrag referenziert durch den Alias aus demKeyStore.- Specified by:
removeCertin interfacePkiManager- Parameters:
alias-the alias the key and cert should be referenced withder Alias unter dem der Schlüssel und das Zertifikat referenziert werden sollkeyStore-the keystore the certificate should be removed fromDer Keystore dem das Zertifikat entfernt werden soll- Throws:
KeyStoreException-will be thrown when an error occures storing the KeyStore to filesystemwird geworfen wenn ein Fehler beim Speichern des KeyStores ins Filesystem auftritt- See Also:
-
storeStore
public void storeStore(KeyStore keyStore, OutputStream storeOutputStream, String storePassword) throws KeyStoreException - Specified by:
storeStorein interfacePkiManager- Parameters:
keyStore-the keystore the certificate should be addded toDer Keystore dem das Zertifikat hinzugefügt werden sollstoreOutputStream-the OutputStream of the file the keystore to be stored inder OutputStream des Files in dem der Keystore gespeichert wirdstorePassword-the password of theKeyStoredas Passwort desKeyStore- Throws:
KeyStoreException-will be thrown when an error occures storing the KeyStore to filesystemwird geworfen wenn ein Fehler beim Speichern des KeyStores ins Filesystem auftritt- See Also:
-