If you load it into cryptography you can serialize to DER using the 
public_bytes method using the appropriate encoding. You can see the docs for 
this method here: 
https://cryptography.io/en/latest/x509/reference/#cryptography.x509.Certificate.public_bytes

-Paul (reaperhulk)

> On Apr 8, 2020, at 7:00 AM, Sawyer Liu <sawyer....@nxp.com> wrote:
> 
> 
> Hello,
>        I want to know how I can convert PEM file of X509 to DER file. Thanks.
>  
> Best Regards
> Sawyer Liu(刘维峰)
>  
> Microcontrollers, NXP Semiconductors
> 23/F, Exchange Building, No.118 Jianguo Road, Chaoyang District, Beijing, 
> P.R.C 100022
> 中国北京市朝阳区建国路乙118号京汇大厦23层   邮编:100022
> Tel: 86-10-58798328, Fax: 86-10-58798010, Mobile: 86-1800 112 6984
> E-mail: sawyer....@nxp.com
>  
> _______________________________________________
> Cryptography-dev mailing list
> Cryptography-dev@python.org
> https://mail.python.org/mailman/listinfo/cryptography-dev
_______________________________________________
Cryptography-dev mailing list
Cryptography-dev@python.org
https://mail.python.org/mailman/listinfo/cryptography-dev

Reply via email to