public class PgpOperations extends Object implements org.mule.runtime.api.lifecycle.Startable, org.mule.runtime.api.lifecycle.Stoppable
| Constructor and Description |
|---|
PgpOperations() |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
pgpBinaryToArmored(InputStream content)
Converts an encrypted PGP message or a PGP signature to an ASCII armored representation, suitable for plain text channels.
|
InputStream |
pgpDecrypt(PgpConfiguration config,
InputStream content,
String fileName,
boolean validateIfSignatureFound)
Decrypt a stream using PGP, giving the original data as a result.
|
InputStream |
pgpEncrypt(PgpConfiguration config,
InputStream content,
PgpEncryptionAlgorithm algorithm,
String fileName,
PgpKeySelection keySelection,
boolean disableMDC)
Encrypt a stream using PGP, giving an ASCII-armored stream output as a result.
|
InputStream |
pgpEncryptAndSign(PgpConfiguration config,
InputStream content,
PgpEncryptionAlgorithm algorithm,
String fileName,
PgpKeySelection encryptionKeySelection,
PgpKeySelection signKeySelection,
boolean disableMDC)
Encrypt a stream using PGP, giving an ASCII-armored stream output as a result.
|
InputStream |
pgpEncryptBinary(PgpConfiguration config,
InputStream content,
PgpEncryptionAlgorithm algorithm,
String fileName,
PgpKeySelection keySelection,
boolean disableMDC)
Encrypt a stream using PGP, giving a binary output as a result.
|
InputStream |
pgpSign(PgpConfiguration config,
InputStream content,
PgpSignatureAlgorithm algorithm,
PgpKeySelection keySelection)
Create a detached (standalone) PGP signature of the stream.
|
InputStream |
pgpSignBinary(PgpConfiguration config,
InputStream content,
PgpSignatureAlgorithm algorithm,
PgpKeySelection keySelection)
Create a detached (standalone) PGP signature of the stream.
|
void |
pgpValidate(PgpConfiguration config,
InputStream value,
InputStream expected)
Validate a PGP signature against a stream, to authenticate it.
|
void |
start() |
void |
stop() |
@MediaType(value="text/plain") @Throws(value=EncryptionErrorTypeProvider.class) @Execution(value=CPU_INTENSIVE) public InputStream pgpEncrypt(@Config PgpConfiguration config, @Content InputStream content, @Optional(defaultValue="AES_256") PgpEncryptionAlgorithm algorithm, @Optional(defaultValue="stream") String fileName, @ParameterGroup(name="Key selection") PgpKeySelection keySelection, @Summary(value="If set, MDC (modification detection code) will not be used during encryption") @Optional(defaultValue="false") boolean disableMDC)
config - the PGP configurationcontent - the content to encryptalgorithm - the symmetric algorithm to use for encryptionfileName - the internal file name to use in the resulting PGP headerkeySelection - the key used to encrypt the message@Summary(value="Performs an atomic encrypt and sign over a given payload. This lets an encrypted message carry a integrity check (the signature) over its contents.") @MediaType(value="text/plain") @Throws(value=EncryptionErrorTypeProvider.class) @Execution(value=CPU_INTENSIVE) public InputStream pgpEncryptAndSign(@Config PgpConfiguration config, @Content InputStream content, @Optional(defaultValue="AES_256") PgpEncryptionAlgorithm algorithm, @Optional(defaultValue="stream") String fileName, @Summary(value="The recipients public key that will be used to encrypt the message") PgpKeySelection encryptionKeySelection, @Summary(value="The senders private key that will be used to sign the message") PgpKeySelection signKeySelection, @Summary(value="If set, MDC (modification detection code) will not be used during encryption") @Optional(defaultValue="false") boolean disableMDC)
config - the PGP configurationcontent - the content to encryptalgorithm - the symmetric algorithm to use for encryptionfileName - the internal file name to use in the resulting PGP headerencryptionKeySelection - the key used to encrypt the messagesignKeySelection - the key used to sign the message@MediaType(value="application/octet-stream",
strict=false)
@Throws(value=EncryptionErrorTypeProvider.class)
@Execution(value=CPU_INTENSIVE)
public InputStream pgpEncryptBinary(@Config
PgpConfiguration config,
@Content
InputStream content,
@Optional(defaultValue="AES_256")
PgpEncryptionAlgorithm algorithm,
@Optional(defaultValue="stream")
String fileName,
@ParameterGroup(name="Key selection")
PgpKeySelection keySelection,
@Summary(value="If set, MDC (modification detection code) will not be used during encryption") @Optional(defaultValue="false")
boolean disableMDC)
config - the PGP configurationcontent - the content to encryptalgorithm - the symmetric algorithm to use for encryptionfileName - the internal file name to use in the resulting PGP headerkeySelection - the key used to encrypt the message@MediaType(value="application/octet-stream",
strict=false)
@Throws(value=DecryptionErrorTypeProvider.class)
@Execution(value=CPU_INTENSIVE)
public InputStream pgpDecrypt(@Config
PgpConfiguration config,
@Content @Optional(defaultValue="#[payload]")
InputStream content,
@Optional
String fileName,
@Optional(defaultValue="false") @Summary(value="If the message being decrypted contains a signature, choose whether or not to validate the decrypted message against it")
boolean validateIfSignatureFound)
config - the PGP configurationcontent - the content to decryptfileName - the internal file name to decrypt, if not present the first will be used@MediaType(value="text/plain") @Throws(value=SignatureErrorTypeProvider.class) @Execution(value=CPU_INTENSIVE) public InputStream pgpSign(@Config PgpConfiguration config, @Content InputStream content, @Optional(defaultValue="SHA256") PgpSignatureAlgorithm algorithm, @ParameterGroup(name="Key selection") PgpKeySelection keySelection)
config - the PGP configurationcontent - the content to signalgorithm - the digest (or hashing) algorithmkeySelection - the key used to sign the data@MediaType(value="application/octet-stream",
strict=false)
@Throws(value=SignatureErrorTypeProvider.class)
@Execution(value=CPU_INTENSIVE)
public InputStream pgpSignBinary(@Config
PgpConfiguration config,
@Content
InputStream content,
@Optional(defaultValue="SHA256")
PgpSignatureAlgorithm algorithm,
@ParameterGroup(name="Key selection")
PgpKeySelection keySelection)
config - the PGP configurationcontent - the content to signalgorithm - the digest (or hashing) algorithmkeySelection - the key used to sign the data@Validator @Throws(value=ValidationErrorTypeProvider.class) @Execution(value=CPU_INTENSIVE) public void pgpValidate(@Config PgpConfiguration config, @Optional(defaultValue="#[payload]") InputStream value, InputStream expected)
config - the PGP configurationvalue - the message to authenticateexpected - the signature@MediaType(value="text/plain") @Throws(value=ParametersErrorTypeProvider.class) @Execution(value=CPU_INTENSIVE) public InputStream pgpBinaryToArmored(@Content InputStream content)
content - the content to convertpublic void start()
throws org.mule.runtime.api.exception.MuleException
start in interface org.mule.runtime.api.lifecycle.Startableorg.mule.runtime.api.exception.MuleExceptionpublic void stop()
throws org.mule.runtime.api.exception.MuleException
stop in interface org.mule.runtime.api.lifecycle.Stoppableorg.mule.runtime.api.exception.MuleExceptionCopyright © 2025 MuleSoft, Inc.. All rights reserved.