有关要签名的 PKCS#10 的证书请求信息

发布于 2024-11-16 17:32:19 字数 656 浏览 9 评论 0原文

我正在编写一个必须创建 PKCS#10 的代码。为此,我必须签署我的“证书请求信息”,但当我这样做时,应用程序说签名无效。

我使用 OpenSSL.exe 验证 P10,错误是: “ANS1_CHECK_TLEN:标签错误”。我认为我正在签署不应该签署的内容,所以我的问题是,我必须签署的“证书请求信息”的确切格式是什么?

我知道它必须以序列开头,但 p10 规范告诉我们:

“签名过程由两个步骤组成:

  1. certificationRequestInfo 组件的值是 DER 编码,产生一个八位字节字符串。
  2. 步骤1的结果与认证请求一起签名 指定签名下的主体私钥 算法,产生一个位串,签名。”

我不确定开始是否必须是一个序列(0x30 0x82“长度> 256”),或者一个八位字节字符串(0x04 0x82“长度> 256”),根据ANS.1。

如果有人给我一个像这篇文章一样的答案,我可能是世界上最幸福的人,非常感谢:

PKCS#10 请求来自 PKCS#11 的对象密钥对

此致,大卫·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:

  1. The value of the certificationRequestInfo component is DER
    encoded, yielding an octet string.
  2. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

审判长 2024-11-23 17:32:19

PKCS#10 标准的步骤 #1 讨论了作为 certificationRequestInfo 元素编码结果的八位字节字符串,并且不引用 ASN.1 类型。请求签名是在此 DER 编码上计算的,因此待签名对象是 ASN.1 SEQUENCE 而不是 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.1 SEQUENCE and not an OCTET STRING.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文