作者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
推 s25g5d4:先在本機執行一產生金鑰的程式 私鑰你自己保留 公鑰傳送給 08/03 15:48
→ s25g5d4:銀行 銀行要給你的資料先用公鑰加密 一旦加密後銀行也打 08/03 15:49
→ s25g5d4:不開 因為只有你手上的私鑰可以解開使用你公鑰加密的資料 08/03 15:50
→ ssccg:公鑰加密私鑰解密,私鑰簽章公鑰驗證,這是兩件不同的事 08/03 18:21
→ ssccg:你要問的是Web Server的SSL憑證,還是銀行交易用憑證? 08/03 18:22
→ mail6543210:公私鑰的用途如ss大所說;而公鑰顧名思義可公開,但要如 08/03 22:21
→ mail6543210:何保證所取得的公鑰不是偽造的?每人兩兩之間交換公鑰, 08/03 22:22
→ mail6543210:就有n^2把鑰匙,難維護.所以有PKI,角色是雙方都信任的 08/03 22:23
→ mail6543210:保證人.Issuer簽發server(subject1)憑證,client(subje 08/03 22:25
→ mail6543210:ct2)信任Issuer,因此信任issuer掛保證的server. 08/03 22:26
→ mail6543210:issuer像是Versign,Server像是FB,client像是firefox. 08/03 22:27
→ mail6543210:但是issuer也很多,所以用另一個issuer為其背書,形成金 08/03 22:28
→ mail6543210:字塔,最上層稱為root.Windows>執行>certmgr.msc中,"信 08/03 22:29
→ mail6543210:任...根..."即是,隨Windows內建. 08/03 22:30
→ mail6543210:一般HTTPS用的SSLclient端用隨機產生的密鑰對,server 08/03 22:31
→ mail6543210:無法確認client身分;ssl-vpn則會要求client的身分. 08/03 22:32