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-17 16:21:59 +0200 |
commit | 19ca55a3bb4e308ef1122a1cdd8c911b811e18be (patch) | |
tree | 17aa598f52f0034d2246babe749796923e90a7bf /security-utils/src/main/java/com/yahoo/security/KeyStoreType.java | |
parent | 39da869d94cebe5bd851e1b4fb456372586a6870 (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; +} |