com.helger.phase4.cryptoMaven artifact:
com.helger.phase4:phase4-lib
AS4CryptParams holds all parameters required to encrypt an outgoing AS4 message or to decrypt an incoming message.
Default values
| Constant | Value | Description |
|---|---|---|
DEFAULT_KEY_IDENTIFIER_TYPE | BST_DIRECT_REFERENCE | Key identifier type |
DEFAULT_KEY_ENCRYPTION_ALGORITHM | RSA_OAEP_XENC11 | Key transport algorithm |
DEFAULT_MGF_ALGORITHM | SHA-256 | MGF algorithm for RSA-OAEP |
DEFAULT_DIGEST_ALGORITHM | SHA-256 | Digest algorithm for RSA-OAEP |
DEFAULT_SESSION_KEY_PROVIDER | Random AES-128 | Session key provider |
DEFAULT_ENCRYPT_SYMMETRIC_SESSION_KEY | true | Include encrypted session key |
Setter methods
How the recipient certificate is identified in the encrypted message. Default:
BST_DIRECT_REFERENCE. Since 0.11.0.The symmetric encryption algorithm. Mandatory to enable encryption. Set to
null to disable.The key transport/wrapping algorithm. Default:
RSA_OAEP_XENC11.The Mask Generation Function (MGF) algorithm used with RSA-OAEP. Default:
SHA-256.The digest algorithm used with RSA-OAEP. Default:
SHA-256.Key agreement method (e.g.
X25519, ECDH_ES). When set, key agreement is used instead of key transport. null means key transport. Since 4.4.0.Key derivation function for use with key agreement (e.g.
HKDF, ConcatKDF). Since 4.4.0.Key wrap algorithm for use with key agreement (e.g.
AES_128). Since 4.4.0.The recipient X.509 certificate for encryption. Overrides
setAlias. If expired, a warning is logged but the certificate is still used.Keystore alias for the recipient certificate. Overrides
setCertificate.Provider for the symmetric session key. Defaults to random AES-128. Since 2.1.2.
Sets the same
java.security.Provider for both encryption and decryption. Since 2.1.4.JCA/JCE provider for encryption only. Since 2.4.0.
JCA/JCE provider for decryption only. Since 2.4.0.
Whether to include the encrypted session key in the transmission. Since 2.1.4.
Low-level customizer for WSS4J
WSSecEncrypt objects.Convenience methods
isCryptEnabled
true only when an algorithm is set and at least one of certificate or alias is configured.
Static factory
ECryptoAlgorithmCrypt
Symmetric encryption algorithms supported by phase4.| Enum value | ID | Algorithm URI | Notes |
|---|---|---|---|
CRYPT_3DES | 3des | Triple-DES CBC | Legacy |
AES_128_CBC | aes128-cbc | AES-128 CBC | |
AES_128_GCM | aes128-gcm | AES-128 GCM | Default |
AES_192_CBC | aes192-cbc | AES-192 CBC | |
AES_192_GCM | aes192-gcm | AES-192 GCM | |
AES_256_CBC | aes256-cbc | AES-256 CBC | |
AES_256_GCM | aes256-gcm | AES-256 GCM |