3. Structure of the Raw Public Key Extension (生の公開鍵拡張の構造)
3. Structure of the Raw Public Key Extension (生の公開鍵拡張の構造)
このセクションでは、生の公開鍵を使用する場合に拡張 TLS ハンドシェイクの一部として使用できる2つの TLS 拡張 client_certificate_type および server_certificate_type を定義します。Section 4 は、これらの拡張を使用する TLS クライアントと TLS サーバーの動作を定義します。
この仕様では、SubjectPublicKeyInfo 構造体の形式で PKIX 証明書ですでに使用可能なエンコーディングが再利用される生の公開鍵 (raw public keys) を使用します。TLS ハンドシェイク内で生の公開鍵を運ぶために、図 1 に示すように、Certificate ペイロードがコンテナとして使用されます。示されている Certificate 構造体は、元の形式 [RFC5246] を適応させたものです。
opaque ASN.1Cert<1..2^24-1>;
struct {
select(certificate_type){
// certificate type defined in this document.
case RawPublicKey:
opaque ASN.1_subjectPublicKeyInfo<1..2^24-1>;
// X.509 certificate defined in RFC 5246
case X.509:
ASN.1Cert certificate_list<0..2^24-1>;
// Additional certificate type based on
// "TLS Certificate Types" subregistry
};
} Certificate;
Figure 1: Certificate Payload as a Container for the Raw Public Key (Figure 1: 生の公開鍵のコンテナとしての Certificate ペイロード)
SubjectPublicKeyInfo 構造体は RFC 5280 [PKIX] のセクション 4.1 で定義されており、RSA 公開鍵の公開指数やモジュラスなどの生の鍵だけでなく、アルゴリズム識別子も含まれています。アルゴリズム識別子にはパラメータも含めることができます。Certificate ペイロードの SubjectPublicKeyInfo 値には、SubjectPublicKeyInfo の DER エンコーディング [X.690] が含まれている必要があります (MUST)。したがって、図 2 に示す構造体には長さ情報も含まれています。Appendix A に例が示されています。
SubjectPublicKeyInfo ::= SEQUENCE {
algorithm AlgorithmIdentifier,
subjectPublicKey BIT STRING }
AlgorithmIdentifier ::= SEQUENCE {
algorithm OBJECT IDENTIFIER,
parameters ANY DEFINED BY algorithm OPTIONAL }
Figure 2: SubjectPublicKeyInfo ASN.1 Structure (Figure 2: SubjectPublicKeyInfo ASN.1 構造)
アルゴリズム識別子はオブジェクト識別子 (OID) です。例えば、RFC 3279 [RFC3279] および RFC 5480 [RFC5480] は、図 3 に示す OID を定義しています。このリストは網羅的なものではなく、将来の RFC でさらに多くの OID が定義される可能性があることに注意してください。
Key Type | Document | OID
--------------------+----------------------------+-------------------
RSA | Section 2.3.1 of RFC 3279 | 1.2.840.113549.1.1
....................|............................|...................
Digital Signature | |
Algorithm (DSA) | Section 2.3.2 of RFC 3279 | 1.2.840.10040.4.1
....................|............................|...................
Elliptic Curve | |
Digital Signature | |
Algorithm (ECDSA) | Section 2 of RFC 5480 | 1.2.840.10045.2.1
--------------------+----------------------------+-------------------
Figure 3: Example Algorithm Object Identifiers (Figure 3: アルゴリズムオブジェクト識別子の例)
"extension_data" フィールドを使用する拡張クライアントおよびサーバー Hello の拡張形式は、ClientCertTypeExtension および ServerCertTypeExtension 構造体を運ぶために使用されます。これらの2つの構造体を図 4 に示します。CertificateType 構造体は列挙型であり、値は "Transport Layer Security (TLS) Extensions" (トランスポート層セキュリティ (TLS) 拡張) レジストリ [TLS-Ext-Registry] の "TLS Certificate Types" (TLS 証明書タイプ) サブレジストリから取得されます。
struct {
select(ClientOrServerExtension) {
case client:
CertificateType client_certificate_types<1..2^8-1>;
case server:
CertificateType client_certificate_type;
}
} ClientCertTypeExtension;
struct {
select(ClientOrServerExtension) {
case client:
CertificateType server_certificate_types<1..2^8-1>;
case server:
CertificateType server_certificate_type;
}
} ServerCertTypeExtension;
Figure 4: CertTypeExtension Structure (Figure 4: CertTypeExtension 構造)