public class PgpOperations extends Object
| 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)
Decrypt a stream using PGP, giving the original data as a result.
|
InputStream |
pgpEncrypt(PgpConfiguration config,
InputStream content,
PgpEncryptionAlgorithm algorithm,
String fileName,
PgpKeySelection keySelection)
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)
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.
|
@MediaType(value="text/plain") @Throws(value=EncryptionErrorTypeProvider.class) 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)
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=EncryptionErrorTypeProvider.class)
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)
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)
public InputStream pgpDecrypt(@Config
PgpConfiguration config,
@Content @Optional(defaultValue="#[payload]")
InputStream content,
@Optional
String fileName)
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) 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)
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) 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) public InputStream pgpBinaryToArmored(@Content InputStream content)
content - the content to convertCopyright © 2019 MuleSoft, Inc.. All rights reserved.