<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><section><h1>暗号化</h1><p><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">multipart/encrypted媒体型</anchor>で、 protocol パラメーターと
最初の部分を媒体型 application/pgp-encrypted とします。
その本文は、「Version: 1」とだけ書きます。
(と書かれてるけど、その後に *CRLF があっていいみたい。)</p><p>2番目の部分が、実際の暗号化データになります。
実質的なデータは全てこちらに含まれます。
'-----BEGIN PGP MESSAGE-----' で始まります。</p><p>See also <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">PGPメッセージ交換形式</anchor> (RFC 1991/2440)</p></section><section><h1>署名</h1><p><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">multipart/signed媒体型</anchor>で、
protocol パラメーターと 2番目の部分を application/pgp-signature
にします。 '-----BEGIN PGP MESSAGE-----' で始まるデータです。</p><p>micalg パラメーターは、 &quot;pgp-&lt;hash-symbol&gt;&quot; と定義されてます。
RFC 2015 では &lt;hash-symbol&gt; は md5 と sha1 が定義されてます。
RFC 3156 は OpenPGP を参照しています。
See <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">PGPメッセージ交換形式</anchor></p><section><h1>署名する</h1><p>1. データを用意する。 <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">text/plain媒体型</anchor>では CRLF 正規形で
適切な charset にする。 (たぶん、他の <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">text/*媒体型</anchor>でも
正規形にする必要がある。)</p><p>2. 必要なら CTE で 7bit データにする。この結果、改行は
CRLF 正規形になってなきゃあかん。</p><p>3. MIME 頭を追加。改行は CRLF だよ。 (しつこいね。)</p><p>4. 頭・本文の署名を計算。</p><p>5. 署名は署名したデータとは別個に生成され<strong>なければならず</strong>、
よって過程はいかなる方法でも署名したデータを
替えては<strong>いけません</strong>。</p></section><section><h1>検証</h1><p>1. CRLF 正規形に改行を変換</p><p>2. 頭・本文と PGP 署名を検証サービスに渡す</p></section></section><section><h1>暗号化と署名</h1><p>multipart/encrypted と multipart/signed を組み合わせてもいいし、
PGP にまとめてやらせてもいいらしい。</p></section><section><h1>参考</h1><p>RFC 2015 は PGP 公開鍵用の <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">application/pgp-keys媒体型</anchor>を定義しています。</p><ul><li>PGP/MIME 入門 by 山本和彦さん <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://pgp.iijlab.net/pgpmime/">http://pgp.iijlab.net/pgpmime/</anchor-external></li></ul><p>&quot;PGP&quot;, &quot;Pretty Good&quot;, &quot;Pretty Good Privacy&quot;
は幾つかの地域では Network Associates, Inc. の登録商標です。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2]</anchor-end>
<cite>S/Mime and PGP Products and Interoperability</cite> (<code>1998-11-11 03:18:36 +09:00</code> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://www.strom.com/places/smime.html">http://www.strom.com/places/smime.html</anchor-external>
(<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">名無しさん</anchor>)</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[3]</anchor-end>
<cite>secure email-clients with PGP/MIME</cite> (<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Martin Bretschneider</anchor> 著, <time>2007-01-08 06:55:41 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://www.bretschneidernet.de/tips/secmua.html.en">http://www.bretschneidernet.de/tips/secmua.html.en</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="4" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[4]</anchor-end> <cite>MUA supported PGP and PGP/MIME</cite>
(<time>2013-09-16 20:19:59 +09:00</time> 版)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://www.cla-ri.net/pgp/pgp04.html">http://www.cla-ri.net/pgp/pgp04.html</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="5" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[5]</anchor-end> <cite>Code Probrem</cite>
(<time>2013-09-16 20:19:58 +09:00</time> 版)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://www.cla-ri.net/pgp/pgp02.html">http://www.cla-ri.net/pgp/pgp02.html</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[1]</anchor-end> <cite xml:lang="ja">PGP/MIME 入門</cite>
(<time>2014-06-17 15:23:25 +09:00</time> 版)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://www.mew.org/~kazu/doc/pgpmime.html">http://www.mew.org/~kazu/doc/pgpmime.html</anchor-external></p></section></body></html>