convert from PEM to DER format or vice versa

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

convert from PEM to DER format or vice versa

Sairam Rangaswamy -X (sairanga - ARICENT TECHNOLOGIES MAURIITIUS
 LIMITED at Cisco)

As I understand, the X509 certificates from CA or self-signed can be created in either

PEM or DER format.

 

Is there a way to programmatically convert the PEM format file to DER or DER to PEM?

Is there a single API or set of APIs available from openssl libraries?

 

Regards,

R. Sairam

Sairam Rangaswamy

Architect

[hidden email] | Mobile +919880302240 | Office +918041068409

  

 

 

 

 


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: convert from PEM to DER format or vice versa

Carl Young-2
Please download the source code and refer to apps/x509.c - this handles the conversion command, such as:

openssl x509 -in xxx.pem -inform pem -out xxx.cer -outform DER

the function you will look for is i2d_X509_bio

On 12 December 2016 at 09:37, Sairam Rangaswamy -X (sairanga - ARICENT TECHNOLOGIES MAURIITIUS LIMITED at Cisco) <[hidden email]> wrote:

As I understand, the X509 certificates from CA or self-signed can be created in either

PEM or DER format.

 

Is there a way to programmatically convert the PEM format file to DER or DER to PEM?

Is there a single API or set of APIs available from openssl libraries?

 

Regards,

R. Sairam

Sairam Rangaswamy

Architect

[hidden email] | Mobile <a href="tel:+91%2098803%2002240" value="+919880302240" target="_blank">+919880302240 | Office <a href="tel:+91%2080%204106%208409" value="+918041068409" target="_blank">+918041068409

  

 

 

 

 


--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users



--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
Reply | Threaded
Open this post in threaded view
|

Re: convert from PEM to DER format or vice versa

Jakob Bohm-7
In reply to this post by Sairam Rangaswamy -X (sairanga - ARICENT TECHNOLOGIES MAURIITIUS LIMITED at Cisco)
On 12/12/2016 10:37, Sairam Rangaswamy -X (sairanga - ARICENT
TECHNOLOGIES MAURIITIUS LIMITED at Cisco) wrote:

>
> As I understand, the X509 certificates from CA or self-signed can be
> created in either
>
> PEM or DER format.
>
> Is there a way to programmatically convert the PEM format file to DER
> or DER to PEM?
>
> Is there a single API or set of APIs available from openssl libraries?
>
>
It's simple Base64 conversion.  The PEM file is the DER file
Base64 encoded and decorated with 4 fixed lines that mark it
as a certificate (two blank lines and two lines with a lot
of dashes).

No need to use the i2d_X509/d2i_X509 functions that convert to and
from an internal OpenSSL data structure

Enjoy

Jakob
--
Jakob Bohm, CIO, Partner, WiseMo A/S.  https://www.wisemo.com
Transformervej 29, 2860 Søborg, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users