-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathex-crypto-types-usage.yang
132 lines (126 loc) · 3.53 KB
/
ex-crypto-types-usage.yang
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
module ex-crypto-types-usage {
yang-version 1.1;
namespace "https://example.com/ns/example-crypto-types-usage";
prefix ectu;
import ietf-crypto-types {
prefix ct;
reference
"RFC AAAA: YANG Data Types and Groupings for Cryptography";
}
organization
"Example Corporation";
contact
"YANG Designer <mailto:[email protected]>";
description
"This example module illustrates the 'symmetric-key-grouping'
and 'asymmetric-key-grouping' groupings defined in the
'ietf-crypto-types' module defined in RFC AAAA.";
revision YYYY-MM-DD {
description
"Initial version";
reference
"RFC AAAA: Common YANG Data Types for Cryptography";
}
container symmetric-keys {
description
"A container of symmetric keys.";
list symmetric-key {
key "name";
description
"A symmetric key";
leaf name {
type string;
description
"An arbitrary name for this key.";
}
uses ct:symmetric-key-grouping {
augment "key-type/encrypted-symmetric-key/"
+ "encrypted-symmetric-key/encrypted-by" {
description
"Augments in a choice statement enabling the
encrypting key to be any other symmetric or
asymmetric key.";
uses encrypted-by-grouping;
}
}
}
}
container asymmetric-keys {
description
"A container of asymmetric keys.";
list asymmetric-key {
key "name";
leaf name {
type string;
description
"An arbitrary name for this key.";
}
uses ct:asymmetric-key-pair-with-certs-grouping {
augment "private-key-type/encrypted-private-key/"
+ "encrypted-private-key/encrypted-by" {
description
"Augments in a choice statement enabling the
encrypting key to be any other symmetric or
asymmetric key.";
uses encrypted-by-grouping;
}
}
description
"An asymmetric key pair with associated certificates.";
}
}
container passwords {
description
"A container of passwords.";
list password {
key "name";
leaf name {
type string;
description
"An arbitrary name for this password.";
}
uses ct:password-grouping {
augment "password-type/encrypted-password/"
+ "encrypted-password/encrypted-by" {
description
"Augments in a choice statement enabling the
encrypting key to be any symmetric or
asymmetric key.";
uses encrypted-by-grouping;
}
}
description
"A password.";
}
}
grouping encrypted-by-grouping {
description
"A grouping that defines a choice enabling references
to other keys.";
choice encrypted-by {
mandatory true;
description
"A choice amongst other symmetric or asymmetric keys.";
case symmetric-key-ref {
leaf symmetric-key-ref {
type leafref {
path "/ectu:symmetric-keys/ectu:symmetric-key/"
+ "ectu:name";
}
description
"Identifies the symmetric key that encrypts this key.";
}
}
case asymmetric-key-ref {
leaf asymmetric-key-ref {
type leafref {
path "/ectu:asymmetric-keys/ectu:asymmetric-key/"
+ "ectu:name";
}
description
"Identifies the asymmetric key that encrypts this key.";
}
}
}
}
}