How to encrypt with both the private key and public key : <p>I have this bash script</p>

<pre><code>#generate key
openssl genrsa -out key.pem 2048
openssl rsa -in key.pem -text -noout
#save public key in pub.pem file
openssl rsa -in key.pem -pubout -out pub.pem
openssl rsa -in pub.pem -pubin -text -nout
#encrypt data
openssl rsautl -encrypt -inkey pub.pem -pubin -in license.json -out license_encrypted.json
#decrypt data
openssl rsautl -decrypt -inkey key.pem -in license_encrypted.json
</code></pre>

<p>In the code you can see I encrypt the file using the public key and decrypt using the private key, I need to know how to encrypt using both the private key and the public key. Is this possible. Should I decrypt using the private key or can idecrypt using the public key, this is in regards to software licenses I am trying to encrypt</p>
