title: OpenSSL - Encrypt plain text using RSAES_OAEP_SHA_256
body: <p>I want to encrypt local plain text file using openssl and RSAES_OAEP_SHA_256 algorithm.
  I tried to use the same approach with this blog entry but it did not work.
  <a href="https://europatech.co.uk/encryption-decryption-with-kms-and-openssl/" rel="nofollow noreferrer">https://europatech.co.uk/encryption-decryption-with-kms-and-openssl/</a></p>
  <pre><code>$ echo &quot;hello&quot; &gt; plaintext.txt
  $ openssl pkeyutl -encrypt -pkeyopt rsa_padding_mode:oaep -pkeyopt rsa_oaep_md:sha256 \
    -in plaintext.txt -pubin -inkey pubkey.pem -out plaintext.bin
  -pkeyopt command before -inkey
  Usage: pkeyutl [options]
  -in file        input file
  -out file       output file
  -sigfile file signature file (verify operation only)
  -inkey file     input key
  -keyform arg    private key format - default PEM
  -pubin          input is a public key
  -certin         input is a certificate carrying a public key
  -pkeyopt X:Y    public key options
  -sign           sign with private key
  -verify         verify with public key
  -verifyrecover  verify with public key, recover original data
  -encrypt        encrypt with public key
  -decrypt        decrypt with private key
  -derive         derive shared secret
  -hexdump        hex dump output
  -passin arg     pass phrase source
  </code></pre>
  <p>am I missing something?</p>