-
Notifications
You must be signed in to change notification settings - Fork 4
/
924.txt
156 lines (122 loc) · 7.87 KB
/
924.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
* 仕様書
[REFS[
- [4] [CITE@en[RFC 4517 - Lightweight Directory Access Protocol (LDAP): Syntaxes and Matching Rules]]
([TIME[2015-03-08 19:15:43 +09:00]] 版)
<http://tools.ietf.org/html/rfc4517#section-3.3.15>
- [6] [CITE@en[RFC 4517 - Lightweight Directory Access Protocol (LDAP): Syntaxes and Matching Rules]] ([TIME[2015-03-08 19:15:43 +09:00]] 版) <http://tools.ietf.org/html/rfc4517#section-4.2>
- [9] [CITE@en[RFC 4518 - Lightweight Directory Access Protocol (LDAP): Internationalized String Preparation]] ([TIME[2014-12-29 00:45:51 +09:00]] 版) <http://tools.ietf.org/html/rfc4518#section-2.1>
- [1] '''[CITE@en[RFC 5280 - Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile]] ([TIME[2015-02-22 15:44:10 +09:00]] 版) <http://tools.ietf.org/html/rfc5280#section-4.1.2.4>'''
- [20] [CITE@en[RFC 5280 - Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile]] ([TIME[2015-02-22 15:44:10 +09:00]] 版) <http://tools.ietf.org/html/rfc5280#section-4.1.2.6>
- [27] [CITE@en[RFC 5280 - Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile]] ([TIME[2015-02-22 15:44:10 +09:00]] 版) <http://tools.ietf.org/html/rfc5280#section-7.1>
]REFS]
* [CODE[IA5String]]
[FIG(quote)[
[FIGCAPTION[
[5] >>4
]FIGCAPTION]
> A value of the IA5 String syntax is a string of zero, one, or more
characters from International Alphabet 5 (IA5) [T.50], the
international version of the ASCII character set. The LDAP-specific
encoding of a value of this syntax is the unconverted string of
characters, which conforms to the <IA5String> rule in Section 3.2.
> The LDAP definition for the IA5 String syntax is:
[PRE[
( 1.3.6.1.4.1.1466.115.121.1.26 DESC 'IA5 String' )
]PRE]
> This syntax corresponds to the IA5String ASN.1 type from [ASN.1].
]FIG]
* [CODE[PrintableString]]
[3] RFC 987, RFC 1138, RFC 1148,
RFC 1327 <urn:ietf:rfc:1327>, RFC 2156 <urn:ietf:rfc:2156>
で定義されています。
** 構文
printable-string = *(ps-delim / ps-restricted-char)
ps-restricted-char = DIGIT / ALPHA / " " / "'" / "+"
/ "," / "-" / "." / "/" / ":" / "=" / "?"
ps-delim = "(" / ")"
ps-encoded = *( ps-restricted-char / ps-encoded-char )
ps-encoded-char = "(a)" ; (@)
/ "(p)" ; (%)
/ "(b)" ; (!)
/ "(q)" ; (")
/ "(u)" ; (_)
/ "(l)" ; "("
/ "(r)" ; ")"
/ "(" 3DIGIT ")" ; 000 - 127 (= ASCII %x00-7E)
大文字・小文字は区別しませんが、常に小文字で生成します。
(l), (r) は RFC 987 では定義されていませんでした。
**例
'a demo.' <-> 'a demo.'
foo(a)bar <-> foo@bar
(q)(u)(p)(q) <-> "_%"
(a) <-> @
(A) -> @
(l)a(r) <-> (a)
(126) <-> ~
( -> (
(l) <-> (
* [CODE[DirectoryString]]
[11] [DFN[[CODE[[[DirectoryString]]]]]] は、 [CODE[[[TeletexString]]]],
[CODE[[[PrintableString]]]], [CODE[[[UniversalString]]]],
[CODE[[[UTF8String]]]], [CODE[[[BMPString]]]] のいずれかによる空でない列です [SRC[>>1]]。
;; [2] [CODE[[[IA5String]]]] は含まれていません。
[14] [[RFC 5280]] [[プロファイル]]に適合する [[CA]] は、
原則として [CODE[[[PrintableString]]]] か [CODE[[[UTF8String]]]]
を用いなければ[['''なりません''']] [SRC[>>1, >>20]]。
[15] [[CA]] が従来 [CODE[[[issuer]]]] [[欄]]において
[CODE[[[TeletexString]]]], [CODE[[[BMPString]]]],
[CODE[[[UniversalString]]]] で[[証明書]]を[[発行]]していたなら、
[[後方互換性]]のため引き続きこれを利用しても構いません [SRC[>>1]]。
[16] 既存の [[CA]] が >>15 のような[[証明書]]を発行しているところに新しい [[CA]]
を追加する場合、既存の [[CA]] が使っているものと同じ方法で[[属性]]を[[符号化]]して構いません。 [SRC[>>1]]
[22] [[証明書]]の [CODE[[[subject]]]] が [[CA]] の場合には、 >>15 のような
[CODE[[[issuer]]]] が [[CA]] の[[証明書]]で使われているなら、それと同じ方法で[[符号化]]しなければ[['''なりません''']] [SRC[>>20]]。
[23] [[証明書]]の [CODE[[[subject]]]] が [[CRL発行者]]の場合には、
当該[[CRL発行者]]の[[発行]]する [[CRL]] の [CODE[[[issuer]]]]
[[欄]]と同じ方法で[[符号化]]しなければ[['''なりません''']] [SRC[>>20]]。
[24] 既存の [[subject]] に新しい[[証明書]]を発行する場合や、
他の [[subject]] に発行した[[証明書]]で既に[[符号化]]された[[属性]]を新たな
[[subject]] に発行する場合には、 [CODE[[[TeletexString]]]], [CODE[[[BMPString]]]],
[CODE[[[UniversalString]]]] で [CODE[[[subject]]]] を[[符号化]]して構いません。 [SRC[>>20]]
[25] [[証明書]]の[[利用者]]は、 [CODE[[[TeletexString]]]], [CODE[[[BMPString]]]],
[CODE[[[UniversalString]]]] の [CODE[[[subject]]]] の受信にも備える[['''べきです''']] [SRC[>>20]]。しかし対応は義務ではありません [SRC[>>27]]。
* Unicode への変換
[10] [[RFC 4518]] の [[LDAP]] 用 [[stringprep]] においては、
[RUBYB[[[転符号化]]]@en[Transcoding]]手順において [[Unicode]] に変換する方法が規定されています。
[12] [CODE[[[PrintableString]]]] は、直接 [[Unicode]] へと[[転符号化]]します [SRC[>>9]]。
[13] [CODE[[[UniversalString]]]], [CODE[[[UTF8String]]]], [CODE[[[bmpString]]]]
は、既に [[Unicode]] なので[[転符号化]]は不要です [SRC[>>9]]。
[17] [CODE[[[TeletexString]]]] は、 [[Unicode]] に[[転符号化]]します。
ただし標準の[[写像]]はありませんから、実装に委ねられます。
これもあって、 [CODE[[[TeletexString]]]] は使う[['''べきではありません''']]。 [SRC[>>9]]
* 比較
[7] [[RFC 4517]] は、[[文字列]]に関する次の[[比較]]演算を規定しています [SRC[>>6]]。
[FIG(short list)[
- [CODE[[[numericStringMatch]]]]
- [CODE[[[numericStringSubstringsMatch]]]]
- [CODE[[[caseExactMatch]]]]
- [CODE[[[caseExactOrderingMatch]]]]
- [CODE[[[caseExactSubstringsMatch]]]]
- [CODE[[[caseExactIA5Match]]]]
- [CODE[[[caseIgnoreIA5Match]]]]
- [CODE[[[caseIgnoreIA5SubstringsMatch]]]]
- [CODE[[[caseIgnoreListMatch]]]]
- [CODE[[[caseIgnoreListSubstringsMatch]]]]
- [CODE[[[caseIgnoreMatch]]]]
- [CODE[[[caseIgnoreOrderingMatch]]]]
- [CODE[[[caseIgnoreSubstringsMatch]]]]
- [CODE[[[directoryStringFirstComponentMatch]]]]
- [CODE[[[telephoneNumberMatch]]]]
- [CODE[[[telephoneNumberSubstringsMatch]]]]
- [CODE[[[wordMatch]]]]
]FIG]
[8] これらは [[RFC 4518]] の [[Stringprep]] 変種を使って[[正規化]]して[[比較]]します。
[18] [[インターネットPKI]]においては、実装は [CODE[[[PrintableString]]]] や
[CODE[[[UTF8String]]]] の [[distinguished name]] [[属性]]の[[比較]]に当たり
[[RFC 4518]] が規定する [[stringprep]] [[プロファイル]]を適用しなければ[['''なりません''']]。
実装は [CODE[[[caseIgnoreMatch]]]] による比較に対応しなければ[['''なりません''']]。
それ以外の比較方式を使う[[属性型]]への対応は必須ではありません。 [SRC[>>27]]
;; [CODE[[[caseIgnoreMatch]]]] のための [[stringprep]] では、
[[Map]] 手順で [[RFC 3453]] 表B.2 を用いた [[case folding]] を行います。
また [[Insignificant Character Removal]] 手順で [[Insignificant Space Handling]]
を用います。 [SRC[>>27]] 詳しくは [[stringprep]] を参照。