You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a RSA private key generated with OpenSSL in PKCS#8 format.
I know I can load the key using from the PEM string with KEYUTIL.getKey(pemString), but I'd like to load it from a hex string using KEYUTIL.getKey(hexString, null, "pkcs5prv");
Does anyone know how to convert the PEM file to a hex string?
I've tried changing the headers -----BEGIN PRIVATE KEY----- to -----BEGIN RSA PRIVATE KEY-----, etc. and then generate the string with:
xxd -p private-key.pem | tr -d '\n'
but the generated hex string it's not valid for jsrasign (Error: unsupported PKCS#1/5 hexadecimal key).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I have a RSA private key generated with OpenSSL in PKCS#8 format.
I know I can load the key using from the PEM string with
KEYUTIL.getKey(pemString)
, but I'd like to load it from a hex string usingKEYUTIL.getKey(hexString, null, "pkcs5prv");
Does anyone know how to convert the PEM file to a hex string?
I've tried changing the headers
-----BEGIN PRIVATE KEY-----
to-----BEGIN RSA PRIVATE KEY-----
, etc. and then generate the string with:but the generated hex string it's not valid for jsrasign (
Error: unsupported PKCS#1/5 hexadecimal key
).Thank you.
Beta Was this translation helpful? Give feedback.
All reactions