To generate the pbulic RS code in the PEM format to be used with openssl, you can follow these steps.
Create ASN1 Definition File
,
asn1=SEQUENCE:pubkeyinfo
[pubkeyinfo]
algorithm=SEQUENCE:rsa_alg
pubkey=BITWRAP,SEQUENCE:rsapubkey
[rsa_alg]
algorithm=OID:rsaEncryption
parameter=NULL
[rsapubkey]
n=INTEGER:0x%%MODULUS%%
e=INTEGER:0x%%EXPONENT%%
script sed
sed -i "s/%%MODULUS%%/$(xxd -ps -c 256 mymodulus.bin)/" def.asn1
, -c 256 .
.
RSA
openssl. RSA DER.
openssl asn1parse -genconf def.asn1 -out pubkey.der -noout
PEM
openssl rsa -in pubkey.der -inform der -pubin -out pubkey.pem
openssl dgst -verify, openssl rsautl -verify