diff options
author | Bjørn Christian Seime <bjorncs@oath.com> | 2018-10-17 16:21:59 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@oath.com> | 2018-10-19 12:51:59 +0200 |
commit | 0bd809390b24df069742b7a3deca824712b4f041 (patch) | |
tree | 63796492ac504128a39ff20d5e1be3e33b3b433f /security-utils/src/main/java/com/yahoo/security/KeyStoreType.java | |
parent | 63c5ed8f8f08c7411214ecbc417451a735aef676 (diff) |
Move classes in com.yahoo.security to security-utils
Diffstat (limited to 'security-utils/src/main/java/com/yahoo/security/KeyStoreType.java')
-rw-r--r-- | security-utils/src/main/java/com/yahoo/security/KeyStoreType.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/security-utils/src/main/java/com/yahoo/security/KeyStoreType.java b/security-utils/src/main/java/com/yahoo/security/KeyStoreType.java new file mode 100644 index 00000000000..7fb8df35286 --- /dev/null +++ b/security-utils/src/main/java/com/yahoo/security/KeyStoreType.java @@ -0,0 +1,23 @@ +// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.security; + +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.KeyStoreException; + +/** + * @author bjorncs + */ +public enum KeyStoreType { + JKS { + KeyStore createKeystore() throws KeyStoreException { + return KeyStore.getInstance("JKS"); + } + }, + PKCS12 { + KeyStore createKeystore() throws KeyStoreException { + return KeyStore.getInstance("PKCS12", BouncyCastleProviderHolder.getInstance()); + } + }; + abstract KeyStore createKeystore() throws GeneralSecurityException; +} |