The PEM format string containing the public key.
An RSAPublicKey object that can be used to encrypt data.
import { importPublicKey, sha256 } from 'rsa-oaep-encryption';
const PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA...
-----END PUBLIC KEY-----`;
const publicKey = importPublicKey(PUBLIC_KEY);
const encrypted = publicKey.encrypt('Hello, World!', sha256.create());
Import a RSA public key from a PEM format string.