public class JceOperations extends Object
| Constructor and Description |
|---|
JceOperations() |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
jceDecrypt(JceConfiguration config,
InputStream content,
JceEncryptionKeyAlgorithmSelection algorithmSelection,
JceKeySelection keySelection)
Decrypt a stream using JCE, with a key.
|
InputStream |
jceDecryptPbe(InputStream content,
String algorithm,
String password,
String passwordSalt,
Integer iterationCount)
Decrypt a stream using JCE, with a password.
|
InputStream |
jceEncrypt(JceConfiguration config,
InputStream content,
JceEncryptionKeyAlgorithmSelection algorithmSelection,
JceKeySelection keySelection)
Encrypt a stream using JCE, with a key.
|
InputStream |
jceEncryptPbe(InputStream content,
String algorithm,
String password,
String passwordSalt,
Integer iterationCount)
Encrypt a stream using JCE, with a password.
|
String |
jceSign(JceConfiguration config,
InputStream content,
JceSignatureKeyAlgorithm algorithm,
JceKeySelection keySelection)
Sign a stream using JCE, with a key.
|
String |
jceSignPbe(InputStream content,
String algorithm,
String password,
String passwordSalt,
Integer iterationCount)
Sign a stream using JCE, with a key.
|
void |
jceValidate(JceConfiguration config,
InputStream value,
String expected,
JceSignatureKeyAlgorithm algorithm,
JceKeySelection keySelection)
Validate a stream against a signature, using a key.
|
void |
jceValidatePbe(InputStream value,
String expected,
String algorithm,
String password,
String passwordSalt,
Integer iterationCount)
Validate a stream against a signature, using a key.
|
@MediaType(value="application/octet-stream",
strict=false)
@Throws(value={EncryptionErrorTypeProvider.class,ParametersErrorTypeProvider.class})
@Execution(value=CPU_INTENSIVE)
public InputStream jceEncrypt(@Config
JceConfiguration config,
@Content
InputStream content,
@ParameterGroup(name="Algorithm selection")
JceEncryptionKeyAlgorithmSelection algorithmSelection,
@ParameterGroup(name="Key selection")
JceKeySelection keySelection)
config - the JCE configurationcontent - the content to encryptalgorithmSelection - the algorithm, either from a predefined enumeration or custom cipher stringkeySelection - the key used to encrypt@MediaType(value="application/octet-stream",
strict=false)
@Throws(value={DecryptionErrorTypeProvider.class,ParametersErrorTypeProvider.class})
@Execution(value=CPU_INTENSIVE)
public InputStream jceDecrypt(@Config
JceConfiguration config,
@Content
InputStream content,
@ParameterGroup(name="Algorithm selection")
JceEncryptionKeyAlgorithmSelection algorithmSelection,
@ParameterGroup(name="Key selection")
JceKeySelection keySelection)
config - the JCE configurationcontent - the content to decryptalgorithmSelection - the algorithm, either from a predefined enumeration or custom cipher stringkeySelection - the key used to decrypt@MediaType(value="text/plain",
strict=false)
@Throws(value=SignatureErrorTypeProvider.class)
@Execution(value=CPU_INTENSIVE)
public String jceSign(@Config
JceConfiguration config,
@Content
InputStream content,
@Optional(defaultValue="HmacSHA256")
JceSignatureKeyAlgorithm algorithm,
@ParameterGroup(name="Key selection")
JceKeySelection keySelection)
config - the JCE configurationcontent - the content to signalgorithm - the algorithm used for signingkeySelection - the key used to sign@Validator @Throws(value=ValidationErrorTypeProvider.class) @Execution(value=CPU_INTENSIVE) public void jceValidate(@Config JceConfiguration config, @Optional(defaultValue="#[payload]") InputStream value, String expected, @Optional(defaultValue="HmacSHA256") JceSignatureKeyAlgorithm algorithm, @ParameterGroup(name="Key selection") JceKeySelection keySelection)
config - the JCE configurationvalue - the message to authenticateexpected - the signature to validatealgorithm - the algorithm used for signingkeySelection - the key used for signing@MediaType(value="application/octet-stream",
strict=false)
@Throws(value={EncryptionErrorTypeProvider.class,ParametersErrorTypeProvider.class})
@Execution(value=CPU_INTENSIVE)
public InputStream jceEncryptPbe(@Content
InputStream content,
@OfValues(value=PbeEncryptionAlgorithmValueProvider.class) @Optional(defaultValue="PBKDF2withHmacSHA512__AES256__CBC__PKCS5Padding")
String algorithm,
@Password
String password,
@Summary(value="Recommended minimum: 16 bytes of random data to ensure uniqueness and prevent rainbow table attacks. The salt must be encoded in UTF-8 and cannot be modified after creation.")
String passwordSalt,
@Summary(value="Recommended minimum: 100,000 iterations to slow down brute-force attacks in modern hardware.")
Integer iterationCount)
content - the content to encryptalgorithm - the algorithm for generating a key from the passwordpassword - the password for encryptionpasswordSalt - the password salt used to sign. Recommended minimum: 16 bytes of random data to ensure uniqueness and
prevent rainbow table attacks. The salt is encoded in UTF-8 and cannot be modified after creation.iterationCount - the iteration count used to sign. Recommended minimum: 100,000 iterations to slow down brute-force
attacks in modern hardware.@MediaType(value="application/octet-stream",
strict=false)
@Throws(value={DecryptionErrorTypeProvider.class,ParametersErrorTypeProvider.class})
@Execution(value=CPU_INTENSIVE)
public InputStream jceDecryptPbe(@Content
InputStream content,
@OfValues(value=PbeEncryptionAlgorithmValueProvider.class) @Optional(defaultValue="PBKDF2withHmacSHA512__AES256__CBC__PKCS5Padding")
String algorithm,
@Password
String password,
@Summary(value="Recommended minimum: 16 bytes of random data to ensure uniqueness and prevent rainbow table attacks. The salt must be encoded in UTF-8 and cannot be modified after creation.") @Optional
String passwordSalt,
@Summary(value="Recommended minimum: 100,000 iterations to slow down brute-force attacks in modern hardware.") @Optional(defaultValue="0")
Integer iterationCount)
content - the content to decryptalgorithm - the algorithm for generating a key from the passwordpassword - the password for decryptionpasswordSalt - the password salt used to sign. Recommended minimum: 16 bytes of random data to ensure uniqueness and
prevent rainbow table attacks. The salt is encoded in UTF-8 and cannot be modified after creation.iterationCount - the iteration count used to sign. Recommended minimum: 100,000 iterations to slow down brute-force
attacks in modern hardware.@MediaType(value="text/plain",
strict=false)
@Throws(value=SignatureErrorTypeProvider.class)
@Execution(value=CPU_INTENSIVE)
public String jceSignPbe(@Content
InputStream content,
@OfValues(value=PbeSignatureAlgorithmValueProvider.class) @Optional(defaultValue="PBKDF2withHmacSHA512")
String algorithm,
@Password
String password,
@Summary(value="Recommended minimum: 16 bytes of random data to ensure uniqueness and prevent rainbow table attacks. The salt must be encoded in UTF-8 and cannot be modified after creation.")
String passwordSalt,
@Summary(value="Recommended minimum: 100,000 iterations to slow down brute-force attacks in modern hardware.")
Integer iterationCount)
content - the content to signalgorithm - the algorithm used for signingpassword - the password used to signpasswordSalt - the password salt used to sign. Recommended minimum: 16 bytes of random data to ensure uniqueness and
prevent rainbow table attacks. The salt is encoded in UTF-8 and cannot be modified after creation.iterationCount - the iteration count used to sign. Recommended minimum: 100,000 iterations to slow down brute-force
attacks in modern hardware.@Validator @Throws(value=ValidationErrorTypeProvider.class) @Execution(value=CPU_INTENSIVE) public void jceValidatePbe(@Optional(defaultValue="#[payload]") InputStream value, String expected, @OfValues(value=PbeSignatureAlgorithmValueProvider.class) @Optional(defaultValue="PBKDF2withHmacSHA512") String algorithm, @Password String password, @Summary(value="Recommended minimum: 16 bytes of random data to ensure uniqueness and prevent rainbow table attacks. The salt must be encoded in UTF-8 and cannot be modified after creation.") @Optional String passwordSalt, @Summary(value="Recommended minimum: 100,000 iterations to slow down brute-force attacks in modern hardware.") @Optional(defaultValue="0") Integer iterationCount)
value - the message to authenticateexpected - the signature to validatealgorithm - the algorithm used for signingpassword - the password used to signpasswordSalt - the password salt used to sign. Recommended minimum: 16 bytes of random data to ensure uniqueness and
prevent rainbow table attacks. The salt is encoded in UTF-8 and cannot be modified after creation.iterationCount - the iteration count used to sign. Recommended minimum: 100,000 iterations to slow down brute-force
attacks in modern hardware.Copyright © 2025 MuleSoft, Inc.. All rights reserved.