0

I have a EC 192 bit key which is in raw format for ex: UHWo9mjrEqDeng4wWTtEgpAUJnvoMzD0ZLMA8Rd777o=

however in order to import this to an HSM i have to convert it to DER-encoded key. Is there a way i can achieve this?

Thank you in advance.

Zach
  • 35
  • 6
  • 1
    Public key or private key? DER encoding of which format? – President James K. Polk Jul 08 '21 at 18:21
  • That example shows 32 bytes. That seems strange for a 192 bit EC key. It would be relatively easy if you have an ASN.1 encoder library. Of course, that means programming, not using the command line interface. OTOH, this **is** [so]. – Maarten Bodewes Jul 08 '21 at 21:46
  • @PresidentJamesK.Polk sorry i should have mentioned, its a EC private key – Zach Jul 09 '21 at 17:51
  • @MaartenBodewes its 24 bytes, two chars representing a single byte, so we do not have a regular way i can use apart from programming, like using openssl or any other utility? – Zach Jul 09 '21 at 17:53
  • Nope, I agree with @MaartenBodewes, it's 32 bytes *after* it is base64 decoded. That would suggest it is a private key for one of the 256-bit curves. – President James K. Polk Jul 09 '21 at 18:36
  • I must be wrong here then, apologies. How would i convert it to base64 encoded? – Zach Jul 09 '21 at 18:51

0 Answers0