我刚刚阅读了这个伟大的线程,解释了不同的SSL格式。
现在我基本上正在寻找如何拆分PEM文件的相反
有4个文件我想合并,最初为Apache创build,我正在查看指定的文件
我最感兴趣的是合并延期文件的顺序,这很重要吗? 例如。 如果我只是把它们按照它们出现在上面的顺序放在一起,变成一个.pem ,那么它是有效的,还是应该以特定的方式命令?
仅供参考,我这样做是为了在SimpleSAMLphp中使用这些证书作为一个单独的.pem 。
根据RFC 4346 ,命令很重要。
这是直接从RFC中引用的引用:
certificate_list This is a sequence (chain) of X.509v3 certificates. The sender's certificate must come first in the list. Each following certificate must directly certify the one preceding it. Because certificate validation requires that root keys be distributed independently, the self-signed certificate that specifies the root certificate authority may optionally be omitted from the chain, under the assumption that the remote end must already possess it in order to validate it in any case.
根据这些信息,首先应该是服务器证书,其次是任何中间证书,最后是根可信机构证书(如果是自签名的)。 我找不到任何关于私钥的信息,但是我认为这应该不重要,因为pem中的私钥很容易识别,因为它始于下面的文本,其中包含关键字PRIVATE
。
-----BEGIN RSA PRIVATE KEY----- -----END RSA PRIVATE KEY-----
这里是结合使用cat
的命令
cat first_cert.pem second_cert.pem > combined_cert.pem