pkcs7-signature

CMS (PKI)

[7] CMS / PKCS #7 は、暗号化署名が行われたデータを表現する構文 (の仕様書) です。

仕様書

意味

[40] IETF の見解では、 PKCS #7IETF に移管されて改訂したものが CMS のようです。後継ではありますが、別物と認識されていると思われます。 実際にはその歴史的連続性から、 CMS のことを PKCS #7 と呼んだり、 PKCS #7 時代も含めて CMS と呼んだりもするようです。また CMS が最新版となって久しいとはいえ、未だ元の PKCS #7 にしか対応していない実装もあるようです。

[41] より話を複雑にしているのは、本来の PKCS #7/CMS のデータ形式ではなく、 その一部分であるべき構造を取り出した形の PKCS #7証明書鎖 (>>8) が (もしかすると本来の形よりも) よく用いられており、そちらが単に 「PKCS #7」や「CMS」と呼ばれることも多々あるようです。 しかも本来の形式は PKCS 標準に加えて RFC 化されていたのに対して、 証明書鎖形式は Netscape 社の独自仕様を他社も実装したものであり、 Netscape 社の消滅後は Mozilla プロジェクトが引き継いだ >>24 とはいえ、標準仕様の存在が不明瞭な状態で、混乱を助長しています。

構文

[45] ASN.1の日時形式

文脈

[19] PKCS #7 で規定されるデータ構造は次の場面で使われています。

[47] PKCS #7 応用

.pem 符号化

[34] .pem ファイルでは、ラベルとして PKCS #7PKCS7 >>33CMSCMS >>38 が用いられます。。

[35] データは、それぞれの仕様の ASN.1 ContentInfo でなければなりません >>33, >>38BER を使わなければなりません >>33, >>38

PKCS #7 証明書鎖

[8] PKCS #7 証明書鎖 (PKCS#7 certificate chain) >>24 や 「PKCS #7 形式」、拡張子 .p7b で表されるデータ形式は、 証明書群や CRL をまとめたものです。

[25] NSSWindows などで使われています。 証明書鎖の標準的なファイル形式の1つです。

[22] Windows では「Cryptographic Message Syntax Standard - PKCS #7 証明書」 と呼ばれています。

[12] Windows には標準で .p7b ファイルの内容を表示できるビューアーが入っているようです。
[14] 拡張子は他に .spc, .p7a, .p7c >>13.p7 が使われることがあるようです。いずれも実質的に同じデータ形式を指しているらしいです。

[9] これは PKCS #7SignedData データ構造のみを用いて、 1つ以上の証明書を含めたものです >>24version, digestAlgorithms, contentInfo, crls, signerInfos は無視されます >>24

[28] しかし CRL を含めることもあるようです >>27

[20] ASN.1 仕様上証明書の順番は保持できないようです >>5 が、 証明書ダウンロード仕様としては順序が意味を持ちます。実際にどう扱われているのかは不明です。

[10] certification path 上の証明書をまとめて1つのファイルとして扱う時などに使われます。

[11] 本形式は BER によって符号化されたバイナリーファイルといわれます。

[29] しかし DER が使われることもあるようです >>23, >>27

[26] 更に .pem 形式で符号化されて証明書ダウンロードに用いられることがあります。 (そのままで証明書ダウンロードに用いられることもあります。)

[37] 証明書ダウンロード仕様書では、ラベルとして CERTIFICATE を使っています >>24RFC 7468 は、 CERTIFICATE CHAIN が使われることがあるが、対応していない実装もある >>33 としています。 CERTIFICATE CHAIN を生成してはなりません >>33。 構文解析器は CERTIFICATE CHAINPKCS7 と解釈するべきではありません >>33

歴史

[1] RSA Laboratories - PKCS #7: Cryptographic Message Syntax Standard ( 版) http://www.emc.com/emc-plus/rsa-labs/standards-initiatives/pkcs-7-cryptographic-message-syntax-standar.htm

