com.helger.phase4.cryptoMaven artifact:
com.helger.phase4:phase4-lib
phase4 uses a crypto factory abstraction to load keystores and provide WSS4J Crypto instances for signing, signature verification, encryption, and decryption.
IAS4CryptoFactory
The central interface for all crypto operations in phase4.Interface methods
Returns a WSS4J
Crypto instance. The ECryptoMode parameter is ENCRYPT_OR_SIGN or DECRYPT_OR_VERIFY. Never null.Returns the underlying key store, or
null if unavailable.Returns the private key entry from the keystore, or
null if unavailable.Returns the keystore alias identifying the private key entry. May be
null.Returns the key password for a given alias as a
char[], or null. Since 3.0.0.Convenience default method returning the key password as
String. Since 1.4.1.Returns the trust store, or
null if none is configured. Since 0.12.0.AS4CryptoFactoryInMemoryKeyStore
Implementation that accepts a pre-loadedKeyStore directly, without reading from a file at runtime.
Class: com.helger.phase4.crypto.AS4CryptoFactoryInMemoryKeyStoreSince 0.9.7.
Constructors
The key store containing the signing/encryption private key and certificate.
The alias of the private key entry in the key store.
The password for the private key entry. May be an empty array for password-less keys.
An optional trust store containing trusted CA certificates. When
null, the JRE default cacerts file is used for trust verification.Methods
Example: load from file
AS4CryptoFactoryConfiguration
ExtendsAS4CryptoFactoryInMemoryKeyStore. Reads key store and trust store configuration from the helger-config IConfigWithFallback. Supports different configuration property prefixes to run multiple crypto contexts.
Class: com.helger.phase4.crypto.AS4CryptoFactoryConfigurationSince 3.0.0.
Static factory methods
Constructors
The configuration source from which key store properties are read.
Configuration property prefix. Must end with a dot. Defaults to
phase4.crypto. (via CAS4Crypto.DEFAULT_CONFIG_PREFIX).Whether to log an error if key store loading fails.
Configuration properties
Using the default prefixphase4.crypto.: