Package org.frankframework.encryption
Class PkiUtil
java.lang.Object
org.frankframework.encryption.PkiUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic KeyManager[]
createKeyManagers
(KeyStore keystore, String password, String algorithm) static KeyStore
createKeyStore
(URL url, String password, KeystoreType keystoreType) static KeyStore
createKeyStore
(HasKeystore keystoreOwner) static KeyStore
createKeyStore
(HasTruststore truststoreOwner) static TrustManager[]
createTrustManagers
(KeyStore keystore, String algorithm) static Certificate
getCertificate
(HasTruststore truststoreOwner) getExpiringCertificates
(KeyStore keystore, TemporalAmount duration) Returns a list of certificate aliases which are due to expire.static PrivateKey
getPrivateKey
(HasKeystore keystoreOwner) static PublicKey
getPublicKey
(HasTruststore truststoreOwner) static HasTruststore
keyStoreAsTrustStore
(HasKeystore keystoreOwner)
-
Constructor Details
-
PkiUtil
public PkiUtil()
-
-
Method Details
-
keyStoreAsTrustStore
-
createKeyManagers
public static KeyManager[] createKeyManagers(KeyStore keystore, String password, String algorithm) throws KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException -
createTrustManagers
public static TrustManager[] createTrustManagers(KeyStore keystore, String algorithm) throws KeyStoreException, NoSuchAlgorithmException -
createKeyStore
public static KeyStore createKeyStore(URL url, String password, KeystoreType keystoreType) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException -
createKeyStore
- Throws:
EncryptionException
-
createKeyStore
- Throws:
EncryptionException
-
getPrivateKey
- Throws:
EncryptionException
-
getPublicKey
- Throws:
EncryptionException
-
getCertificate
- Throws:
EncryptionException
-
getExpiringCertificates
@Nonnull public static List<String> getExpiringCertificates(KeyStore keystore, TemporalAmount duration) throws EncryptionException Returns a list of certificate aliases which are due to expire.- Parameters:
keystore
- AKeyStore
.duration
- Date after which Certificates should be classified as 'due to expire'.- Returns:
- A list with aliases of
Certificates
. - Throws:
EncryptionException
-