Cleanup License statement
[oam/tr069-adapter.git] / netconf-server / schemas / common / ietf-crypto-types.yang
1 module ietf-crypto-types {\r
2   yang-version 1.1;\r
3   namespace "urn:ietf:params:xml:ns:yang:ietf-crypto-types";\r
4   prefix ct;\r
5 \r
6   import ietf-yang-types {\r
7     prefix yang;\r
8     reference\r
9       "RFC 6991: Common YANG Data Types";\r
10   }\r
11 \r
12   import ietf-netconf-acm {\r
13     prefix nacm;\r
14     reference\r
15       "RFC 8341: Network Configuration Access Control Model";\r
16   }\r
17 \r
18   organization\r
19     "IETF NETCONF (Network Configuration) Working Group";\r
20 \r
21   contact\r
22     "WG Web:   <http://datatracker.ietf.org/wg/netconf/>\r
23      WG List:  <mailto:netconf@ietf.org>\r
24      Author:   Kent Watsen <mailto:kent+ietf@watsen.net>\r
25      Author:   Wang Haiguang <wang.haiguang.shieldlab@huawei.com>";\r
26 \r
27   description\r
28     "This module defines common YANG types for cryptographic\r
29      applications.\r
30 \r
31      Copyright (c) 2019 IETF Trust and the persons identified\r
32      as authors of the code. All rights reserved.\r
33 \r
34      Redistribution and use in source and binary forms, with\r
35      or without modification, is permitted pursuant to, and\r
36      subject to the license terms contained in, the Simplified\r
37      BSD License set forth in Section 4.c of the IETF Trust's\r
38      Legal Provisions Relating to IETF Documents\r
39      (https://trustee.ietf.org/license-info).\r
40 \r
41      This version of this YANG module is part of RFC XXXX\r
42      (https://www.rfc-editor.org/info/rfcXXXX); see the RFC\r
43      itself for full legal notices.;\r
44 \r
45      The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',\r
46      'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',\r
47      'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document\r
48      are to be interpreted as described in BCP 14 (RFC 2119)\r
49      (RFC 8174) when, and only when, they appear in all\r
50      capitals, as shown here.";\r
51 \r
52   revision 2019-04-29 {\r
53     description\r
54       "Initial version";\r
55     reference\r
56       "RFC XXXX: Common YANG Data Types for Cryptography";\r
57   }\r
58 \r
59   /**************************************/\r
60   /*   Identities for Hash Algorithms   */\r
61   /**************************************/\r
62 \r
63   identity hash-algorithm {\r
64     description\r
65       "A base identity for hash algorithm verification.";\r
66   }\r
67 \r
68   identity sha-224 {\r
69     base hash-algorithm;\r
70     description\r
71       "The SHA-224 algorithm.";\r
72     reference\r
73       "RFC 6234: US Secure Hash Algorithms.";\r
74   }\r
75   identity sha-256 {\r
76     base hash-algorithm;\r
77     description\r
78       "The SHA-256 algorithm.";\r
79     reference\r
80       "RFC 6234: US Secure Hash Algorithms.";\r
81   }\r
82 \r
83   identity sha-384 {\r
84     base hash-algorithm;\r
85     description\r
86       "The SHA-384 algorithm.";\r
87     reference\r
88       "RFC 6234: US Secure Hash Algorithms.";\r
89   }\r
90 \r
91   identity sha-512 {\r
92     base hash-algorithm;\r
93     description\r
94       "The SHA-512 algorithm.";\r
95     reference\r
96       "RFC 6234: US Secure Hash Algorithms.";\r
97   }\r
98 \r
99   /***********************************************/\r
100   /*  Identities for Asymmetric Key Algorithms   */\r
101   /***********************************************/\r
102 \r
103   identity asymmetric-key-algorithm {\r
104     description\r
105       "Base identity from which all asymmetric key\r
106        encryption Algorithm.";\r
107   }\r
108 \r
109   identity rsa1024 {\r
110     base asymmetric-key-algorithm;\r
111     description\r
112       "The RSA algorithm using a 1024-bit key.";\r
113     reference\r
114       "RFC 8017:\r
115          PKCS #1: RSA Cryptography Specifications Version 2.2.";\r
116   }\r
117 \r
118   identity rsa2048 {\r
119     base asymmetric-key-algorithm;\r
120     description\r
121       "The RSA algorithm using a 2048-bit key.";\r
122     reference\r
123       "RFC 8017:\r
124          PKCS #1: RSA Cryptography Specifications Version 2.2.";\r
125   }\r
126 \r
127   identity rsa3072 {\r
128     base asymmetric-key-algorithm;\r
129     description\r
130       "The RSA algorithm using a 3072-bit key.";\r
131     reference\r
132       "RFC 8017:\r
133          PKCS #1: RSA Cryptography Specifications Version 2.2.";\r
134   }\r
135 \r
136   identity rsa4096 {\r
137     base asymmetric-key-algorithm;\r
138     description\r
139       "The RSA algorithm using a 4096-bit key.";\r
140     reference\r
141       "RFC 8017:\r
142          PKCS #1: RSA Cryptography Specifications Version 2.2.";\r
143   }\r
144 \r
145   identity rsa7680 {\r
146     base asymmetric-key-algorithm;\r
147     description\r
148       "The RSA algorithm using a 7680-bit key.";\r
149     reference\r
150       "RFC 8017:\r
151          PKCS #1: RSA Cryptography Specifications Version 2.2.";\r
152   }\r
153 \r
154   identity rsa15360 {\r
155     base asymmetric-key-algorithm;\r
156     description\r
157       "The RSA algorithm using a 15360-bit key.";\r
158     reference\r
159       "RFC 8017:\r
160          PKCS #1: RSA Cryptography Specifications Version 2.2.";\r
161   }\r
162 \r
163   identity secp192r1 {\r
164     base asymmetric-key-algorithm;\r
165     description\r
166       "The ECDSA algorithm using a NIST P256 Curve.";\r
167     reference\r
168       "RFC 6090:\r
169          Fundamental Elliptic Curve Cryptography Algorithms.";\r
170   }\r
171   identity secp224r1 {\r
172     base asymmetric-key-algorithm;\r
173     description\r
174       "The ECDSA algorithm using a NIST P256 Curve.";\r
175     reference\r
176       "RFC 6090:\r
177          Fundamental Elliptic Curve Cryptography Algorithms.";\r
178   }\r
179 \r
180   identity secp256r1 {\r
181     base asymmetric-key-algorithm;\r
182     description\r
183       "The ECDSA algorithm using a NIST P256 Curve.";\r
184     reference\r
185       "RFC 6090:\r
186          Fundamental Elliptic Curve Cryptography Algorithms.";\r
187   }\r
188 \r
189   identity secp384r1 {\r
190     base asymmetric-key-algorithm;\r
191     description\r
192       "The ECDSA algorithm using a NIST P256 Curve.";\r
193     reference\r
194       "RFC 6090:\r
195          Fundamental Elliptic Curve Cryptography Algorithms.";\r
196   }\r
197 \r
198   identity secp521r1 {\r
199     base asymmetric-key-algorithm;\r
200     description\r
201       "The ECDSA algorithm using a NIST P256 Curve.";\r
202     reference\r
203       "RFC 6090:\r
204          Fundamental Elliptic Curve Cryptography Algorithms.";\r
205   }\r
206 \r
207   /*************************************/\r
208   /*   Identities for MAC Algorithms   */\r
209   /*************************************/\r
210 \r
211   identity mac-algorithm {\r
212     description\r
213       "A base identity for mac generation.";\r
214   }\r
215 \r
216   identity hmac-sha1 {\r
217     base mac-algorithm;\r
218     description\r
219       "Generating MAC using SHA1 hash function";\r
220     reference\r
221       "RFC 3174: US Secure Hash Algorithm 1 (SHA1)";\r
222   }\r
223 \r
224   identity hmac-sha1-96 {\r
225     base mac-algorithm;\r
226     description\r
227       "Generating MAC using SHA1 hash function";\r
228     reference\r
229       "RFC 2404: The Use of HMAC-SHA-1-96 within ESP and AH";\r
230   }\r
231 \r
232   identity hmac-sha2-224 {\r
233     base mac-algorithm;\r
234     description\r
235       "Generating MAC using SHA2 hash function";\r
236     reference\r
237       "RFC 6234:\r
238          US Secure Hash Algorithms (SHA and SHA-based HMAC and\r
239          HKDF)";\r
240   }\r
241 \r
242   identity hmac-sha2-256 {\r
243     base mac-algorithm;\r
244     description\r
245       "Generating MAC using SHA2 hash function";\r
246     reference\r
247       "RFC 6234:\r
248          US Secure Hash Algorithms (SHA and SHA-based HMAC and\r
249          HKDF)";\r
250   }\r
251 \r
252   identity hmac-sha2-256-128 {\r
253     base mac-algorithm;\r
254     description\r
255       "Generating a 256 bits MAC using SHA2 hash function and\r
256        truncate it to 128 bits";\r
257     reference\r
258       "RFC 4868:\r
259          Using HMAC-SHA-256, HMAC-SHA-384, and HMAC-SHA-512\r
260          with IPsec";\r
261   }\r
262 \r
263   identity hmac-sha2-384 {\r
264     base mac-algorithm;\r
265     description\r
266       "Generating MAC using SHA2 hash function";\r
267     reference\r
268       "RFC 6234:\r
269          US Secure Hash Algorithms (SHA and SHA-based HMAC and\r
270          HKDF)";\r
271   }\r
272 \r
273   identity hmac-sha2-384-192 {\r
274     base mac-algorithm;\r
275     description\r
276       "Generating a 384 bits MAC using SHA2 hash function and\r
277        truncate it to 192 bits";\r
278     reference\r
279       "RFC 4868:\r
280          Using HMAC-SHA-256, HMAC-SHA-384, and HMAC-SHA-512 with\r
281          IPsec";\r
282   }\r
283 \r
284   identity hmac-sha2-512 {\r
285     base mac-algorithm;\r
286     description\r
287       "Generating MAC using SHA2 hash function";\r
288     reference\r
289       "RFC 6234:\r
290          US Secure Hash Algorithms (SHA and SHA-based HMAC and\r
291          HKDF)";\r
292   }\r
293 \r
294   identity hmac-sha2-512-256 {\r
295     base mac-algorithm;\r
296     description\r
297       "Generating a 512 bits MAC using SHA2 hash function and\r
298        truncating it to 256 bits";\r
299     reference\r
300       "RFC 4868:\r
301          Using HMAC-SHA-256, HMAC-SHA-384, and HMAC-SHA-512 with\r
302          IPsec";\r
303   }\r
304 \r
305   identity aes-128-gmac {\r
306     base mac-algorithm;\r
307     description\r
308       "Generating MAC using the Advanced Encryption Standard (AES)\r
309        Galois Message Authentication Code (GMAC) as a mechanism to\r
310        provide data origin authentication";\r
311     reference\r
312       "RFC 4543:\r
313          The Use of Galois Message Authentication Code (GMAC) in\r
314          IPsec ESP and AH";\r
315   }\r
316 \r
317   identity aes-192-gmac {\r
318     base mac-algorithm;\r
319     description\r
320       "Generating MAC using the Advanced Encryption Standard (AES)\r
321        Galois Message Authentication Code (GMAC) as a mechanism to\r
322        provide data origin authentication";\r
323     reference\r
324       "RFC 4543:\r
325          The Use of Galois Message Authentication Code (GMAC) in\r
326          IPsec ESP and AH";\r
327   }\r
328 \r
329   identity aes-256-gmac {\r
330     base mac-algorithm;\r
331     description\r
332       "Generating MAC using the Advanced Encryption Standard (AES)\r
333        Galois Message Authentication Code (GMAC) as a mechanism to\r
334        provide data origin authentication";\r
335     reference\r
336       "RFC 4543:\r
337          The Use of Galois Message Authentication Code (GMAC) in\r
338          IPsec ESP and AH";\r
339   }\r
340 \r
341   identity aes-cmac-96 {\r
342     base mac-algorithm;\r
343     description\r
344       "Generating MAC using Advanced Encryption Standard (AES)\r
345        Cipher-based Message Authentication Code (CMAC)";\r
346     reference\r
347       "RFC 4494: The AES-CMAC-96 Algorithm and its Use with IPsec";\r
348   }\r
349 \r
350   identity aes-cmac-128 {\r
351     base mac-algorithm;\r
352     description\r
353       "Generating MAC using Advanced Encryption Standard (AES)\r
354        Cipher-based Message Authentication Code (CMAC)";\r
355     reference\r
356       "RFC 4493: The AES-CMAC Algorithm";\r
357   }\r
358 \r
359   /********************************************/\r
360   /*   Identities for Encryption Algorithms   */\r
361   /********************************************/\r
362 \r
363   identity encryption-algorithm {\r
364     description\r
365       "A base identity for encryption algorithm.";\r
366   }\r
367 \r
368   identity aes-128-cbc {\r
369     base encryption-algorithm;\r
370     description\r
371       "Encrypt message with AES algorithm in CBC mode with a key\r
372        length of 128 bits";\r
373     reference\r
374       "RFC 3565:\r
375          Use of the Advanced Encryption Standard (AES) Encryption\r
376          Algorithm in Cryptographic Message Syntax (CMS)";\r
377   }\r
378 \r
379   identity aes-192-cbc {\r
380     base encryption-algorithm;\r
381     description\r
382       "Encrypt message with AES algorithm in CBC mode with a key\r
383        length of 192 bits";\r
384     reference\r
385       "RFC 3565:\r
386          Use of the Advanced Encryption Standard (AES) Encryption\r
387          Algorithm in Cryptographic Message Syntax (CMS)";\r
388   }\r
389 \r
390   identity aes-256-cbc {\r
391     base encryption-algorithm;\r
392     description\r
393       "Encrypt message with AES algorithm in CBC mode with a key\r
394        length of 256 bits";\r
395     reference\r
396       "RFC 3565:\r
397          Use of the Advanced Encryption Standard (AES) Encryption\r
398          Algorithm in Cryptographic Message Syntax (CMS)";\r
399   }\r
400 \r
401   identity aes-128-ctr {\r
402     base encryption-algorithm;\r
403     description\r
404       "Encrypt message with AES algorithm in CTR mode with a key\r
405        length of 128 bits";\r
406     reference\r
407       "RFC 3686:\r
408          Using Advanced Encryption Standard (AES) Counter Mode with\r
409          IPsec Encapsulating Security Payload (ESP)";\r
410   }\r
411   identity aes-192-ctr {\r
412     base encryption-algorithm;\r
413     description\r
414       "Encrypt message with AES algorithm in CTR mode with a key\r
415        length of 192 bits";\r
416     reference\r
417       "RFC 3686:\r
418          Using Advanced Encryption Standard (AES) Counter Mode with\r
419          IPsec Encapsulating Security Payload (ESP)";\r
420   }\r
421 \r
422   identity aes-256-ctr {\r
423     base encryption-algorithm;\r
424     description\r
425       "Encrypt message with AES algorithm in CTR mode with a key\r
426        length of 256 bits";\r
427     reference\r
428       "RFC 3686:\r
429          Using Advanced Encryption Standard (AES) Counter Mode with\r
430          IPsec Encapsulating Security Payload (ESP)";\r
431   }\r
432 \r
433   /****************************************************/\r
434   /*   Identities for Encryption and MAC Algorithms   */\r
435   /****************************************************/\r
436 \r
437   identity encryption-and-mac-algorithm {\r
438     description\r
439       "A base identity for encryption and MAC algorithm.";\r
440   }\r
441 \r
442   identity aes-128-ccm {\r
443     base encryption-and-mac-algorithm;\r
444     description\r
445       "Encrypt message with AES algorithm in CCM mode with a key\r
446        length of 128 bits; it can also be used for generating MAC";\r
447     reference\r
448       "RFC 4309:\r
449          Using Advanced Encryption Standard (AES) CCM Mode with\r
450          IPsec Encapsulating Security Payload (ESP)";\r
451   }\r
452 \r
453   identity aes-192-ccm {\r
454     base encryption-and-mac-algorithm;\r
455     description\r
456       "Encrypt message with AES algorithm in CCM mode with a key\r
457        length of 192 bits; it can also be used for generating MAC";\r
458     reference\r
459       "RFC 4309:\r
460          Using Advanced Encryption Standard (AES) CCM Mode with\r
461          IPsec Encapsulating Security Payload (ESP)";\r
462   }\r
463 \r
464   identity aes-256-ccm {\r
465     base encryption-and-mac-algorithm;\r
466     description\r
467       "Encrypt message with AES algorithm in CCM mode with a key\r
468        length of 256 bits; it can also be used for generating MAC";\r
469     reference\r
470       "RFC 4309:\r
471          Using Advanced Encryption Standard (AES) CCM Mode with\r
472          IPsec Encapsulating Security Payload (ESP)";\r
473   }\r
474 \r
475   identity aes-128-gcm {\r
476     base encryption-and-mac-algorithm;\r
477     description\r
478       "Encrypt message with AES algorithm in GCM mode with a key\r
479        length of 128 bits; it can also be used for generating MAC";\r
480     reference\r
481       "RFC 4106:\r
482          The Use of Galois/Counter Mode (GCM) in IPsec Encapsulating\r
483          Security Payload (ESP)";\r
484   }\r
485 \r
486   identity aes-192-gcm {\r
487     base encryption-and-mac-algorithm;\r
488     description\r
489       "Encrypt message with AES algorithm in GCM mode with a key\r
490        length of 192 bits; it can also be used for generating MAC";\r
491     reference\r
492       "RFC 4106:\r
493          The Use of Galois/Counter Mode (GCM) in IPsec Encapsulating\r
494          Security Payload (ESP)";\r
495   }\r
496 \r
497   identity mac-aes-256-gcm {\r
498     base encryption-and-mac-algorithm;\r
499     description\r
500       "Encrypt message with AES algorithm in GCM mode with a key\r
501        length of 128 bits; it can also be used for generating MAC";\r
502     reference\r
503       "RFC 4106:\r
504          The Use of Galois/Counter Mode (GCM) in IPsec Encapsulating\r
505          Security Payload (ESP)";\r
506   }\r
507   identity chacha20-poly1305 {\r
508     base encryption-and-mac-algorithm;\r
509     description\r
510       "Encrypt message with chacha20 algorithm and generate MAC with\r
511        POLY1305; it can also be used for generating MAC";\r
512     reference\r
513       "RFC 8439: ChaCha20 and Poly1305 for IETF Protocols";\r
514   }\r
515 \r
516   /******************************************/\r
517   /*   Identities for signature algorithm   */\r
518   /******************************************/\r
519 \r
520   identity signature-algorithm {\r
521     description\r
522       "A base identity for asymmetric key encryption algorithm.";\r
523   }\r
524 \r
525   identity dsa-sha1 {\r
526     base signature-algorithm;\r
527     description\r
528       "The signature algorithm using DSA algorithm with SHA1 hash\r
529        algorithm";\r
530     reference\r
531       "RFC 4253: The Secure Shell (SSH) Transport Layer Protocol";\r
532   }\r
533 \r
534   identity rsassa-pkcs1-sha1 {\r
535     base signature-algorithm;\r
536     description\r
537       "The signature algorithm using RSASSA-PKCS1-v1_5 with the SHA1\r
538        hash algorithm.";\r
539     reference\r
540       "RFC 4253: The Secure Shell (SSH) Transport Layer Protocol";\r
541   }\r
542 \r
543   identity rsassa-pkcs1-sha256 {\r
544     base signature-algorithm;\r
545     description\r
546       "The signature algorithm using RSASSA-PKCS1-v1_5 with the\r
547        SHA256 hash algorithm.";\r
548     reference\r
549       "RFC 8332:\r
550          Use of RSA Keys with SHA-256 and SHA-512 in the Secure Shell\r
551          (SSH) Protocol\r
552        RFC 8446:\r
553          The Transport Layer Security (TLS) Protocol Version 1.3";\r
554   }\r
555   identity rsassa-pkcs1-sha384 {\r
556     base signature-algorithm;\r
557     description\r
558       "The signature algorithm using RSASSA-PKCS1-v1_5 with the\r
559        SHA384 hash algorithm.";\r
560     reference\r
561       "RFC 8446:\r
562          The Transport Layer Security (TLS) Protocol Version 1.3";\r
563   }\r
564 \r
565   identity rsassa-pkcs1-sha512 {\r
566     base signature-algorithm;\r
567     description\r
568       "The signature algorithm using RSASSA-PKCS1-v1_5 with the\r
569        SHA512 hash algorithm.";\r
570     reference\r
571       "RFC 8332:\r
572          Use of RSA Keys with SHA-256 and SHA-512 in the Secure Shell\r
573          (SSH) Protocol\r
574        RFC 8446:\r
575          The Transport Layer Security (TLS) Protocol Version 1.3";\r
576   }\r
577 \r
578   identity rsassa-pss-rsae-sha256 {\r
579     base signature-algorithm;\r
580     description\r
581       "The signature algorithm using RSASSA-PSS with mask generation\r
582        function 1 and SHA256 hash algorithm. If the public key is\r
583        carried in an X.509 certificate, it MUST use the rsaEncryption\r
584        OID";\r
585     reference\r
586       "RFC 8446:\r
587          The Transport Layer Security (TLS) Protocol Version 1.3";\r
588   }\r
589 \r
590   identity rsassa-pss-rsae-sha384 {\r
591     base signature-algorithm;\r
592     description\r
593       "The signature algorithm using RSASSA-PSS with mask generation\r
594        function 1 and SHA384 hash algorithm. If the public key is\r
595        carried in an X.509 certificate, it MUST use the rsaEncryption\r
596        OID";\r
597     reference\r
598       "RFC 8446:\r
599          The Transport Layer Security (TLS) Protocol Version 1.3";\r
600   }\r
601 \r
602   identity rsassa-pss-rsae-sha512 {\r
603     base signature-algorithm;\r
604     description\r
605       "The signature algorithm using RSASSA-PSS with mask generation\r
606        function 1 and SHA512 hash algorithm. If the public key is\r
607        carried in an X.509 certificate, it MUST use the rsaEncryption\r
608        OID";\r
609     reference\r
610       "RFC 8446:\r
611          The Transport Layer Security (TLS) Protocol Version 1.3";\r
612   }\r
613 \r
614   identity rsassa-pss-pss-sha256 {\r
615     base signature-algorithm;\r
616     description\r
617       "The signature algorithm using RSASSA-PSS with mask generation\r
618        function 1 and SHA256 hash algorithm. If the public key is\r
619        carried in an X.509 certificate, it MUST use the RSASSA-PSS\r
620        OID";\r
621     reference\r
622       "RFC 8446:\r
623          The Transport Layer Security (TLS) Protocol Version 1.3";\r
624   }\r
625 \r
626   identity rsassa-pss-pss-sha384 {\r
627     base signature-algorithm;\r
628     description\r
629       "The signature algorithm using RSASSA-PSS with mask generation\r
630        function 1 and SHA256 hash algorithm. If the public key is\r
631        carried in an X.509 certificate, it MUST use the RSASSA-PSS\r
632        OID";\r
633     reference\r
634       "RFC 8446:\r
635          The Transport Layer Security (TLS) Protocol Version 1.3";\r
636   }\r
637 \r
638   identity rsassa-pss-pss-sha512 {\r
639     base signature-algorithm;\r
640     description\r
641       "The signature algorithm using RSASSA-PSS with mask generation\r
642        function 1 and SHA256 hash algorithm. If the public key is\r
643        carried in an X.509 certificate, it MUST use the RSASSA-PSS\r
644        OID";\r
645     reference\r
646       "RFC 8446:\r
647          The Transport Layer Security (TLS) Protocol Version 1.3";\r
648   }\r
649 \r
650   identity ecdsa-secp256r1-sha256 {\r
651     base signature-algorithm;\r
652     description\r
653       "The signature algorithm using ECDSA with curve name secp256r1\r
654        and SHA256 hash algorithm.";\r
655     reference\r
656       "RFC 5656: Elliptic Curve Algorithm Integration in the\r
657          Secure Shell Transport Layer\r
658        RFC 8446:\r
659          The Transport Layer Security (TLS) Protocol Version 1.3";\r
660   }\r
661 \r
662   identity ecdsa-secp384r1-sha384 {\r
663     base signature-algorithm;\r
664     description\r
665       "The signature algorithm using ECDSA with curve name secp384r1\r
666        and SHA384 hash algorithm.";\r
667     reference\r
668       "RFC 5656: Elliptic Curve Algorithm Integration in the\r
669          Secure Shell Transport Layer\r
670        RFC 8446:\r
671          The Transport Layer Security (TLS) Protocol Version 1.3";\r
672   }\r
673 \r
674   identity ecdsa-secp521r1-sha512 {\r
675     base signature-algorithm;\r
676     description\r
677       "The signature algorithm using ECDSA with curve name secp521r1\r
678        and SHA512 hash algorithm.";\r
679     reference\r
680       "RFC 5656: Elliptic Curve Algorithm Integration in the\r
681          Secure Shell Transport Layer\r
682        RFC 8446:\r
683          The Transport Layer Security (TLS) Protocol Version 1.3";\r
684   }\r
685 \r
686   identity ed25519 {\r
687     base signature-algorithm;\r
688     description\r
689       "The signature algorithm using EdDSA as defined in RFC 8032 or\r
690        its successors.";\r
691     reference\r
692       "RFC 8032: Edwards-Curve Digital Signature Algorithm (EdDSA)";\r
693   }\r
694 \r
695   identity ed448 {\r
696     base signature-algorithm;\r
697     description\r
698       "The signature algorithm using EdDSA as defined in RFC 8032 or\r
699        its successors.";\r
700     reference\r
701       "RFC 8032: Edwards-Curve Digital Signature Algorithm (EdDSA)";\r
702   }\r
703 \r
704   identity eccsi {\r
705     base signature-algorithm;\r
706     description\r
707       "The signature algorithm using ECCSI signature as defined in\r
708        RFC 6507.";\r
709     reference\r
710       "RFC 6507:\r
711          Elliptic Curve-Based Certificateless Signatures for\r
712          Identity-based Encryption (ECCSI)";\r
713   }\r
714 \r
715   /**********************************************/\r
716   /*   Identities for key exchange algorithms   */\r
717   /**********************************************/\r
718 \r
719   identity key-exchange-algorithm {\r
720     description\r
721       "A base identity for Diffie-Hellman based key exchange\r
722        algorithm.";\r
723   }\r
724 \r
725   identity psk-only {\r
726     base key-exchange-algorithm;\r
727     description\r
728       "Using Pre-shared key for authentication and key exchange";\r
729     reference\r
730       "RFC 4279:\r
731          Pre-Shared Key cipher suites for Transport Layer Security\r
732         (TLS)";\r
733   }\r
734 \r
735   identity dhe-ffdhe2048 {\r
736     base key-exchange-algorithm;\r
737     description\r
738       "Ephemeral Diffie Hellman key exchange with 2048 bit\r
739        finite field";\r
740     reference\r
741       "RFC 7919:\r
742          Negotiated Finite Field Diffie-Hellman Ephemeral Parameters\r
743          for Transport Layer Security (TLS)";\r
744   }\r
745 \r
746   identity dhe-ffdhe3072 {\r
747     base key-exchange-algorithm;\r
748     description\r
749       "Ephemeral Diffie Hellman key exchange with 3072 bit finite\r
750        field";\r
751     reference\r
752       "RFC 7919:\r
753          Negotiated Finite Field Diffie-Hellman Ephemeral Parameters\r
754          for Transport Layer Security (TLS)";\r
755   }\r
756 \r
757   identity dhe-ffdhe4096 {\r
758     base key-exchange-algorithm;\r
759     description\r
760       "Ephemeral Diffie Hellman key exchange with 4096 bit\r
761        finite field";\r
762     reference\r
763       "RFC 7919:\r
764          Negotiated Finite Field Diffie-Hellman Ephemeral Parameters\r
765          for Transport Layer Security (TLS)";\r
766   }\r
767 \r
768   identity dhe-ffdhe6144 {\r
769     base key-exchange-algorithm;\r
770     description\r
771       "Ephemeral Diffie Hellman key exchange with 6144 bit\r
772        finite field";\r
773     reference\r
774       "RFC 7919:\r
775          Negotiated Finite Field Diffie-Hellman Ephemeral Parameters\r
776          for Transport Layer Security (TLS)";\r
777   }\r
778 \r
779   identity dhe-ffdhe8192 {\r
780     base key-exchange-algorithm;\r
781     description\r
782       "Ephemeral Diffie Hellman key exchange with 8192 bit\r
783        finite field";\r
784     reference\r
785       "RFC 7919:\r
786          Negotiated Finite Field Diffie-Hellman Ephemeral Parameters\r
787          for Transport Layer Security (TLS)";\r
788   }\r
789 \r
790   identity psk-dhe-ffdhe2048 {\r
791     base key-exchange-algorithm;\r
792     description\r
793       "Key exchange using pre-shared key with Diffie-Hellman key\r
794        generation mechanism, where the DH group is FFDHE2048";\r
795     reference\r
796       "RFC 8446:\r
797          The Transport Layer Security (TLS) Protocol Version 1.3";\r
798   }\r
799 \r
800   identity psk-dhe-ffdhe3072 {\r
801     base key-exchange-algorithm;\r
802     description\r
803       "Key exchange using pre-shared key with Diffie-Hellman key\r
804        generation mechanism, where the DH group is FFDHE3072";\r
805     reference\r
806       "RFC 8446:\r
807          The Transport Layer Security (TLS) Protocol Version 1.3";\r
808   }\r
809 \r
810   identity psk-dhe-ffdhe4096 {\r
811     base key-exchange-algorithm;\r
812     description\r
813       "Key exchange using pre-shared key with Diffie-Hellman key\r
814        generation mechanism, where the DH group is FFDHE4096";\r
815     reference\r
816       "RFC 8446:\r
817          The Transport Layer Security (TLS) Protocol Version 1.3";\r
818   }\r
819 \r
820   identity psk-dhe-ffdhe6144 {\r
821     base key-exchange-algorithm;\r
822     description\r
823       "Key exchange using pre-shared key with Diffie-Hellman key\r
824        generation mechanism, where the DH group is FFDHE6144";\r
825     reference\r
826       "RFC 8446:\r
827          The Transport Layer Security (TLS) Protocol Version 1.3";\r
828   }\r
829 \r
830   identity psk-dhe-ffdhe8192 {\r
831     base key-exchange-algorithm;\r
832     description\r
833       "Key exchange using pre-shared key with Diffie-Hellman key\r
834        generation mechanism, where the DH group is FFDHE8192";\r
835     reference\r
836       "RFC 8446:\r
837          The Transport Layer Security (TLS) Protocol Version 1.3";\r
838   }\r
839 \r
840   identity ecdhe-secp256r1 {\r
841     base key-exchange-algorithm;\r
842     description\r
843       "Ephemeral Diffie Hellman key exchange with elliptic group\r
844        over curve secp256r1";\r
845     reference\r
846       "RFC 8422:\r
847          Elliptic Curve Cryptography (ECC) Cipher Suites for\r
848          Transport Layer Security (TLS) Versions 1.2 and Earlier";\r
849   }\r
850 \r
851   identity ecdhe-secp384r1 {\r
852     base key-exchange-algorithm;\r
853     description\r
854       "Ephemeral Diffie Hellman key exchange with elliptic group\r
855        over curve secp384r1";\r
856     reference\r
857       "RFC 8422:\r
858          Elliptic Curve Cryptography (ECC) Cipher Suites for\r
859          Transport Layer Security (TLS) Versions 1.2 and Earlier";\r
860   }\r
861 \r
862   identity ecdhe-secp521r1 {\r
863     base key-exchange-algorithm;\r
864     description\r
865       "Ephemeral Diffie Hellman key exchange with elliptic group\r
866        over curve secp521r1";\r
867     reference\r
868       "RFC 8422:\r
869          Elliptic Curve Cryptography (ECC) Cipher Suites for\r
870          Transport Layer Security (TLS) Versions 1.2 and Earlier";\r
871   }\r
872 \r
873   identity ecdhe-x25519 {\r
874     base key-exchange-algorithm;\r
875     description\r
876       "Ephemeral Diffie Hellman key exchange with elliptic group\r
877        over curve x25519";\r
878     reference\r
879       "RFC 8422:\r
880          Elliptic Curve Cryptography (ECC) Cipher Suites for\r
881          Transport Layer Security (TLS) Versions 1.2 and Earlier";\r
882   }\r
883 \r
884   identity ecdhe-x448 {\r
885     base key-exchange-algorithm;\r
886     description\r
887       "Ephemeral Diffie Hellman key exchange with elliptic group\r
888        over curve x448";\r
889     reference\r
890       "RFC 8422:\r
891          Elliptic Curve Cryptography (ECC) Cipher Suites for\r
892          Transport Layer Security (TLS) Versions 1.2 and Earlier";\r
893   }\r
894 \r
895   identity psk-ecdhe-secp256r1 {\r
896     base key-exchange-algorithm;\r
897     description\r
898       "Key exchange using pre-shared key with elliptic group-based\r
899        Ephemeral Diffie Hellman key exchange over curve secp256r1";\r
900     reference\r
901       "RFC 8446:\r
902          The Transport Layer Security (TLS) Protocol Version 1.3";\r
903   }\r
904 \r
905   identity psk-ecdhe-secp384r1 {\r
906     base key-exchange-algorithm;\r
907     description\r
908       "Key exchange using pre-shared key with elliptic group-based\r
909        Ephemeral Diffie Hellman key exchange over curve secp384r1";\r
910     reference\r
911       "RFC 8446:\r
912          The Transport Layer Security (TLS) Protocol Version 1.3";\r
913   }\r
914 \r
915   identity psk-ecdhe-secp521r1 {\r
916     base key-exchange-algorithm;\r
917     description\r
918       "Key exchange using pre-shared key with elliptic group-based\r
919        Ephemeral Diffie Hellman key exchange over curve secp521r1";\r
920     reference\r
921       "RFC 8446:\r
922          The Transport Layer Security (TLS) Protocol Version 1.3";\r
923   }\r
924 \r
925   identity psk-ecdhe-x25519 {\r
926     base key-exchange-algorithm;\r
927     description\r
928       "Key exchange using pre-shared key with elliptic group-based\r
929        Ephemeral Diffie Hellman key exchange over curve x25519";\r
930     reference\r
931       "RFC 8446:\r
932          The Transport Layer Security (TLS) Protocol Version 1.3";\r
933   }\r
934 \r
935   identity psk-ecdhe-x448 {\r
936     base key-exchange-algorithm;\r
937     description\r
938       "Key exchange using pre-shared key with elliptic group-based\r
939        Ephemeral Diffie Hellman key exchange over curve x448";\r
940     reference\r
941       "RFC 8446:\r
942          The Transport Layer Security (TLS) Protocol Version 1.3";\r
943   }\r
944 \r
945   identity diffie-hellman-group14-sha1 {\r
946     base key-exchange-algorithm;\r
947     description\r
948       "Using DH group14 and SHA1 for key exchange";\r
949     reference\r
950       "RFC 4253: The Secure Shell (SSH) Transport Layer Protocol";\r
951   }\r
952 \r
953   identity diffie-hellman-group14-sha256 {\r
954     base key-exchange-algorithm;\r
955     description\r
956       "Using DH group14 and SHA256 for key exchange";\r
957     reference\r
958       "RFC 8268:\r
959          More Modular Exponentiation (MODP) Diffie-Hellman (DH)\r
960          Key Exchange (KEX) Groups for Secure Shell (SSH)";\r
961   }\r
962 \r
963   identity diffie-hellman-group15-sha512 {\r
964     base key-exchange-algorithm;\r
965     description\r
966       "Using DH group15 and SHA512 for key exchange";\r
967     reference\r
968       "RFC 8268:\r
969          More Modular Exponentiation (MODP) Diffie-Hellman (DH)\r
970          Key Exchange (KEX) Groups for Secure Shell (SSH)";\r
971   }\r
972 \r
973   identity diffie-hellman-group16-sha512 {\r
974     base key-exchange-algorithm;\r
975     description\r
976       "Using DH group16 and SHA512 for key exchange";\r
977     reference\r
978       "RFC 8268:\r
979          More Modular Exponentiation (MODP) Diffie-Hellman (DH)\r
980          Key Exchange (KEX) Groups for Secure Shell (SSH)";\r
981   }\r
982 \r
983   identity diffie-hellman-group17-sha512 {\r
984     base key-exchange-algorithm;\r
985     description\r
986       "Using DH group17 and SHA512 for key exchange";\r
987 \r
988     reference\r
989       "RFC 8268:\r
990          More Modular Exponentiation (MODP) Diffie-Hellman (DH)\r
991          Key Exchange (KEX) Groups for Secure Shell (SSH)";\r
992   }\r
993 \r
994   identity diffie-hellman-group18-sha512 {\r
995     base key-exchange-algorithm;\r
996     description\r
997       "Using DH group18 and SHA512 for key exchange";\r
998     reference\r
999       "RFC 8268:\r
1000          More Modular Exponentiation (MODP) Diffie-Hellman (DH)\r
1001          Key Exchange (KEX) Groups for Secure Shell (SSH)";\r
1002   }\r
1003 \r
1004   identity ecdh-sha2-secp256r1 {\r
1005     base key-exchange-algorithm;\r
1006     description\r
1007       "Elliptic curve-based Diffie Hellman key exchange over curve\r
1008        secp256r1 and using SHA2 for MAC generation";\r
1009     reference\r
1010       "RFC 6239: Suite B Cryptographic Suites for Secure Shell\r
1011        (SSH)";\r
1012   }\r
1013 \r
1014   identity ecdh-sha2-secp384r1 {\r
1015     base key-exchange-algorithm;\r
1016     description\r
1017       "Elliptic curve-based Diffie Hellman key exchange over curve\r
1018        secp384r1 and using SHA2 for MAC generation";\r
1019     reference\r
1020       "RFC 6239: Suite B Cryptographic Suites for Secure Shell\r
1021        (SSH)";\r
1022   }\r
1023 \r
1024   identity rsaes-oaep {\r
1025     base key-exchange-algorithm;\r
1026     description\r
1027       "RSAES-OAEP combines the RSAEP and RSADP primitives with the\r
1028        EME-OAEP encoding method";\r
1029     reference\r
1030       "RFC 8017:\r
1031          PKCS #1: RSA Cryptography Specifications Version 2.2.";\r
1032   }\r
1033 \r
1034   identity rsaes-pkcs1-v1_5 {\r
1035     base key-exchange-algorithm;\r
1036     description\r
1037       " RSAES-PKCS1-v1_5 combines the RSAEP and RSADP primitives\r
1038         with the EME-PKCS1-v1_5 encoding method";\r
1039     reference\r
1040       "RFC 8017:\r
1041          PKCS #1: RSA Cryptography Specifications Version 2.2.";\r
1042   }\r
1043 \r
1044   /**********************************************************/\r
1045   /*   Typedefs for identityrefs to above base identities   */\r
1046   /**********************************************************/\r
1047 \r
1048   typedef hash-algorithm-ref {\r
1049     type identityref {\r
1050       base hash-algorithm;\r
1051     }\r
1052     description\r
1053       "This typedef enables importing modules to easily define an\r
1054        identityref to the 'hash-algorithm' base identity.";\r
1055   }\r
1056 \r
1057   typedef signature-algorithm-ref {\r
1058     type identityref {\r
1059       base signature-algorithm;\r
1060     }\r
1061     description\r
1062       "This typedef enables importing modules to easily define an\r
1063        identityref to the 'signature-algorithm' base identity.";\r
1064   }\r
1065 \r
1066   typedef mac-algorithm-ref {\r
1067     type identityref {\r
1068       base mac-algorithm;\r
1069     }\r
1070     description\r
1071       "This typedef enables importing modules to easily define an\r
1072        identityref to the 'mac-algorithm' base identity.";\r
1073   }\r
1074 \r
1075   typedef encryption-algorithm-ref {\r
1076     type identityref {\r
1077       base encryption-algorithm;\r
1078     }\r
1079     description\r
1080       "This typedef enables importing modules to easily define an\r
1081        identityref to the 'encryption-algorithm'\r
1082        base identity.";\r
1083   }\r
1084 \r
1085   typedef encryption-and-mac-algorithm-ref {\r
1086     type identityref {\r
1087       base encryption-and-mac-algorithm;\r
1088     }\r
1089     description\r
1090       "This typedef enables importing modules to easily define an\r
1091        identityref to the 'encryption-and-mac-algorithm'\r
1092        base identity.";\r
1093   }\r
1094 \r
1095   typedef asymmetric-key-algorithm-ref {\r
1096     type identityref {\r
1097       base asymmetric-key-algorithm;\r
1098     }\r
1099     description\r
1100       "This typedef enables importing modules to easily define an\r
1101        identityref to the 'asymmetric-key-algorithm'\r
1102        base identity.";\r
1103   }\r
1104 \r
1105   typedef key-exchange-algorithm-ref {\r
1106     type identityref {\r
1107       base key-exchange-algorithm;\r
1108     }\r
1109     description\r
1110       "This typedef enables importing modules to easily define an\r
1111        identityref to the 'key-exchange-algorithm' base identity.";\r
1112   }\r
1113 \r
1114   /***************************************************/\r
1115   /*   Typedefs for ASN.1 structures from RFC 5280   */\r
1116   /***************************************************/\r
1117 \r
1118   typedef x509 {\r
1119     type binary;\r
1120     description\r
1121       "A Certificate structure, as specified in RFC 5280,\r
1122        encoded using ASN.1 distinguished encoding rules (DER),\r
1123        as specified in ITU-T X.690.";\r
1124     reference\r
1125       "RFC 5280:\r
1126          Internet X.509 Public Key Infrastructure Certificate\r
1127          and Certificate Revocation List (CRL) Profile\r
1128        ITU-T X.690:\r
1129          Information technology - ASN.1 encoding rules:\r
1130          Specification of Basic Encoding Rules (BER),\r
1131          Canonical Encoding Rules (CER) and Distinguished\r
1132          Encoding Rules (DER).";\r
1133   }\r
1134 \r
1135   typedef crl {\r
1136     type binary;\r
1137     description\r
1138       "A CertificateList structure, as specified in RFC 5280,\r
1139        encoded using ASN.1 distinguished encoding rules (DER),\r
1140        as specified in ITU-T X.690.";\r
1141     reference\r
1142       "RFC 5280:\r
1143          Internet X.509 Public Key Infrastructure Certificate\r
1144          and Certificate Revocation List (CRL) Profile\r
1145        ITU-T X.690:\r
1146          Information technology - ASN.1 encoding rules:\r
1147          Specification of Basic Encoding Rules (BER),\r
1148          Canonical Encoding Rules (CER) and Distinguished\r
1149          Encoding Rules (DER).";\r
1150   }\r
1151 \r
1152   /***********************************************/\r
1153   /*   Typedefs for ASN.1 structures from 5652   */\r
1154   /***********************************************/\r
1155 \r
1156   typedef cms {\r
1157     type binary;\r
1158     description\r
1159       "A ContentInfo structure, as specified in RFC 5652,\r
1160        encoded using ASN.1 distinguished encoding rules (DER),\r
1161        as specified in ITU-T X.690.";\r
1162     reference\r
1163       "RFC 5652:\r
1164          Cryptographic Message Syntax (CMS)\r
1165        ITU-T X.690:\r
1166          Information technology - ASN.1 encoding rules:\r
1167          Specification of Basic Encoding Rules (BER),\r
1168          Canonical Encoding Rules (CER) and Distinguished\r
1169          Encoding Rules (DER).";\r
1170   }\r
1171 \r
1172   typedef data-content-cms {\r
1173     type cms;\r
1174     description\r
1175       "A CMS structure whose top-most content type MUST be the\r
1176        data content type, as described by Section 4 in RFC 5652.";\r
1177     reference\r
1178       "RFC 5652: Cryptographic Message Syntax (CMS)";\r
1179   }\r
1180 \r
1181   typedef signed-data-cms {\r
1182     type cms;\r
1183     description\r
1184       "A CMS structure whose top-most content type MUST be the\r
1185        signed-data content type, as described by Section 5 in\r
1186        RFC 5652.";\r
1187     reference\r
1188       "RFC 5652: Cryptographic Message Syntax (CMS)";\r
1189   }\r
1190 \r
1191   typedef enveloped-data-cms {\r
1192     type cms;\r
1193     description\r
1194       "A CMS structure whose top-most content type MUST be the\r
1195        enveloped-data content type, as described by Section 6\r
1196        in RFC 5652.";\r
1197     reference\r
1198       "RFC 5652: Cryptographic Message Syntax (CMS)";\r
1199   }\r
1200 \r
1201   typedef digested-data-cms {\r
1202     type cms;\r
1203     description\r
1204       "A CMS structure whose top-most content type MUST be the\r
1205        digested-data content type, as described by Section 7\r
1206        in RFC 5652.";\r
1207     reference\r
1208       "RFC 5652: Cryptographic Message Syntax (CMS)";\r
1209   }\r
1210 \r
1211   typedef encrypted-data-cms {\r
1212     type cms;\r
1213     description\r
1214       "A CMS structure whose top-most content type MUST be the\r
1215        encrypted-data content type, as described by Section 8\r
1216        in RFC 5652.";\r
1217     reference\r
1218       "RFC 5652: Cryptographic Message Syntax (CMS)";\r
1219   }\r
1220 \r
1221   typedef authenticated-data-cms {\r
1222     type cms;\r
1223     description\r
1224       "A CMS structure whose top-most content type MUST be the\r
1225        authenticated-data content type, as described by Section 9\r
1226        in RFC 5652.";\r
1227     reference\r
1228       "RFC 5652: Cryptographic Message Syntax (CMS)";\r
1229   }\r
1230 \r
1231   /***************************************************/\r
1232   /*   Typedefs for structures related to RFC 4253   */\r
1233   /***************************************************/\r
1234 \r
1235   typedef ssh-host-key {\r
1236     type binary;\r
1237     description\r
1238       "The binary public key data for this SSH key, as\r
1239        specified by RFC 4253, Section 6.6, i.e.:\r
1240 \r
1241          string    certificate or public key format\r
1242                    identifier\r
1243          byte[n]   key/certificate data.";\r
1244     reference\r
1245       "RFC 4253: The Secure Shell (SSH) Transport Layer\r
1246                  Protocol";\r
1247   }\r
1248 \r
1249   /*********************************************************/\r
1250   /*   Typedefs for ASN.1 structures related to RFC 5280   */\r
1251   /*********************************************************/\r
1252 \r
1253   typedef trust-anchor-cert-x509 {\r
1254     type x509;\r
1255     description\r
1256       "A Certificate structure that MUST encode a self-signed\r
1257        root certificate.";\r
1258   }\r
1259 \r
1260   typedef end-entity-cert-x509 {\r
1261     type x509;\r
1262     description\r
1263       "A Certificate structure that MUST encode a certificate\r
1264        that is neither self-signed nor having Basic constraint\r
1265        CA true.";\r
1266   }\r
1267 \r
1268   /*********************************************************/\r
1269   /*   Typedefs for ASN.1 structures related to RFC 5652   */\r
1270   /*********************************************************/\r
1271 \r
1272   typedef trust-anchor-cert-cms {\r
1273     type signed-data-cms;\r
1274     description\r
1275       "A CMS SignedData structure that MUST contain the chain of\r
1276        X.509 certificates needed to authenticate the certificate\r
1277        presented by a client or end-entity.\r
1278 \r
1279        The CMS MUST contain only a single chain of certificates.\r
1280        The client or end-entity certificate MUST only authenticate\r
1281        to last intermediate CA certificate listed in the chain.\r
1282 \r
1283        In all cases, the chain MUST include a self-signed root\r
1284        certificate.  In the case where the root certificate is\r
1285        itself the issuer of the client or end-entity certificate,\r
1286        only one certificate is present.\r
1287 \r
1288        This CMS structure MAY (as applicable where this type is\r
1289        used) also contain suitably fresh (as defined by local\r
1290        policy) revocation objects with which the device can\r
1291        verify the revocation status of the certificates.\r
1292 \r
1293        This CMS encodes the degenerate form of the SignedData\r
1294        structure that is commonly used to disseminate X.509\r
1295        certificates and revocation objects (RFC 5280).";\r
1296     reference\r
1297       "RFC 5280:\r
1298          Internet X.509 Public Key Infrastructure Certificate\r
1299          and Certificate Revocation List (CRL) Profile.";\r
1300   }\r
1301 \r
1302   typedef end-entity-cert-cms {\r
1303     type signed-data-cms;\r
1304     description\r
1305       "A CMS SignedData structure that MUST contain the end\r
1306        entity certificate itself, and MAY contain any number\r
1307        of intermediate certificates leading up to a trust\r
1308        anchor certificate.  The trust anchor certificate\r
1309        MAY be included as well.\r
1310 \r
1311        The CMS MUST contain a single end entity certificate.\r
1312        The CMS MUST NOT contain any spurious certificates.\r
1313 \r
1314        This CMS structure MAY (as applicable where this type is\r
1315        used) also contain suitably fresh (as defined by local\r
1316        policy) revocation objects with which the device can\r
1317        verify the revocation status of the certificates.\r
1318 \r
1319        This CMS encodes the degenerate form of the SignedData\r
1320        structure that is commonly used to disseminate X.509\r
1321        certificates and revocation objects (RFC 5280).";\r
1322     reference\r
1323       "RFC 5280:\r
1324          Internet X.509 Public Key Infrastructure Certificate\r
1325          and Certificate Revocation List (CRL) Profile.";\r
1326   }\r
1327 \r
1328   /**********************************************/\r
1329   /*   Groupings for keys and/or certificates   */\r
1330   /**********************************************/\r
1331 \r
1332   grouping public-key-grouping {\r
1333     description\r
1334       "A public key.\r
1335 \r
1336        The 'algorithm' and 'public-key' nodes are not\r
1337        mandatory because they MAY be defined in <operational>.\r
1338        Implementations SHOULD assert that these values are\r
1339        either configured or that they exist in <operational>.";\r
1340     leaf algorithm {\r
1341       nacm:default-deny-write;\r
1342       type asymmetric-key-algorithm-ref;\r
1343       must '../public-key';\r
1344       description\r
1345         "Identifies the key's algorithm.  More specifically,\r
1346          this leaf specifies how the 'public-key' binary leaf\r
1347          is encoded.";\r
1348       reference\r
1349         "RFC CCCC: Common YANG Data Types for Cryptography";\r
1350     }\r
1351     leaf public-key {\r
1352       nacm:default-deny-write;\r
1353       type binary;\r
1354       must '../algorithm';\r
1355       description\r
1356         "A binary that contains the value of the public key.  The\r
1357          interpretation of the content is defined by the key\r
1358          algorithm.  For example, a DSA key is an integer, an RSA\r
1359          key is represented as RSAPublicKey as defined in\r
1360          RFC 8017, and an Elliptic Curve Cryptography (ECC) key\r
1361          is represented using the 'publicKey' described in\r
1362          RFC 5915.";\r
1363       reference\r
1364         "RFC 8017: Public-Key Cryptography Standards (PKCS) #1:\r
1365                    RSA Cryptography Specifications Version 2.2.\r
1366          RFC 5915: Elliptic Curve Private Key Structure.";\r
1367     }\r
1368   }\r
1369 \r
1370   grouping asymmetric-key-pair-grouping {\r
1371     description\r
1372       "A private/public key pair.\r
1373        The 'algorithm', 'public-key', and 'private-key'  nodes are\r
1374        not mandatory because they MAY be defined in <operational>.\r
1375        Implementations SHOULD assert that these values are either\r
1376        configured or that they exist in <operational>.";\r
1377     uses public-key-grouping;\r
1378     leaf private-key {\r
1379       nacm:default-deny-all;\r
1380       type union {\r
1381         type binary;\r
1382         type enumeration {\r
1383           enum permanently-hidden {\r
1384             description\r
1385               "The private key is inaccessible due to being\r
1386                protected by the system (e.g., a cryptographic\r
1387                hardware module).\r
1388 \r
1389                How such keys are backed-up and restored, if\r
1390                at all, is implementation specific.\r
1391 \r
1392                Servers MUST fail any attempt by a client to\r
1393                configure this value directly.  This value is\r
1394                not set by clients, but rather is set by the\r
1395                'generate-hidden-key' and 'install-hidden-key'\r
1396                actions.";\r
1397           }\r
1398         }\r
1399       }\r
1400       must '../public-key';\r
1401       description\r
1402         "A binary that contains the value of the private key.  The\r
1403          interpretation of the content is defined by the key\r
1404          algorithm.  For example, a DSA key is an integer, an RSA\r
1405          key is represented as RSAPrivateKey as defined in\r
1406          RFC 8017, and an Elliptic Curve Cryptography (ECC) key\r
1407          is represented as ECPrivateKey as defined in RFC 5915.";\r
1408       reference\r
1409         "RFC 8017: Public-Key Cryptography Standards (PKCS) #1:\r
1410                    RSA Cryptography Specifications Version 2.2.\r
1411          RFC 5915: Elliptic Curve Private Key Structure.";\r
1412     } // private-key\r
1413 \r
1414     action generate-hidden-key {\r
1415       nacm:default-deny-all;\r
1416       description\r
1417         "Requests the device to generate a hidden key using the\r
1418          specified asymmetric key algorithm.  This action is\r
1419          used to request the system to generate a key that is\r
1420          'permanently-hidden', perhaps protected by a cryptographic\r
1421          hardware module.  The resulting asymmetric key values are\r
1422          considered operational state and hence present only in\r
1423          <operational> and bound to the lifetime of the parent\r
1424          'config true' node.  Subsequent invocations of this or\r
1425          the 'install-hidden-key' action are denied with error-tag\r
1426          'data-exists'.";\r
1427       input {\r
1428         leaf algorithm {\r
1429           type asymmetric-key-algorithm-ref;\r
1430           mandatory true;\r
1431           description\r
1432             "The algorithm to be used when generating the\r
1433              asymmetric key.";\r
1434           reference\r
1435             "RFC CCCC: Common YANG Data Types for Cryptography";\r
1436         }\r
1437       }\r
1438     } // generate-hidden-key\r
1439 \r
1440     action install-hidden-key {\r
1441       nacm:default-deny-all;\r
1442       description\r
1443         "Requests the device to load the specified values into\r
1444          a hidden key.  The resulting asymmetric key values are\r
1445          considered operational state and hence present only in\r
1446          <operational> and bound to the lifetime of the parent\r
1447          'config true' node.  Subsequent invocations of this\r
1448          or the 'generate-hidden-key' action are denied with\r
1449          error-tag 'data-exists'.";\r
1450       input {\r
1451         leaf algorithm {\r
1452           type asymmetric-key-algorithm-ref;\r
1453           mandatory true;\r
1454           description\r
1455             "The algorithm to be used when generating the\r
1456              asymmetric key.";\r
1457           reference\r
1458             "RFC CCCC: Common YANG Data Types for Cryptography";\r
1459         }\r
1460         leaf public-key {\r
1461           type binary;\r
1462           description\r
1463             "A binary that contains the value of the public key.\r
1464              The interpretation of the content is defined by the key\r
1465              algorithm.  For example, a DSA key is an integer, an\r
1466              RSA key is represented as RSAPublicKey as defined in\r
1467              RFC 8017, and an Elliptic Curve Cryptography (ECC) key\r
1468              is represented using the 'publicKey' described in\r
1469              RFC 5915.";\r
1470           reference\r
1471             "RFC 8017: Public-Key Cryptography Standards (PKCS) #1:\r
1472                        RSA Cryptography Specifications Version 2.2.\r
1473              RFC 5915: Elliptic Curve Private Key Structure.";\r
1474         }\r
1475         leaf private-key {\r
1476           type binary;\r
1477           description\r
1478             "A binary that contains the value of the private key.\r
1479              The interpretation of the content is defined by the key\r
1480              algorithm.  For example, a DSA key is an integer, an RSA\r
1481              key is represented as RSAPrivateKey as defined in\r
1482              RFC 8017, and an Elliptic Curve Cryptography (ECC) key\r
1483              is represented as ECPrivateKey as defined in RFC 5915.";\r
1484           reference\r
1485             "RFC 8017: Public-Key Cryptography Standards (PKCS) #1:\r
1486                        RSA Cryptography Specifications Version 2.2.\r
1487              RFC 5915: Elliptic Curve Private Key Structure.";\r
1488         }\r
1489       }\r
1490     } // install-hidden-key\r
1491   } // asymmetric-key-pair-grouping\r
1492 \r
1493 \r
1494   grouping trust-anchor-cert-grouping {\r
1495     description\r
1496       "A trust anchor certificate, and a notification for when\r
1497        it is about to (or already has) expire.";\r
1498     leaf cert {\r
1499       nacm:default-deny-write;\r
1500       type trust-anchor-cert-cms;\r
1501       description\r
1502         "The binary certificate data for this certificate.";\r
1503       reference\r
1504         "RFC YYYY: Common YANG Data Types for Cryptography";\r
1505     }\r
1506     notification certificate-expiration {\r
1507       description\r
1508         "A notification indicating that the configured certificate\r
1509          is either about to expire or has already expired.  When to\r
1510          send notifications is an implementation specific decision,\r
1511          but it is RECOMMENDED that a notification be sent once a\r
1512          month for 3 months, then once a week for four weeks, and\r
1513          then once a day thereafter until the issue is resolved.";\r
1514       leaf expiration-date {\r
1515         type yang:date-and-time;\r
1516         mandatory true;\r
1517         description\r
1518           "Identifies the expiration date on the certificate.";\r
1519       }\r
1520     }\r
1521   }\r
1522 \r
1523   grouping trust-anchor-certs-grouping {\r
1524     description\r
1525       "A list of trust anchor certificates, and a notification\r
1526        for when one is about to (or already has) expire.";\r
1527     leaf-list cert {\r
1528       nacm:default-deny-write;\r
1529       type trust-anchor-cert-cms;\r
1530       description\r
1531         "The binary certificate data for this certificate.";\r
1532       reference\r
1533         "RFC YYYY: Common YANG Data Types for Cryptography";\r
1534     }\r
1535     notification certificate-expiration {\r
1536       description\r
1537         "A notification indicating that the configured certificate\r
1538          is either about to expire or has already expired.  When to\r
1539          send notifications is an implementation specific decision,\r
1540          but it is RECOMMENDED that a notification be sent once a\r
1541          month for 3 months, then once a week for four weeks, and\r
1542          then once a day thereafter until the issue is resolved.";\r
1543       leaf expiration-date {\r
1544         type yang:date-and-time;\r
1545         mandatory true;\r
1546         description\r
1547           "Identifies the expiration date on the certificate.";\r
1548       }\r
1549     }\r
1550   }\r
1551 \r
1552   grouping end-entity-cert-grouping {\r
1553     description\r
1554       "An end entity certificate, and a notification for when\r
1555        it is about to (or already has) expire.";\r
1556     leaf cert {\r
1557       nacm:default-deny-write;\r
1558       type end-entity-cert-cms;\r
1559       description\r
1560         "The binary certificate data for this certificate.";\r
1561       reference\r
1562         "RFC YYYY: Common YANG Data Types for Cryptography";\r
1563     }\r
1564     notification certificate-expiration {\r
1565       description\r
1566         "A notification indicating that the configured certificate\r
1567          is either about to expire or has already expired.  When to\r
1568          send notifications is an implementation specific decision,\r
1569          but it is RECOMMENDED that a notification be sent once a\r
1570          month for 3 months, then once a week for four weeks, and\r
1571          then once a day thereafter until the issue is resolved.";\r
1572       leaf expiration-date {\r
1573         type yang:date-and-time;\r
1574         mandatory true;\r
1575         description\r
1576           "Identifies the expiration date on the certificate.";\r
1577       }\r
1578     }\r
1579   }\r
1580 \r
1581   grouping end-entity-certs-grouping {\r
1582     description\r
1583       "A list of end entity certificates, and a notification for\r
1584        when one is about to (or already has) expire.";\r
1585     leaf-list cert {\r
1586       nacm:default-deny-write;\r
1587       type end-entity-cert-cms;\r
1588       description\r
1589         "The binary certificate data for this certificate.";\r
1590       reference\r
1591         "RFC YYYY: Common YANG Data Types for Cryptography";\r
1592     }\r
1593     notification certificate-expiration {\r
1594       description\r
1595         "A notification indicating that the configured certificate\r
1596          is either about to expire or has already expired.  When to\r
1597          send notifications is an implementation specific decision,\r
1598          but it is RECOMMENDED that a notification be sent once a\r
1599          month for 3 months, then once a week for four weeks, and\r
1600          then once a day thereafter until the issue is resolved.";\r
1601       leaf expiration-date {\r
1602         type yang:date-and-time;\r
1603         mandatory true;\r
1604         description\r
1605           "Identifies the expiration date on the certificate.";\r
1606       }\r
1607     }\r
1608   }\r
1609 \r
1610   grouping asymmetric-key-pair-with-cert-grouping {\r
1611     description\r
1612       "A private/public key pair and an associated certificate.";\r
1613     uses asymmetric-key-pair-grouping;\r
1614     uses end-entity-cert-grouping;\r
1615 \r
1616     action generate-certificate-signing-request {\r
1617       nacm:default-deny-all;\r
1618       description\r
1619         "Generates a certificate signing request structure for\r
1620          the associated asymmetric key using the passed subject\r
1621          and attribute values.  The specified assertions need\r
1622          to be appropriate for the certificate's use.  For\r
1623          example, an entity certificate for a TLS server\r
1624          SHOULD have values that enable clients to satisfy\r
1625          RFC 6125 processing.";\r
1626       input {\r
1627         leaf subject {\r
1628           type binary;\r
1629           mandatory true;\r
1630           description\r
1631             "The 'subject' field per the CertificationRequestInfo\r
1632               structure as specified by RFC 2986, Section 4.1\r
1633               encoded using the ASN.1 distinguished encoding\r
1634               rules (DER), as specified in ITU-T X.690.";\r
1635           reference\r
1636             "RFC 2986:\r
1637                PKCS #10: Certification Request Syntax\r
1638                          Specification Version 1.7.\r
1639              ITU-T X.690:\r
1640                Information technology - ASN.1 encoding rules:\r
1641                Specification of Basic Encoding Rules (BER),\r
1642                Canonical Encoding Rules (CER) and Distinguished\r
1643                Encoding Rules (DER).";\r
1644         }\r
1645         leaf attributes {\r
1646           type binary;\r
1647           description\r
1648             "The 'attributes' field from the structure\r
1649              CertificationRequestInfo as specified by RFC 2986,\r
1650              Section 4.1 encoded using the ASN.1 distinguished\r
1651              encoding rules (DER), as specified in ITU-T X.690.";\r
1652           reference\r
1653             "RFC 2986:\r
1654                PKCS #10: Certification Request Syntax\r
1655                          Specification Version 1.7.\r
1656              ITU-T X.690:\r
1657                Information technology - ASN.1 encoding rules:\r
1658                Specification of Basic Encoding Rules (BER),\r
1659                Canonical Encoding Rules (CER) and Distinguished\r
1660                Encoding Rules (DER).";\r
1661         }\r
1662       }\r
1663       output {\r
1664         leaf certificate-signing-request {\r
1665           type binary;\r
1666           mandatory true;\r
1667           description\r
1668             "A CertificationRequest structure as specified by\r
1669              RFC 2986, Section 4.2 encoded using the ASN.1\r
1670              distinguished encoding rules (DER), as specified\r
1671              in ITU-T X.690.";\r
1672           reference\r
1673             "RFC 2986:\r
1674                PKCS #10: Certification Request Syntax\r
1675                          Specification Version 1.7.\r
1676              ITU-T X.690:\r
1677                Information technology - ASN.1 encoding rules:\r
1678                Specification of Basic Encoding Rules (BER),\r
1679                Canonical Encoding Rules (CER) and Distinguished\r
1680                Encoding Rules (DER).";\r
1681         }\r
1682       }\r
1683     } // generate-certificate-signing-request\r
1684   } // asymmetric-key-pair-with-cert-grouping\r
1685 \r
1686 \r
1687   grouping asymmetric-key-pair-with-certs-grouping {\r
1688     description\r
1689       "A private/public key pair and associated certificates.";\r
1690     uses asymmetric-key-pair-grouping;\r
1691     container certificates {\r
1692       nacm:default-deny-write;\r
1693       description\r
1694         "Certificates associated with this asymmetric key.\r
1695          More than one certificate supports, for instance,\r
1696          a TPM-protected asymmetric key that has both IDevID\r
1697          and LDevID certificates associated.";\r
1698       list certificate {\r
1699         key "name";\r
1700         description\r
1701           "A certificate for this asymmetric key.";\r
1702         leaf name {\r
1703           type string;\r
1704           description\r
1705             "An arbitrary name for the certificate.  If the name\r
1706              matches the name of a certificate that exists\r
1707              independently in <operational> (i.e., an IDevID),\r
1708              then the 'cert' node MUST NOT be configured.";\r
1709         }\r
1710         uses end-entity-cert-grouping;\r
1711       }\r
1712     } // certificates\r
1713 \r
1714     action generate-certificate-signing-request {\r
1715       nacm:default-deny-all;\r
1716       description\r
1717         "Generates a certificate signing request structure for\r
1718          the associated asymmetric key using the passed subject\r
1719          and attribute values.  The specified assertions need\r
1720          to be appropriate for the certificate's use.  For\r
1721          example, an entity certificate for a TLS server\r
1722          SHOULD have values that enable clients to satisfy\r
1723          RFC 6125 processing.";\r
1724       input {\r
1725         leaf subject {\r
1726           type binary;\r
1727           mandatory true;\r
1728           description\r
1729             "The 'subject' field per the CertificationRequestInfo\r
1730               structure as specified by RFC 2986, Section 4.1\r
1731               encoded using the ASN.1 distinguished encoding\r
1732               rules (DER), as specified in ITU-T X.690.";\r
1733           reference\r
1734             "RFC 2986:\r
1735                PKCS #10: Certification Request Syntax\r
1736                          Specification Version 1.7.\r
1737              ITU-T X.690:\r
1738                Information technology - ASN.1 encoding rules:\r
1739                Specification of Basic Encoding Rules (BER),\r
1740                Canonical Encoding Rules (CER) and Distinguished\r
1741                Encoding Rules (DER).";\r
1742         }\r
1743         leaf attributes {\r
1744           type binary;\r
1745           description\r
1746             "The 'attributes' field from the structure\r
1747              CertificationRequestInfo as specified by RFC 2986,\r
1748              Section 4.1 encoded using the ASN.1 distinguished\r
1749              encoding rules (DER), as specified in ITU-T X.690.";\r
1750           reference\r
1751             "RFC 2986:\r
1752                PKCS #10: Certification Request Syntax\r
1753                          Specification Version 1.7.\r
1754              ITU-T X.690:\r
1755                Information technology - ASN.1 encoding rules:\r
1756                Specification of Basic Encoding Rules (BER),\r
1757                Canonical Encoding Rules (CER) and Distinguished\r
1758                Encoding Rules (DER).";\r
1759         }\r
1760       }\r
1761       output {\r
1762         leaf certificate-signing-request {\r
1763           type binary;\r
1764           mandatory true;\r
1765           description\r
1766             "A CertificationRequest structure as specified by\r
1767              RFC 2986, Section 4.2 encoded using the ASN.1\r
1768              distinguished encoding rules (DER), as specified\r
1769              in ITU-T X.690.";\r
1770           reference\r
1771             "RFC 2986:\r
1772                PKCS #10: Certification Request Syntax\r
1773                          Specification Version 1.7.\r
1774              ITU-T X.690:\r
1775                Information technology - ASN.1 encoding rules:\r
1776                Specification of Basic Encoding Rules (BER),\r
1777                Canonical Encoding Rules (CER) and Distinguished\r
1778                Encoding Rules (DER).";\r
1779         }\r
1780       }\r
1781     } // generate-certificate-signing-request\r
1782   } // asymmetric-key-pair-with-certs-grouping\r
1783 }\r