Package com.helger.security.keystore
Enum EKeyStoreType
- java.lang.Object
-
- java.lang.Enum<EKeyStoreType>
-
- com.helger.security.keystore.EKeyStoreType
-
- All Implemented Interfaces:
com.helger.commons.id.IHasID<String>,IKeyStoreType,Serializable,Comparable<EKeyStoreType>
public enum EKeyStoreType extends Enum<EKeyStoreType> implements IKeyStoreType
The default key store types.- Since:
- 9.0.0
- Author:
- Philip Helger
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BCFKSThe BCFKS key store is designed to be FIPS compliant.JKSThe default Java Key Store type.PKCS11The PKCS11 key store type is used for secure storage such as Smart Cards and HSM.PKCS12The PKCS12 key store type is slightly better than JKS and is supported only in Java 1.9.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EKeyStoreTypegetFromIDCaseInsensitiveOrDefault(String sID, EKeyStoreType eDefault)static EKeyStoreTypegetFromIDCaseInsensitiveOrNull(String sID)static EKeyStoreTypegetFromIDOrNull(String sID)StringgetID()booleanisKeyStorePathRequired()Determines, if a key store path is required for loading the key store.static EKeyStoreTypevalueOf(String name)Returns the enum constant of this type with the specified name.static EKeyStoreType[]values()Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface com.helger.security.keystore.IKeyStoreType
getKeyStore, getKeyStore, getKeyStore
-
-
-
-
Enum Constant Detail
-
JKS
public static final EKeyStoreType JKS
The default Java Key Store type. Supported by all relevant Java versions since at least 1.5
-
PKCS11
public static final EKeyStoreType PKCS11
The PKCS11 key store type is used for secure storage such as Smart Cards and HSM. A key store path is not required (and not supported) for such key store types.- Since:
- 11.0.3
-
PKCS12
public static final EKeyStoreType PKCS12
The PKCS12 key store type is slightly better than JKS and is supported only in Java 1.9. In Java 1.8 and earlier this is only supported when BouncyCastle is contained.
-
BCFKS
public static final EKeyStoreType BCFKS
The BCFKS key store is designed to be FIPS compliant. It is available in approved-mode operation and is also capable of storing some secret key types in addition to public/private keys and certificates. The BCFKS key store uses PBKDF2 with HMAC SHA512 for password to key conversion and AES CCM for encryption. Passwords are encoded for conversion into keys using PKCS#12 format (as in each 16 bit character is converted into 2 bytes).
-
-
Method Detail
-
values
public static EKeyStoreType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (EKeyStoreType c : EKeyStoreType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EKeyStoreType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getID
@Nonnull @Nonempty public String getID()
- Specified by:
getIDin interfacecom.helger.commons.id.IHasID<String>
-
isKeyStorePathRequired
public boolean isKeyStorePathRequired()
Description copied from interface:IKeyStoreTypeDetermines, if a key store path is required for loading the key store. Note: the default value is only contained to be backwards compatible.- Specified by:
isKeyStorePathRequiredin interfaceIKeyStoreType- Returns:
true, if a path must be present
-
getFromIDOrNull
@Nullable public static EKeyStoreType getFromIDOrNull(@Nullable String sID)
-
getFromIDCaseInsensitiveOrNull
@Nullable public static EKeyStoreType getFromIDCaseInsensitiveOrNull(@Nullable String sID)
-
getFromIDCaseInsensitiveOrDefault
@Nullable public static EKeyStoreType getFromIDCaseInsensitiveOrDefault(@Nullable String sID, @Nullable EKeyStoreType eDefault)
-
-