签名证书和加密证书有什么区别?

发布于 2024-08-04 23:16:15 字数 88 浏览 6 评论 0原文

签名证书和加密证书有什么区别?

我发现签名证书不能用于加密仅数据加密证书。技术上有什么区别?两者都有公钥和私钥还是只有加密证书才会有 PP 密钥?

What is the difference between between signing certificate and encryption certificate?

I see that signing certificate cannot be used for encrypting the data only encryption certificate. What is the technical difference? Does both have public key and private or only encryption cert will have PP key?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(4

回眸一笑 2024-08-11 23:16:15

即使这是一个旧线程,我一直在努力解决这些证书、加密/解密概念,对此我要花两分,简短的一点:

  • 签名证书和加密证书使用不同的证书方案,以及主要区别(对我来说)是:签名证书将私钥设置为加密密钥,将公钥设置为解密密钥,其中加密证书完全相反。

长的一个:

  • 两个证书都使用非对称加密算法,它有两个密钥,一个用于加密消息,另一个用于解密消息,我不认为加密/解密密钥可以双向使用,这意味着给定一对两个密钥,只有一个可以用作加密密钥,另一个可以用作加密密钥。
  • 签名过程:首先使用哈希算法计算出消息哈希,然后使用签名者的证书私钥加密该哈希,并将消息+加密后的哈希+签名者的证书(包括公钥)放在一起,然后发送出去,之后加密的哈希值可以使用签名者的证书公钥来解密
  • 加密过程:通常发送方使用接收方证书的公钥对消息进行加密,当消息收到时,接收方使用其证书私钥对消息进行解密。
  • 签名过程通常不针对特定端点,它可以自我证明,并发送到任何地方,其中加密过程通常有两个端点,它们使用彼此的公钥来加密数据以进行通信......

Even this is an old thread, I've just been struggling with those certificate,encryt/decrypt concepts, put two my cents on this, the short one:

  • Signing Certificate and Encyption Certificate use different certifiate scheme, and main difference (to me)is: Signing Certificate set private key as encyption key and public key as decryption key, where encryption certicate totally in opposite.

The long one:

  • Both the certificates use Asymmetric encryption algorithm, which have two keys, the one used to encypt the message and the another to decypt the message, and I don't think the encyption/dectytion key can be used in dual-direction, which means given a pair of two keys, there is and only one can be used as encyption key and another used as dectyption key.
  • Signing process: firstly use hash algorithm to calculate a message hash, and then use Signer's certificate private key to encypt the hash, and put the message + encypted hash + Signer's certifiate(include public key) togother, then send out the world, later the encypted hash can use signer's certificate public key to decrypt.
  • Encytion process: usually the sender shall use receiver's certificate's public key to encypt the message, and when the message received, the receiver uses its certificate private key to decypt the message.
  • Signing process typically not toward a specific endpoint, it can be self-proven, and be sent anywhere, where the encyption process usually has two endpoints, they use each other's public key to encyt the data for comunicating...
半世晨晓 2024-08-11 23:16:15

唯一的区别是证书中目的字段的值。证书的颁发者选择创建证书的目的。

The only difference is the value of the purpose field in the certificate. The issuer of the certificate chooses for what purpose the certificate is created.

撑一把青伞 2024-08-11 23:16:15

证书仅包含公共证书。没有什么可以阻止您使用私有密钥来做任何您想做的事情。

如前所述,证书是供另一方处理的 - 在您签署或加密某些内容后,另一方需要做出是否满意的决定。然后,它检查证书及其标志,以确保它可以根据为另一方设置的策略用于操作。

A certificate contains only the public certificate. Nothing can stop you from using the private key for whatever things you want to do with it.

As said before, a certificate is for the other party to deal with - after you have signed or encrypted something, the other party needs to make the decision if it is happy with it. It then checks the certificate and its flags to make sure it could be used for the operation, under the policy set for the other party.

笑咖 2024-08-11 23:16:15

除了证书中的“密钥使用”字段之外,某些密钥对使用只能进行签名或加密(密钥交换)的算法。例如,DH 和 DSA。 RSA 对两者都有好处,所以从技术上讲你可以做任何你想做的事。但正如其他答案指出的那样,验证签名的代码可能会拒绝它,因为证书被用于错误的目的。

Besides the "key usage" fields in the certificates, some key pairs use algorithms that can only do signing or encryption (key exchange). For example, DH and DSA. RSA is good for both so technically you can do whatever you want. But as other answers pointed out, the code that verifies your signature will probably reject it because the certificate was used for wrong purpose.

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