Easy way:
<?php
$publicKey = "file://path/to/public/key-crt.pem";
$plaintext = "String to encrypt";
openssl_public_encrypt($plaintext, $encrypted, $publicKey);
echo $encrypted; //encrypted string
?>
Easy way:
<?php
$publicKey = "file://path/to/public/key-crt.pem";
$plaintext = "String to encrypt";
openssl_public_encrypt($plaintext, $encrypted, $publicKey);
echo $encrypted; //encrypted string
?>