aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/test/asn1_SUITE_data/rfcs/PKIX1-PSS-OAEP-Algorithms-2009.asn1
blob: b1232fb8f24d2821a3342709d65f22a6e2c781f6 (plain) (blame)
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
   PKIX1-PSS-OAEP-Algorithms-2009
       {iso(1) identified-organization(3) dod(6) internet(1) security(5)
       mechanisms(5) pkix(7) id-mod(0) id-mod-pkix1-rsa-pkalgs-02(54)}
   DEFINITIONS EXPLICIT TAGS ::=
   BEGIN
   IMPORTS

   AlgorithmIdentifier{}, ALGORITHM, DIGEST-ALGORITHM, KEY-TRANSPORT,
       SIGNATURE-ALGORITHM, PUBLIC-KEY, SMIME-CAPS
   FROM AlgorithmInformation-2009
       {iso(1) identified-organization(3) dod(6) internet(1) security(5)
       mechanisms(5) pkix(7) id-mod(0)
       id-mod-algorithmInformation-02(58)}

   id-sha1, mda-sha1, pk-rsa, RSAPublicKey
   FROM PKIXAlgs-2009
      {iso(1) identified-organization(3) dod(6) internet(1) security(5)
      mechanisms(5) pkix(7) id-mod(0)
      id-mod-pkix1-algorithms2008-02(56)};

   -- ============================
   --    Object Set exports
   -- ============================
   --
   --  Define top-level symbols with all of the objects defined for
   --  export to other modules.  These objects would be included as part
   --  of an Object Set to restrict the set of legal values.
   --

   PublicKeys PUBLIC-KEY ::= { pk-rsaSSA-PSS | pk-rsaES-OAEP, ... }
   SignatureAlgs SIGNATURE-ALGORITHM ::= { sa-rsaSSA-PSS, ...}
   KeyTransportAlgs KEY-TRANSPORT ::= { kta-rsaES-OAEP, ... }
   HashAlgs DIGEST-ALGORITHM ::= { mda-sha224 | mda-sha256 | mda-sha384
                                      | mda-sha512, ... }
   SMimeCaps SMIME-CAPS ::= {
       sa-rsaSSA-PSS.&smimeCaps |
       kta-rsaES-OAEP.&smimeCaps,
       ...
   }

   -- =============================
   --    Algorithm Objects
   -- =============================

   --
   -- Public key object for PSS signatures
   --

   pk-rsaSSA-PSS PUBLIC-KEY ::= {
       IDENTIFIER id-RSASSA-PSS
       KEY RSAPublicKey
       PARAMS TYPE RSASSA-PSS-params ARE optional
        -- Private key format not in this module --
       CERT-KEY-USAGE { nonRepudiation, digitalSignature,
                            keyCertSign, cRLSign }
   }

   --
   --  Signature algorithm definition for PSS signatures
   --

   sa-rsaSSA-PSS SIGNATURE-ALGORITHM ::= {
       IDENTIFIER id-RSASSA-PSS
       PARAMS TYPE RSASSA-PSS-params ARE required
       HASHES { mda-sha1 | mda-sha224 | mda-sha256 | mda-sha384
                    | mda-sha512 }
       PUBLIC-KEYS { pk-rsa | pk-rsaSSA-PSS }
       SMIME-CAPS { IDENTIFIED BY id-RSASSA-PSS }
   }

   --
   --  Signature algorithm definitions for PKCS v1.5 signatures
   --

   sa-sha224WithRSAEncryption SIGNATURE-ALGORITHM ::= {
       IDENTIFIER sha224WithRSAEncryption
       PARAMS TYPE NULL ARE required
       HASHES { mda-sha224 }
       PUBLIC-KEYS { pk-rsa }
       SMIME-CAPS { IDENTIFIED BY sha224WithRSAEncryption }
   }
   sha224WithRSAEncryption  OBJECT IDENTIFIER  ::=  { pkcs-1 14 }

   sa-sha256WithRSAEncryption SIGNATURE-ALGORITHM ::= {
       IDENTIFIER sha256WithRSAEncryption
       PARAMS TYPE NULL ARE required
       HASHES { mda-sha256 }
       PUBLIC-KEYS { pk-rsa }
       SMIME-CAPS { IDENTIFIED BY sha256WithRSAEncryption }
   }
   sha256WithRSAEncryption  OBJECT IDENTIFIER  ::=  { pkcs-1 11 }

   sa-sha384WithRSAEncryption SIGNATURE-ALGORITHM ::= {
       IDENTIFIER sha384WithRSAEncryption
       PARAMS TYPE NULL ARE required
       HASHES { mda-sha384 }
       PUBLIC-KEYS { pk-rsa }
       SMIME-CAPS { IDENTIFIED BY sha384WithRSAEncryption }
   }
   sha384WithRSAEncryption  OBJECT IDENTIFIER  ::=  { pkcs-1 12 }

   sa-sha512WithRSAEncryption SIGNATURE-ALGORITHM ::= {
       IDENTIFIER sha512WithRSAEncryption
       PARAMS TYPE NULL ARE required
       HASHES { mda-sha512 }
       PUBLIC-KEYS { pk-rsa }
       SMIME-CAPS { IDENTIFIED BY sha512WithRSAEncryption }
   }
   sha512WithRSAEncryption  OBJECT IDENTIFIER  ::=  { pkcs-1 13 }

   --
   --  Public key definition for OAEP encryption
   --

   pk-rsaES-OAEP PUBLIC-KEY ::= {
       IDENTIFIER id-RSAES-OAEP
       KEY RSAPublicKey
       PARAMS TYPE RSAES-OAEP-params ARE optional
        -- Private key format not in this module --
       CERT-KEY-USAGE {keyEncipherment, dataEncipherment}
   }

   --
   --  Key transport key lock definition for OAEP encryption
   --

   kta-rsaES-OAEP KEY-TRANSPORT ::= {
       IDENTIFIER id-RSAES-OAEP
       PARAMS TYPE RSAES-OAEP-params ARE required
       PUBLIC-KEYS { pk-rsa | pk-rsaES-OAEP }
       SMIME-CAPS { TYPE RSAES-OAEP-params IDENTIFIED BY id-RSAES-OAEP}
   }
   -- ============================
   --   Basic object identifiers
   -- ============================

   pkcs-1  OBJECT IDENTIFIER  ::=
       { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 1 }

   -- When rsaEncryption is used in an AlgorithmIdentifier, the
   -- parameters MUST be present and MUST be NULL.
   -- rsaEncryption  OBJECT IDENTIFIER  ::=  { pkcs-1 1 }

   -- When id-RSAES-OAEP is used in an AlgorithmIdentifier,
   -- and the parameters field is present, it MUST be
   -- RSAES-OAEP-params.

   id-RSAES-OAEP  OBJECT IDENTIFIER  ::=  { pkcs-1 7 }

   -- When id-mgf1 is used in an AlgorithmIdentifier, the parameters
   -- MUST be present and MUST be a HashAlgorithm.

   id-mgf1  OBJECT IDENTIFIER  ::=  { pkcs-1 8 }

   -- When id-pSpecified is used in an AlgorithmIdentifier, the
   -- parameters MUST be an OCTET STRING.

   id-pSpecified  OBJECT IDENTIFIER  ::=  { pkcs-1 9 }

   -- When id-RSASSA-PSS is used in an AlgorithmIdentifier, and the
   -- parameters field is present, it MUST be RSASSA-PSS-params.

   id-RSASSA-PSS  OBJECT IDENTIFIER  ::=  { pkcs-1 10 }

   -- When the following OIDs are used in an AlgorithmIdentifier, the
   -- parameters SHOULD be absent, but if the parameters are present,
   -- they MUST be NULL.

   --
   -- id-sha1 is imported from RFC 3279.  Additionally, the v1.5
   -- signature algorithms (i.e., rsaWithSHA256) are now solely placed
   -- in that module.
   --

   id-sha224  OBJECT IDENTIFIER  ::=
       { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101)
       csor(3) nistAlgorithms(4) hashalgs(2) 4 }

   mda-sha224 DIGEST-ALGORITHM ::= {
       IDENTIFIER id-sha224
       PARAMS TYPE NULL ARE preferredAbsent
   }

   id-sha256  OBJECT IDENTIFIER  ::=
       { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101)
       csor(3) nistAlgorithms(4) hashalgs(2) 1 }

   mda-sha256 DIGEST-ALGORITHM ::= {
       IDENTIFIER id-sha256
       PARAMS TYPE NULL ARE preferredAbsent
   }
   id-sha384  OBJECT IDENTIFIER  ::=
       { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101)
       csor(3) nistAlgorithms(4) hashalgs(2) 2 }

   mda-sha384 DIGEST-ALGORITHM ::= {
       IDENTIFIER id-sha384
       PARAMS TYPE NULL ARE preferredAbsent
   }
   id-sha512  OBJECT IDENTIFIER  ::=
       { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101)
       csor(3) nistAlgorithms(4) hashalgs(2) 3 }

   mda-sha512 DIGEST-ALGORITHM ::= {
       IDENTIFIER id-sha512
       PARAMS TYPE NULL ARE preferredAbsent
   }

   -- =============
   --   Constants
   -- =============

   EncodingParameters ::= OCTET STRING(SIZE(0..MAX))

   nullOctetString  EncodingParameters  ::=  ''H

   nullParameters NULL  ::=  NULL

   -- =========================
   --   Algorithm Identifiers
   -- =========================

   HashAlgorithm  ::=  AlgorithmIdentifier{DIGEST-ALGORITHM,
                           {HashAlgorithms}}

   HashAlgorithms DIGEST-ALGORITHM ::=  {
       { IDENTIFIER id-sha1 PARAMS TYPE NULL ARE preferredPresent } |
       { IDENTIFIER id-sha224 PARAMS TYPE NULL ARE preferredPresent } |
       { IDENTIFIER id-sha256 PARAMS TYPE NULL ARE preferredPresent } |
       { IDENTIFIER id-sha384 PARAMS TYPE NULL ARE preferredPresent } |
       { IDENTIFIER id-sha512 PARAMS TYPE NULL ARE preferredPresent }
   }

   sha1Identifier HashAlgorithm ::= {
       algorithm id-sha1,
       parameters NULL : NULL
   }

   --
   --  We have a default algorithm - create the value here
   --

   MaskGenAlgorithm ::= AlgorithmIdentifier{ALGORITHM,
                           {PKCS1MGFAlgorithms}}

   mgf1SHA1 MaskGenAlgorithm ::= {
       algorithm id-mgf1,
       parameters HashAlgorithm : sha1Identifier
   }

   --
   --  Define the set of mask generation functions
   --
   --  If the identifier is id-mgf1, any of the listed hash
   --    algorithms may be used.
   --

   PKCS1MGFAlgorithms ALGORITHM ::= {
       { IDENTIFIER id-mgf1 PARAMS TYPE HashAlgorithm ARE required },
       ...
   }

   --
   -- Define the set of known source algorithms for PSS
   --

   PSourceAlgorithm ::= AlgorithmIdentifier{ALGORITHM,
                                                {PSS-SourceAlgorithms}}

   PSS-SourceAlgorithms ALGORITHM ::= {
       { IDENTIFIER id-pSpecified PARAMS TYPE EncodingParameters
             ARE required },
       ...
   }
   pSpecifiedEmpty PSourceAlgorithm ::=  {
       algorithm id-pSpecified,
       parameters EncodingParameters : nullOctetString
   }

   -- ===================
   --   Main structures
   -- ===================

   -- AlgorithmIdentifier parameters for id-RSASSA-PSS.
   -- Note that the tags in this Sequence are explicit.
   -- Note: The hash algorithm in hashAlgorithm and in
   -- maskGenAlgorithm should be the same.

   RSASSA-PSS-params  ::=  SEQUENCE  {
       hashAlgorithm     [0] HashAlgorithm DEFAULT sha1Identifier,
       maskGenAlgorithm  [1] MaskGenAlgorithm DEFAULT mgf1SHA1,
       saltLength        [2] INTEGER DEFAULT 20,
       trailerField      [3] INTEGER DEFAULT 1
   }

   -- AlgorithmIdentifier parameters for id-RSAES-OAEP.
   -- Note that the tags in this Sequence are explicit.
   -- Note: The hash algorithm in hashFunc and in
   -- maskGenFunc should be the same.

   RSAES-OAEP-params  ::=  SEQUENCE  {
       hashFunc          [0] HashAlgorithm DEFAULT sha1Identifier,
       maskGenFunc       [1] MaskGenAlgorithm DEFAULT mgf1SHA1,
       pSourceFunc       [2] PSourceAlgorithm DEFAULT
                                 pSpecifiedEmpty
   }

   END