Convert X.509 certificate from hex form to .cer format

前端 未结 2 1000
无人及你
无人及你 2021-01-22 11:04

How to convert X.509 certificate from a hex-dump form to .CER format? Additionally, should be blank space separators removed from hex dump first? Thanks.

2条回答
  •  暖寄归人
    2021-01-22 11:46

    Normally .cer can either be binary encoded - DER - or it can be DER that has an "ASCII armor", called PEM.

    If you want to create DER you probably only have to decode the hexadecimals. In that case you obviously need to disregard any whitespace within the hexadecimals (as well as any other spurious data that may be present).

    If you want to have PEM it is required in addition to base 64 encode the result and add a header and footer text. Or you can use an existing library that does this of course.

提交回复
热议问题