Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Code snippets referenced from Ricston's blogpost entitled "Anypoint Enterprise Security features in Mule 4"
<crypto:pgp-config name="decrypt-pgp-conf" privateKeyring="pgp/privateKeyServer.gpg">
<crypto:pgp-key-infos>
<crypto:pgp-asymmetric-key-info
keyId="${pgp.privateKeyServer.keyId}"
fingerprint="${pgp.privateKeyServer.fingerprint}"
passphrase="${secure::pgp.privateKeyServer.passphrase}" />
</crypto:pgp-key-infos>
</crypto:pgp-config>
<crypto:pgp-decrypt doc:name="Pgp decrypt" config-ref="decrypt-pgp-conf" target="decryptedMessage">
<crypto:content><![CDATA[#[vars.message]]]></crypto:content>
</crypto:pgp-decrypt>
<crypto:pgp-config name="encrypt-pgp-conf" publicKeyring="pgp/publicKeyServer.gpg">
<crypto:pgp-key-infos>
<crypto:pgp-asymmetric-key-info
keyId="${pgp.publicKeyServer.keyId}"
fingerprint="${pgp.publicKeyServer.fingerprint}"/>
</crypto:pgp-key-infos>
</crypto:pgp-config>
<crypto:pgp-encrypt doc:name="Pgp encrypt" config-ref="encrypt-pgp-conf"
keyId="${pgp.publicKeyServer.keyId}"
target="encryptedMessage">
<crypto:content><![CDATA[#[payload.message]]]></crypto:content>
</crypto:pgp-encrypt>
<secure-properties:config name="Secure_Properties_Config" doc:name="Secure Properties Config"
file="config/configuration.yaml" key="${client.secure.properties.key}" />
<crypto:pgp-config name="sign-pgp-conf" privateKeyring="pgp/privateKeyClient.gpg">
<crypto:pgp-key-infos>
<crypto:pgp-asymmetric-key-info
keyId="${pgp.privateKeyClient.keyId}"
fingerprint="${pgp.privateKeyClient.fingerprint}"
passphrase="${secure::pgp.privateKeyClient.passphrase}" />
</crypto:pgp-key-infos>
</crypto:pgp-config>
<crypto:pgp-sign doc:name="Pgp sign" config-ref="sign-pgp-conf"
keyId="${pgp.privateKeyClient.keyId}"
target="signature">
<crypto:content><![CDATA[#[payload.message]]]></crypto:content>
</crypto:pgp-sign>
<crypto:pgp-config name="validate-pgp-conf" publicKeyring="pgp/publicKeyClient.gpg">
<crypto:pgp-key-infos>
<crypto:pgp-asymmetric-key-info
keyId="${pgp.publicKeyClient.keyId}"
fingerprint="${pgp.publicKeyClient.fingerprint}"/>
</crypto:pgp-key-infos>
</crypto:pgp-config>
<crypto:pgp-validate doc:name="Pgp validate" config-ref="validate-pgp-conf"
expected="#[vars.signature]"
value="#[vars.decryptedMessage]" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.