有关要签名的 PKCS#10 的证书请求信息
我正在编写一个必须创建 PKCS#10 的代码。为此,我必须签署我的“证书请求信息”,但当我这样做时,应用程序说签名无效。
我使用 OpenSSL.exe 验证 P10,错误是: “ANS1_CHECK_TLEN:标签错误”。我认为我正在签署不应该签署的内容,所以我的问题是,我必须签署的“证书请求信息”的确切格式是什么?
我知道它必须以序列开头,但 p10 规范告诉我们:
“签名过程由两个步骤组成:
- certificationRequestInfo 组件的值是 DER 编码,产生一个八位字节字符串。
- 步骤1的结果与认证请求一起签名 指定签名下的主体私钥 算法,产生一个位串,签名。”
我不确定开始是否必须是一个序列(0x30 0x82“长度> 256”),或者一个八位字节字符串(0x04 0x82“长度> 256”),根据ANS.1。
如果有人给我一个像这篇文章一样的答案,我可能是世界上最幸福的人,非常感谢:
此致,大卫·M.
I'm doing a code that has to create a PKCS#10. To do that, I have to sign my "Certificate Request Info", but when I do, the application says that the signature is invalid.
I'm using the OpenSSL.exe to verify the P10, and the error was:
"ANS1_CHECK_TLEN: wrong tag". I think I'm signing what I shouldn't, so my question is, what's the exact format of "Certificate Request Info" that I have to sign?
I know that it must start with a sequence, but the p10 spec tells:
"The signature process consists of two steps:
- The value of the certificationRequestInfo component is DER
encoded, yielding an octet string. - The result of step 1 is signed with the certification request
subject’s private key under the specified signature
algorithm, yielding a bit string, the signature."
I'm not sure if the start must be a SEQUENCE (0x30 0x82 "the length>256"), or A OCTET STRING (0x04 0x82 "the length>256"), acording to ANS.1.
If someone please give me an answer like on this post, i could be the happiest man on the world. Thank very much:
PKCS#10 request for a object key pair from PKCS#11
REgards, David M.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
PKCS#10 标准的步骤 #1 讨论了作为
certificationRequestInfo
元素编码结果的八位字节字符串,并且不引用 ASN.1 类型。请求签名是在此 DER 编码上计算的,因此待签名对象是 ASN.1SEQUENCE
而不是OCTET STRING
>。The step #1 of the PKCS#10 standard talks about an octet string as the result of the
certificationRequestInfo
element encoding and does not refer to an ASN.1 type. The request signature is computed on this DER-encoding and therefore the to-be-signed object is an ASN.1SEQUENCE
and not anOCTET STRING
.