作者sean72 (.)
看板Web_Design
标题[问题] Certificate 凭证
时间Sat Aug 3 13:07:08 2013
最近在网路上看了certificate的内容
但是不是很了解
因为本身在写python程式 所以也就参考了他上面的说明
我逐字阅读还是有不懂得地方 我将我的问题贴在文章的前头
希望有人能帮忙回答 谢谢
自己整理的结论:
所以凭证里面包含的东西有
a. subject的名称以及subject的公钥
b. issuer里面的资讯: 谁是subject,以及凭证里面subject的公钥是否正确
整串短文看完,我还是不清楚这个东西如何运作
我知道certificate是由第三方公司例如verisign所认证签发
所以如果当我登入某家银行的网站
那麽我的电脑就是subject,银行的主机就是issuer这样吗?
那麽当我连接到银行主机的时候,这个certificate是什麽时候飞进我和银行之间?
certificate是银行寄给我的吗?
如果是,银行寄给我凭证,我打开凭证,使用里面我(subject)的那把公钥,
去解开我私钥加密的讯息?
那银行一开始怎麽会有我的公钥?
难道我的公钥大家都可以任意取得? Verisign如何取得我的电脑名称以及公钥资讯?自己整理的结论:
所以凭证里面包含的东西有
a. subject的名称以及subject的公钥
b. issuer里面的资讯: 谁是subject,以及凭证里面subject的公钥是否正确
整串短文看完,我还是不清楚这个东西如何运作
我知道certificate是由第三方公司例如Verisign所认证签发
所以如果当我登入某家银行的网站
那麽我的电脑就是subject,银行的主机就是issuer这样吗?
那麽当我连接到银行主机的时候,这个certificate是什麽时候飞进我和银行之间?
certificate是银行寄给我的吗?
如果是,银行寄给我凭证,我打开凭证,使用里面我(subject)的那把公钥,
去解开我私钥加密的讯息?
那银行一开始怎麽会有我的公钥?
难道我的公钥大家都可以任意取得? Verisign如何取得我的电脑名称以及公钥资讯?
http://docs.python.org/3.3/library/ssl.html#certificates
Certificates in general are part of a public-key / private-key system.
In this system, each principal, (which may be a machine, or a person, or an
organization) is assigned a unique two-part encryption key. One part of the
key is public, and is called the public key; the other part is kept secret,
and is called the private key. The two parts are related, in that if you
encrypt a message with one of the parts, you can decrypt it with the other
part, and only with the other part.
每台机器都会有一把"公钥" 一把"私钥",如果你用其中一把钥匙去加密,就得用另
外一把相对应的钥匙去解密
(但是他没说要用"哪一把"去加密,不过从下文推断 应该是用私钥加密公钥解密
但是说不定也能反其道而行?)
A certificate contains information about two principals.
"凭证"包含两台机器的讯息
It contains the name of a subject, and the subject’s public key.
凭证包含了某台机器(subject)的名称以及他的公钥
It also contains a statement by a second principal, the issuer, that the
subject is who he claims to be, and that this is indeed the subject’s public
key.
另一台机器(issuer)有下面两个资讯:
1.谁是subject,
2.以及凭证里面subject的公钥是否正确
凭证除了上述subject以及subjet公钥以外,另外也包含issuer里面的这份资讯
The issuer’s statement is signed with the issuer’s private key, which only
the issuer knows.
Issuer的资讯被issuer的私钥加密过了
However, anyone can verify the issuer’s statement by finding the issuer’s
public key, decrypting the statement with it, and comparing it to the other
information in the certificate.
只要有issuer公钥的人,都可以用issuer的公钥去解密issuer的资讯,去验证,然後比较
凭证里面有关issuer的资讯以及issuer本身的资讯
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 172.249.127.149
1F:推 s25g5d4:先在本机执行一产生金钥的程式 私钥你自己保留 公钥传送给 08/03 15:48
2F:→ s25g5d4:银行 银行要给你的资料先用公钥加密 一旦加密後银行也打 08/03 15:49
3F:→ s25g5d4:不开 因为只有你手上的私钥可以解开使用你公钥加密的资料 08/03 15:50
4F:→ ssccg:公钥加密私钥解密,私钥签章公钥验证,这是两件不同的事 08/03 18:21
5F:→ ssccg:你要问的是Web Server的SSL凭证,还是银行交易用凭证? 08/03 18:22
6F:→ mail6543210:公私钥的用途如ss大所说;而公钥顾名思义可公开,但要如 08/03 22:21
7F:→ mail6543210:何保证所取得的公钥不是伪造的?每人两两之间交换公钥, 08/03 22:22
8F:→ mail6543210:就有n^2把钥匙,难维护.所以有PKI,角色是双方都信任的 08/03 22:23
9F:→ mail6543210:保证人.Issuer签发server(subject1)凭证,client(subje 08/03 22:25
10F:→ mail6543210:ct2)信任Issuer,因此信任issuer挂保证的server. 08/03 22:26
11F:→ mail6543210:issuer像是Versign,Server像是FB,client像是firefox. 08/03 22:27
12F:→ mail6543210:但是issuer也很多,所以用另一个issuer为其背书,形成金 08/03 22:28
13F:→ mail6543210:字塔,最上层称为root.Windows>执行>certmgr.msc中,"信 08/03 22:29
14F:→ mail6543210:任...根..."即是,随Windows内建. 08/03 22:30
15F:→ mail6543210:一般HTTPS用的SSLclient端用随机产生的密钥对,server 08/03 22:31
16F:→ mail6543210:无法确认client身分;ssl-vpn则会要求client的身分. 08/03 22:32