encrypt()
The encrypt
function encrypts the given data
using the given public_key
(see below) and the RSAES-OAEP padding scheme. It returns a Base64-encoded string with the encrypted data.
Example
Public Key Format
Public keys are expected to be supplied in PEM format.
They can be provided as part of an X.509 certificate,
or in PKCS #8 syntax:
For X.509 certificates the -----BEGIN CERTIFICATE-----
and -----END CERTIFICATE-----
boundaries may be omitted. They are required, however, if the certificate is stored together with other data, such as the accompanying private key.
See also
Last updated