签名与认证

原文:https://developer.apple.com/library/prerelease/ios/documentation/Security/Conceptual/Security_Overview/CryptographicServices/CryptographicServices.html#//apple_ref/doc/uid/TP30000976-CH3-SW1

A signature is a way to prove the authenticity of a message, or to verify the identity of a server, user, or other entity.

签名是一种证明消息合法性,或者是验证服务器,用户或其他实体的身份的一种方式。

In olden days, people sometimes stamped envelopes with a wax seal. This seal not only proved who sent the message but also proved that no one had opened the message and potentially modified it while in transit.

在过去,人们用蜡来密封信封。这不但证明信是谁发的,还证明在邮递时没有人开封和修改过信件。

Modern signing achieves many of the same benefits through mathematics. In addition to the data itself, signing and verifying require two pieces of information: the appropriate half of a public-private key pair and a digital certificate.

现在,利用数学,签名可以达到很多和过去一样的效果。除了数据本身,签名和认证需要两方面信息,一、合适的公钥或者密钥,二、数字证书。

The sender computes a hash of the message and encrypts it with the private key. The recipient also computes a hash and then uses the corresponding public key to decrypt the sender’s hash and compares the hashes. If they are the same, the data was not modified in transit, and you can safely trust that the data was sent by the owner of that key.

发送者计算出消息的hash值并且用密钥加密,接受者也计算出一个hash值并且用相应的公钥解密发送方的hash值,然后比较两个hash值,如果他们是一致的话,那么数据在传送过程中就没有被修改过,你就可以确信这个数据是密钥的所有者发的。


The sender’s digital certificate is a collection of data that contains a public key and other identifying information, at the sender’s discretion, such as a person’s name, a company name, a domain name, and a postal address. The purpose of the certificate is to tie a public key to a particular person. If you trust the certificate, you also trust that messages signed by the sender’s private key were sent by that person.

发送者的数据证书是一个数据集,包括公钥和其他身份信息,由发送者自行决定,比如个人姓名,公司名称,域名和邮政地址。证书是为了附着一个公钥给特定的人,如果你信任这个证书,那么你也信任由发送者的密钥加密过的消息。


To provide a means of determining the legitimacy of a certificate, the sender’s certificate is signed by someone else, whose certificate is in turn signed by someone else, and so on, forming a chain of trust to a certificate that the recipient inherently trusts, called an anchor certificate. This certificate may be a root certificate—a self-signed certificate that represents a known certificate authority and thus the root of the tree of certificates originating from that authority—or it may be any arbitrary certificate that the user or application developer has explicitly designated as a trusted anchor.

为了提供一种方法来验证证书的合法性,发送者的证书由其他人来签署,他的证书又由其他人来签署,等等,形成一个信任链,收件人固有的信任的证书,这个证书叫anchor cer,它可能是一个根证书,代表一个已知的证书颁发机构的自签署证书,源自该权限的证书之树的根,或是用户,应用程序开发者显式指定为trusted anchor的任意证书

Because the recipient trusts the anchor certificate, the recipient knows that the certificate is valid and, thus, that the sender is who he or she claims to be. The degree to which the recipient trusts a certificate is defined by two factors:

因为接受者信任anchor cer,所以接受者知道证书是有效的,所以知道发送者就是他。接受者信任的成都取决于两个因素,

1、每个证书可以包含一个或者多个证书的扩展,描述这个证书怎么使用。例如,一个用来对邮件信息签名的证书用来对可执行文件签名可能会不被信任。

2、信任策略允许您信任的证书,否则是不可信的,反之亦然。

  • Each certificate can contain one or more certificate extensions that describe how the certificate can be used. For example, a certificate that is trusted for signing email messages might not be trusted for signing executable code.

  • The trust policy allows you to trust certificates that would otherwise be untrusted and vice versa.

A certificate can also be used for authentication. By signing a nonce (a randomly generated challenge string created specifically for this purpose), a user or server can prove that he, she, or it is in possession of the private key associated with that certificate. If that certificate is considered trusted (by evaluating its chain of trust), then the certificate and signed nonce prove that the user or server must be who he, she, or it claims to be.

证书还可以被用来做认证,通过签名一个杜撰(一个随机生成的专为这个目的的挑战字符串),用户,server可以证明他就是那个证书所关联的密钥的所有者。如果这个证书被信任(通过评估他的信任链),那么这个证书和签名的杜撰就可以证明用户或者server。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值