首页 > 其他分享 >How to convert a certificate into the appropriate format

How to convert a certificate into the appropriate format

时间:2024-09-25 14:22:55浏览次数:13  
标签:convert certificatename certificate format Convert openssl PEM out

Solution

If your server/device requires a different certificate format other than Base64 encoded X.509, a third party tool such as OpenSSL can be used to convert the certificates into the appropriate format.

For information on OpenSSL please visit: www.openssl.org

Note: OpenSSL is an open source tool that is not provided or supported by Thawte

Some common conversion commands are listed below:

Note: The PEM format is the most common format used for certificates. Extensions used for PEM certificates are cer, crt, and pem. They are Base64 encoded ASCII files. The DER format is the binary form of the certificate. DER formatted certificates do not contain the "BEGIN CERTIFICATE/END CERTIFICATE" statements. DER formatted certificates most often use the '.der' extension.
Convert x509 to PEM

openssl x509 -in certificatename.cer -outform PEM -out certificatename.pem

Convert PEM to DER

openssl x509 -outform der -in certificatename.pem -out certificatename.der

Convert DER to PEM

openssl x509 -inform der -in certificatename.der -out certificatename.pem

Convert PEM to P7B

Note: The PKCS#7 or P7B format is stored in Base64 ASCII format and has a file extension of .p7b or .p7c.
A P7B file only contains certificates and chain certificates (Intermediate CAs), not the private key. The most common platforms that support P7B files are Microsoft Windows and Java Tomcat.

openssl crl2pkcs7 -nocrl -certfile certificatename.pem -out certificatename.p7b -certfile CACert.cer

Convert PKCS7 to PEM

openssl pkcs7 -print_certs -in certificatename.p7b -out certificatename.pem

Convert pfx to PEM
Note: The PKCS#12 or PFX format is a binary format for storing the server certificate, intermediate certificates, and the private key in one encryptable file. PFX files usually have extensions such as .pfx and .p12. PFX files are typically used on Windows machines to import and export certificates and private keys.

openssl pkcs12 -in certificatename.pfx -out certificatename.pem

Convert PFX to PKCS#8
Note: This requires 2 commands

STEP 1: Convert PFX to PEM

openssl pkcs12 -in certificatename.pfx -nocerts -nodes -out certificatename.pem

STEP 2: Convert PEM to PKCS8

openSSL pkcs8 -in certificatename.pem -topk8 -nocrypt -out certificatename.pk8

Convert P7B to PFX
Note: This requires 2 commands

STEP 1: Convert P7B to CER

openssl pkcs7 -print_certs -in certificatename.p7b -out certificatename.cer

STEP 2: Convert CER and Private Key to PFX

openssl pkcs12 -export -in certificatename.cer -inkey privateKey.key -out certificatename.pfx -certfile  cacert.cer

 

《From: How to convert a certificate into the appropriate format (digicert.com)

标签:convert,certificatename,certificate,format,Convert,openssl,PEM,out
From: https://www.cnblogs.com/rusking/p/18431293

相关文章

  • DATA1002 / 1902 - Informatics: Data and Computation
    DATA1002/1902-Informatics:DataandComputation2024Sem2GroupProjectStage2THEPROJECTWORKFORSTAGE2:Task            Description           Group/individual            Details1 ......
  • FormatConvertedBitmap DestinationFormat Gray32Float BlackWhite
     <Windowx:Class="WpfApp410.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.micros......
  • OpenCV(cv::convertScaleAbs())
    目录1.函数定义2.原理3.示例4.参数作用详解4.1alpha的作用4.2beta的作用5.应用场景6.cv::convertScaleAbs()与cv::normalize()的区别总结cv::convertScaleAbs()是OpenCV中用于将图像像素值缩放并转换为8位无符号整数类型的函数。它常用于处理计算结果为浮点......
  • system.text.Json 针对继承多态类型的集合,使用自定义Converter,进行json序列化
    测试类:[JsonConverter(typeof(PersonConverter))]publicclassPerson{publicstringFirstName{get;set;}publicstringLastName{get;set;}}[JsonConverter(typeof(PersonConverter))]publicclassEmployee:Person{pub......
  • 使用 SAP BTP Document Information Extraction 服务,处理老师发到家长群里的成绩单
    笔者之前的文章提到,老师会把班上周考的成绩单,发送到家长群里。成绩单包含了每位同学的学号和分数。成绩单的格式为图片即png或者jpg格式。开学已经一个月了,老师把最近考试成绩发到了微信群里,我用ChatGPT简单分析一下我用ChatGPT识别这些图片,把里面的信息提取出来,......
  • scConverter 转换 SDK 2024 Crack
    scConverter转换SDKPDF、DWF、TIFF、CALS、PLT、Gerber和CGM的转换SDKscConverter ™可以将PDF、DWF、Gerber、CGM、TIFF、CALS、PLT、PNG和JPEG文件转换为多种输出格式。可用的输出格式列表包括Adob​​e PDF、PDF/A、DXF、DWF、CALS、TIFF、PLT和PNG。您将在......
  • -bash: ./blade: cannot execute binary file: Exec format error
    在执行程序时报错[[email protected]]#./bladeversion-bash:./blade:cannotexecutebinaryfile:Execformaterror判断系统架构是arch还是x86的,x86的包不能在aarch64执行,所以报错#查看系统架构类型arch#查看系统架构类型或uanme-a由于chaosblade不支持ARM平......
  • 如何解决"Warning: Cannot modify header information - headers already sent"问题
    解决方法检查早期输出确保脚本在发送任何HTTP头前没有进行任何输出,包括空格、换行符或字符串。使用输出缓冲控制函数在脚本开始处使用ob_start()来启动输出缓冲。在需要发送HTTP头之前,确保输出缓冲已经被适当管理,例如使用ob_end_flush()来结束并输出缓冲内容。清......
  • WPF Element Width Height is percent of Parent element via converter ,converterpa
    //converterusingSystem;usingSystem.Collections.Generic;usingSystem.Globalization;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Windows.Data;namespaceWpfApp380{publicclassSizeConverter:IValueConverter......
  • FIT5137  MStay account Transformation Stage
    FIT5137Assignment2-S22024 (Weight=40%)Due-Friday,20September2024,4:30PMGeneralInformationandSubmissiono Thisisanindividualassignment.o Submissionmethod:SubmissionisonlinethroughMoodle.o Penaltyforlatesubmission:5%deduc......