Package org.projecthusky.xua.pki
Interface PkiManager
- All Known Implementing Classes:
PkiManagerImpl
public interface PkiManager
Interface describing the methods of the PkiManager.
Interface welches die Methoden des PkiManagers beschreibt.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The proprietary keystore implementation provided by the SunJCE provider.static final String
The proprietary keystore implementation provided by the SUN provider.static final String
The transfer syntax for personal identity information as defined in PKCS #12. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addClientKeyAndCert
(File privateKeyPemPath, File clientCertPemPath, String alias, KeyStore keyStore, String aKeyPassword) void
addPublicCert
(File publicCertPemPath, 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) void
removeCert
(String alias, KeyStore keyStore) void
storeStore
(KeyStore keyStore, OutputStream storeOutputStream, String storePassword)
-
Field Details
-
TYPE_JCEKS
The proprietary keystore implementation provided by the SunJCE provider.- See Also:
-
TYPE_JKS
The proprietary keystore implementation provided by the SUN provider.- See Also:
-
TYPE_PKCS12
The transfer syntax for personal identity information as defined in PKCS #12.- See Also:
-
-
Method Details
-
addClientKeyAndCert
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 imKeyStore
zu registrieren.- 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
-
addPublicCert
void addPublicCert(File publicCertPemPath, String alias, KeyStore keyStore) throws KeyStoreException Method to add a certificate to a keystore.Methode um ein öffentliches Zertifikat im Key Store zu registrieren.- Parameters:
publicCertPemPath
-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
-
createNewStore
Method to create a newKeyStore
. The Keystore is not saved.Methode um einen neuenKeyStore
zu erstellen. Der Keystore wird nicht gespeichert.- Parameters:
storeType
-the type of the key store (seeTYPE_JKS
, @link #TYPE_JCEKS}, @link #TYPE_PKCS12}).- Returns:
- the
KeyStore
loaded from file.derKeyStore
geladen 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
-
listCertificateAliases
Method to list all registered certificates.Methode zum Auflisten der registrierten Zertifikate.- Parameters:
keyStore
-the keystoreDer Keystore- Returns:
- a
List
of all certificate aliasesEineList
von 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
-
listCertificates
Method to list all registered certificates.Methode zum Auflisten der registrierten Zerifikate.- Parameters:
keyStore
-the keystoreDer Keystore- Returns:
- a
List
of all certificatesEineList
von 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
-
loadStore
KeyStore loadStore(InputStream storeInputStream, String storePassword, String storeType) throws KeyStoreException - Parameters:
storeInputStream
-the InputStream of theKeyStore
file.der InputStream desKeyStore
Files.storePassword
-the password of theKeyStore
das Passwort desKeyStore
storeType
-the type of the key store (seeTYPE_JKS
, @link #TYPE_JCEKS}, @link #TYPE_PKCS12}).- Returns:
- the
KeyStore
loaded from file.derKeyStore
geladen vom File. - Throws:
KeyStoreException
-will be thrown when an error occures loading the KeyStorewird geworfen wenn ein Fehler beim Laden des KeyStores auftritt
-
removeCert
Removes an Entry from theKeyStore
referenced by an alias.Entfernt ein Eintrag referenziert durch den Alias aus demKeyStore
.- 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
-
storeStore
void storeStore(KeyStore keyStore, OutputStream storeOutputStream, String storePassword) throws KeyStoreException - 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 theKeyStore
das 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
-