We created a RSA key pair using ICSF in Mainframes. The public key generated in hex format is of size 580 chars and the structure is split into
Prefix - 18 char (9 bytes) - 3082010A0282010100
Public modulus - 512 char(256 bytes) AA5DA28FEDADE7FEAD8C610E4C16E54FD415FEA173518BD9ADC3C7EB332E86E973B7F6E9BF90F277FD4B6A15E736C566857AA58F8C5415E1F606DBF74FAFCBCAE99A4E77AF7F4958E163E2159C6083826D203AD75685A53AFBC7221CDEF23FA68CE41270A1756AC5814A09713A7EB941CD61055143C37FC7AF1E0E6F1539CEEA49F331A0BEC0453F6B6A47A37F66EDDF5F308AED5E5172CD8768CF43CD024E7988905B0C22CAA888E3162E74E93FC292EB905EA050E2DC503AB92E9FE3C6CDACFCDE0D243A40F7E1578E097D65D7848387D1A33374AF93EEF3906B6CB07E5160BF5927E9B49FA68BE27D86AAFCD81EA12E83194BBD1CDEB5E52EB96DD63D0CA9
Exponent - 10 char(5 bytes) - 0203010001
SHA1 hash - 40 char(20 bytes) - CDC0B4A4253110D6E4A15DF536257A7B89B4231D
We have to create a RSA key pair and the public key has to be in the same format as above. We tried this using openssl, but the public key created is in different format.
- Generate key pair $openssl genrsa -out priv1.key 2048
- Extract the public key in pem format $openssl rsa -in priv1.key -text > priv1.pem
- Convert the base64 pem to hex.
What is this format called? With openssl, how can we generate rsa key pair so that the public key is in the above format?