This standard describes general syntax for data that may have cryptography applied to it, such as digital signatures and digital envelopes.

In support of the SET protocol for secure electronic transactions, RSA Laboratories has produced a bulletin detailing changes to be made to PKCS #7 version 1.5 to update it to version 1.6 (which has not yet been published). Version 1.5 is still recommended for general use, and is the basis for the S/MIME specification.

[3] PKCS #7 ファイル内の証明書を表示する ( 版) https://msdn.microsoft.com/ja-jp/library/cc758042(v=ws.10).aspx

[4] PKCS#7 から PKCS#12 への変換 - あきそふと開発日記 ( 版) http://akisoftware.com/cgi-bin/blom.exe?akisoft+sl+2df3bf285450ec962202070ee9f87c3591c3d74f

[5] tls - What's the difference between X.509 and PKCS#7 Certificate? - Information Security Stack Exchange ( 版) http://security.stackexchange.com/questions/73156/whats-the-difference-between-x-509-and-pkcs7-certificate

[6] 荐惹�吾��<ゃ�就綣��ゃ� ( �) http://moca.wide.ad.jp/moca_guide/about_fileformat.html

[13] Certificates ( 版) http://supportline.microfocus.com/documentation/books/nx51ws01/cjcert.htm

As well as the original PKCS #7, there are three revisions: a, b, and c. The standard extensions for these four versions are .spc, .p7a, .p7b and .p7c respectively.

[17] RFC 2311 - S/MIME Version 2 Message Specification ( 版) https://tools.ietf.org/html/rfc2311#appendix-C.1

Some early implementations of S/MIME agents used the following MIME

types:

application/x-pkcs7-mime

application/x-pkcs7-signature

[18] 243833 – Attachments of Content-Type: application/pkcs7-mime that contain non-standard contents fail to decode and are not shown ( 版) https://bugzilla.mozilla.org/show_bug.cgi?id=243833

[23] pkcs7 - PKCS#7 utility ( 版) https://www.openssl.org/docs/apps/pkcs7.html

[27] crl2pkcs7 - Create a PKCS#7 structure from a CRL and certificates. ( 版) https://www.openssl.org/docs/apps/crl2pkcs7.html

[30] RFC 3335 - MIME-based Secure Peer-to-Peer Business Data Interchange over the Internet ( 版) http://tools.ietf.org/html/rfc3335#section-5.2

[31] CMSPKCS #7 の新版ですが、最早 PKCS #7 ではなく、それを元にした新仕様との位置付けのようです。

[32] PKCS #7 にのみ対応していて、 CMS には対応していない実装も珍しくはないようです。

[36] 実装は、 CMS を使えるなら PKCS #7 を使うべきではありません >>33, >>38

[39] RFC 5024 - ODETTE File Transfer Protocol 2.0 ( 版) https://tools.ietf.org/html/rfc5024

[42] RFC 5083 - Cryptographic Message Syntax (CMS) Authenticated-Enveloped-Data Content Type ( 版) https://tools.ietf.org/html/rfc5083

[43] RFC 5084 - Using AES-CCM and AES-GCM Authenticated Encryption in the Cryptographic Message Syntax (CMS) ( 版) https://tools.ietf.org/html/rfc5084

[44] RFC 5126 - CMS Advanced Electronic Signatures (CAdES) ( 版) https://tools.ietf.org/html/rfc5126

[46] rfc4073, https://datatracker.ietf.org/doc/html/rfc4073

[48] RFC 4490: Using the GOST 28147-89, GOST R 34.11-94, GOST R 34.10-94, and GOST R 34.10-2001 Algorithms with Cryptographic Message Syntax (CMS), https://www.rfc-editor.org/rfc/rfc4490.html

[49] RFC Errata Report » RFC Editor, https://www.rfc-editor.org/errata/rfc4490