There's no-one-size-fits-all strategy to adopting microservices. You need a pragmatic lens through which to judge and apply microservices + FaaS to your technology stack.
See how to encrypt and decrypt stream, byte[], or string using the Asymmetric JCE Cryptography module in Mule 4 taking an API as the reference implementation.