i received the following from some legacy system when i asked for private key: MODULUS, PUBLIC EXP, PRIVATE EXP, PRIME_P, PRIME_Q, PARAM_P, PARAM_Q, Q_MOD_INV
All of this data is in hex, how can i convert this to a openssl PEM file or PFX ?
Thank you and best regards!
Generate RSA key with openssl:
Convert RSA key from PEM format to DER format:
Open file rsa.der in ASN.1 Editor:
ASN.1 structure of RSA private key is defined in PKCS#1 (RFC 3447):
Edit required fields in ASN.1 Editor (right click the item and choose "Edit in hex mode") and paste your data following this mapping:
Edit based on the comments: Individual parts of the private key are big integers. When the leftmost bit of the value is 1 (or leftmost byte equals or is bigger than 0x80) then 0x00 byte needs to be preppended to the value to indicate it is positive number.
Finally save the modified file and convert it from DER format to PEM format with openssl: