Package com.helger.phase4.crypto
Class AS4CryptoProperties
java.lang.Object
com.helger.phase4.crypto.AS4CryptoProperties
- All Implemented Interfaces:
com.helger.commons.lang.ICloneable<AS4CryptoProperties>,Serializable
@Immutable
public class AS4CryptoProperties
extends Object
implements Serializable, com.helger.commons.lang.ICloneable<AS4CryptoProperties>
Wrapper around the crypto properties file.
- Author:
- bayerlma, Philip Helger
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe class name implementing the CryptoProvider - default value is "org.apache.wss4j.common.crypto.Merlin"static final com.helger.security.keystore.EKeyStoreTypestatic final com.helger.security.keystore.EKeyStoreTypestatic final StringKeystore key aliasstatic final StringKeystore key passwordstatic final StringKeystore filename/pathstatic final StringKeystore passwordstatic final StringKeystore type: JKS or PKCS12static final StringType booleanstatic final StringTruststore filename/pathstatic final StringTruststore passwordstatic final StringTruststore provider - must usually not be setstatic final StringTruststore type - JKS or PKCS12? -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor having only the crypto provider property set to default.AS4CryptoProperties(com.helger.commons.io.resource.IReadableResource aRes) Constructor reading the properties from a resource using the Properties file syntax -
Method Summary
Modifier and TypeMethodDescriptionstatic AS4CryptoPropertiesgetClone()char[]com.helger.security.keystore.EKeyStoreTypecom.helger.commons.state.ETriStatecom.helger.security.keystore.EKeyStoreTypefinal booleanisRead()final AS4CryptoPropertiessetCryptoProvider(String sCryptoProvider) final AS4CryptoPropertiesfinal AS4CryptoPropertiessetKeyAlias(String sKeyAlias) final AS4CryptoPropertiessetKeyPassword(String sKeyPassword) final AS4CryptoPropertiessetKeyStorePassword(String sKeyStorePassword) final AS4CryptoPropertiessetKeyStorePath(String sKeyStorePath) final AS4CryptoPropertiessetKeyStoreType(com.helger.security.keystore.EKeyStoreType eType) final AS4CryptoPropertiessetLoadCACerts(boolean bLoadCACerts) final AS4CryptoPropertiessetTrustStorePassword(String sTrustStorePassword) final AS4CryptoPropertiessetTrustStorePath(String sTrustStorePath) final AS4CryptoPropertiessetTrustStoreProvider(String sTrustStoreProvider) final AS4CryptoPropertiessetTrustStoreType(com.helger.security.keystore.EKeyStoreType eType) toString()
-
Field Details
-
CRYPTO_PROVIDER
The class name implementing the CryptoProvider - default value is "org.apache.wss4j.common.crypto.Merlin"- See Also:
-
KEYSTORE_TYPE
Keystore type: JKS or PKCS12- See Also:
-
KEYSTORE_FILE
Keystore filename/path- See Also:
-
KEYSTORE_PASSWORD
Keystore password- See Also:
-
KEY_ALIAS
Keystore key alias- See Also:
-
KEY_PASSWORD
Keystore key password- See Also:
-
LOAD_CACERTS
Type boolean- See Also:
-
TRUSTSTORE_PROVIDER
Truststore provider - must usually not be set- See Also:
-
TRUSTSTORE_TYPE
Truststore type - JKS or PKCS12?- See Also:
-
TRUSTSTORE_FILE
Truststore filename/path- See Also:
-
TRUSTSTORE_PASSWORD
Truststore password- See Also:
-
DEFAULT_KEYSTORE_TYPE
public static final com.helger.security.keystore.EKeyStoreType DEFAULT_KEYSTORE_TYPE -
DEFAULT_TRUSTSTORE_TYPE
public static final com.helger.security.keystore.EKeyStoreType DEFAULT_TRUSTSTORE_TYPE
-
-
Constructor Details
-
AS4CryptoProperties
public AS4CryptoProperties()Default constructor having only the crypto provider property set to default. -
AS4CryptoProperties
Constructor reading the properties from a resource using the Properties file syntax- Parameters:
aRes- The resource to read. May not benull.
-
-
Method Details
-
isRead
public final boolean isRead()- Returns:
trueif properties are available. This is alwaystruewhen a map was used to initialize it. Only if a resource was used, this may becomefalse.
-
getAsProperties
- Returns:
- A representation of the contained properties as
Properties. May benull.
-
getCryptoProvider
-
setCryptoProvider
-
setCryptoProviderDefault
-
getKeyStoreType
-
setKeyStoreType
@Nonnull public final AS4CryptoProperties setKeyStoreType(@Nullable com.helger.security.keystore.EKeyStoreType eType) -
getKeyStorePath
-
setKeyStorePath
-
getKeyStorePassword
-
setKeyStorePassword
-
getKeyAlias
-
setKeyAlias
-
getKeyPassword
-
getKeyPasswordCharArray
-
setKeyPassword
-
getLoadCACerts
-
setLoadCACerts
-
getTrustStoreProvider
-
setTrustStoreProvider
@Nonnull public final AS4CryptoProperties setTrustStoreProvider(@Nullable String sTrustStoreProvider) -
getTrustStoreType
-
setTrustStoreType
@Nonnull public final AS4CryptoProperties setTrustStoreType(@Nullable com.helger.security.keystore.EKeyStoreType eType) -
getTrustStorePath
-
setTrustStorePath
-
getTrustStorePassword
-
setTrustStorePassword
@Nonnull public final AS4CryptoProperties setTrustStorePassword(@Nullable String sTrustStorePassword) -
getClone
- Specified by:
getClonein interfacecom.helger.commons.lang.ICloneable<AS4CryptoProperties>
-
toString
-
createFromConfig
- Returns:
- A new
AS4CryptoPropertiesobject filled with all values from the global configuration file. Values not present in the configuration are not set and stay with their default values. - Since:
- 0.11.0
-