draft-ietf-netconf-keystore-16.txt   draft-ietf-netconf-keystore-17.txt 
NETCONF Working Group K. Watsen NETCONF Working Group K. Watsen
Internet-Draft Watsen Networks Internet-Draft Watsen Networks
Intended status: Standards Track March 8, 2020 Intended status: Standards Track May 20, 2020
Expires: September 9, 2020 Expires: November 21, 2020
A YANG Data Model for a Keystore A YANG Data Model for a Keystore
draft-ietf-netconf-keystore-16 draft-ietf-netconf-keystore-17
Abstract Abstract
This document defines a YANG 1.1 module called "ietf-keystore" that This document defines a YANG 1.1 module called "ietf-keystore" that
enables centralized configuration of both symmetric and asymmetric enables centralized configuration of both symmetric and asymmetric
keys. The secret value for both key types may be encrypted. keys. The secret value for both key types may be encrypted.
Asymmetric keys may be associated with certificates. Notifications Asymmetric keys may be associated with certificates. Notifications
are sent when certificates are about to expire. are sent when certificates are about to expire.
Editorial Note (To be removed by RFC Editor) Editorial Note (To be removed by RFC Editor)
This draft contains many placeholder values that need to be replaced This draft contains placeholder values that need to be replaced with
with finalized values at the time of publication. This note finalized values at the time of publication. This note summarizes
summarizes all of the substitutions that are needed. No other RFC all of the substitutions that are needed. No other RFC Editor
Editor instructions are specified elsewhere in this document. instructions are specified elsewhere in this document.
Artwork in this document contains shorthand references to drafts in Artwork in this document contains shorthand references to drafts in
progress. Please apply the following replacements: progress. Please apply the following replacements:
o "AAAA" --> the assigned RFC value for o "AAAA" --> the assigned RFC value for draft-ietf-netconf-crypto-
[I-D.ietf-netconf-crypto-types]. types
o "XXXX" --> the assigned RFC value for this draft o "CCCC" --> the assigned RFC value for this draft
Artwork in this document contains placeholder values for the date of Artwork in this document contains placeholder values for the date of
publication of this draft. Please apply the following replacement: publication of this draft. Please apply the following replacement:
o "2020-03-08" --> the publication date of this draft o "2020-05-20" --> the publication date of this draft
The following Appendix section is to be removed prior to publication: The following Appendix section is to be removed prior to publication:
o Appendix A. Change Log o Appendix A. Change Log
Note to Reviewers (To be removed by RFC Editor)
This document presents a YANG module or modules that is/are part of a
collection of drafts that work together to produce the ultimate goal
of the NETCONF WG: to define configuration modules for NETCONF client
and servers, and RESTCONF client and servers.
The relationship between the various drafts in the collection is
presented in the below diagram.
crypto-types
^ ^
/ \
/ \
trust-anchors keystore
^ ^ ^ ^
| +---------+ | |
| | | |
| +------------+ |
tcp-client-server | / | |
^ ^ ssh-client-server | |
| | ^ tls-client-server
| | | ^ ^ http-client-server
| | | | | ^
| | | +-----+ +---------+ |
| | | | | |
| +-----------|--------|--------------+ | |
| | | | | |
+-----------+ | | | | |
| | | | | |
| | | | | |
netconf-client-server restconf-client-server
Full draft names and link to drafts:
o draft-ietf-netconf-crypto-types (html [1])
o draft-ietf-netconf-trust-anchors (html [2])
o draft-ietf-netconf-keystore (html [3])
o draft-ietf-netconf-tcp-client-server (html [4])
o draft-ietf-netconf-ssh-client-server (html [5])
o draft-ietf-netconf-tls-client-server (html [6])
o draft-ietf-netconf-http-client-server (html [7])
o draft-ietf-netconf-netconf-client-server (html [8])
o draft-ietf-netconf-restconf-client-server (html [9])
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on September 9, 2020. This Internet-Draft will expire on November 21, 2020.
Copyright Notice Copyright Notice
Copyright (c) 2020 IETF Trust and the persons identified as the Copyright (c) 2020 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4
2. Requirements Language . . . . . . . . . . . . . . . . . . . . 4 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 5
3. The Keystore Model . . . . . . . . . . . . . . . . . . . . . 4 3. The Keystore Model . . . . . . . . . . . . . . . . . . . . . 5
3.1. Tree Diagram . . . . . . . . . . . . . . . . . . . . . . 4 3.1. Tree Diagram . . . . . . . . . . . . . . . . . . . . . . 5
3.2. Example Usage . . . . . . . . . . . . . . . . . . . . . . 13 3.2. Example Usage . . . . . . . . . . . . . . . . . . . . . . 13
3.2.1. A Keystore Instance . . . . . . . . . . . . . . . . . 13 3.2.1. A Keystore Instance . . . . . . . . . . . . . . . . . 13
3.2.2. The "generate-symmetric-key" RPC . . . . . . . . . . 16 3.2.2. Notable Keystore Groupings . . . . . . . . . . . . . 16
3.2.3. The "generate-asymmetric-key" RPC . . . . . . . . . . 17 3.3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . 19
3.2.4. Notable Keystore Groupings . . . . . . . . . . . . . 18 4. Support for Built-in Keys . . . . . . . . . . . . . . . . . . 28
3.3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . 21 5. Encrypting Keys in Configuration . . . . . . . . . . . . . . 31
4. Support for Built-in Keys . . . . . . . . . . . . . . . . . . 32 5.1. Root Key . . . . . . . . . . . . . . . . . . . . . . . . 31
5. Support for RMAs . . . . . . . . . . . . . . . . . . . . . . 32 5.2. Configuring Encrypting Keys . . . . . . . . . . . . . . . 32
6. Security Considerations . . . . . . . . . . . . . . . . . . . 32 5.3. Migrating Configuration to Another Server . . . . . . . . 32
6. Security Considerations . . . . . . . . . . . . . . . . . . . 33
7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 34 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 34
7.1. The IETF XML Registry . . . . . . . . . . . . . . . . . . 34 7.1. The IETF XML Registry . . . . . . . . . . . . . . . . . . 34
7.2. The YANG Module Names Registry . . . . . . . . . . . . . 34 7.2. The YANG Module Names Registry . . . . . . . . . . . . . 35
8. References . . . . . . . . . . . . . . . . . . . . . . . . . 34 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 35
8.1. Normative References . . . . . . . . . . . . . . . . . . 34 8.1. Normative References . . . . . . . . . . . . . . . . . . 35
8.2. Informative References . . . . . . . . . . . . . . . . . 35 8.2. Informative References . . . . . . . . . . . . . . . . . 35
Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 36 8.3. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 36
A.1. 00 to 01 . . . . . . . . . . . . . . . . . . . . . . . . 36 Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 38
A.2. 01 to 02 . . . . . . . . . . . . . . . . . . . . . . . . 36 A.1. 00 to 01 . . . . . . . . . . . . . . . . . . . . . . . . 38
A.3. 02 to 03 . . . . . . . . . . . . . . . . . . . . . . . . 36 A.2. 01 to 02 . . . . . . . . . . . . . . . . . . . . . . . . 38
A.4. 03 to 04 . . . . . . . . . . . . . . . . . . . . . . . . 36 A.3. 02 to 03 . . . . . . . . . . . . . . . . . . . . . . . . 38
A.5. 04 to 05 . . . . . . . . . . . . . . . . . . . . . . . . 37 A.4. 03 to 04 . . . . . . . . . . . . . . . . . . . . . . . . 38
A.6. 05 to 06 . . . . . . . . . . . . . . . . . . . . . . . . 37 A.5. 04 to 05 . . . . . . . . . . . . . . . . . . . . . . . . 39
A.7. 06 to 07 . . . . . . . . . . . . . . . . . . . . . . . . 37 A.6. 05 to 06 . . . . . . . . . . . . . . . . . . . . . . . . 39
A.8. 07 to 08 . . . . . . . . . . . . . . . . . . . . . . . . 37 A.7. 06 to 07 . . . . . . . . . . . . . . . . . . . . . . . . 39
A.9. 08 to 09 . . . . . . . . . . . . . . . . . . . . . . . . 37 A.8. 07 to 08 . . . . . . . . . . . . . . . . . . . . . . . . 39
A.10. 09 to 10 . . . . . . . . . . . . . . . . . . . . . . . . 38 A.9. 08 to 09 . . . . . . . . . . . . . . . . . . . . . . . . 39
A.11. 10 to 11 . . . . . . . . . . . . . . . . . . . . . . . . 38 A.10. 09 to 10 . . . . . . . . . . . . . . . . . . . . . . . . 40
A.12. 11 to 12 . . . . . . . . . . . . . . . . . . . . . . . . 38 A.11. 10 to 11 . . . . . . . . . . . . . . . . . . . . . . . . 40
A.13. 12 to 13 . . . . . . . . . . . . . . . . . . . . . . . . 39 A.12. 11 to 12 . . . . . . . . . . . . . . . . . . . . . . . . 40
A.14. 13 to 14 . . . . . . . . . . . . . . . . . . . . . . . . 39 A.13. 12 to 13 . . . . . . . . . . . . . . . . . . . . . . . . 41
A.15. 14 to 15 . . . . . . . . . . . . . . . . . . . . . . . . 39 A.14. 13 to 14 . . . . . . . . . . . . . . . . . . . . . . . . 41
A.16. 15 to 16 . . . . . . . . . . . . . . . . . . . . . . . . 39 A.15. 14 to 15 . . . . . . . . . . . . . . . . . . . . . . . . 41
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 39 A.16. 15 to 16 . . . . . . . . . . . . . . . . . . . . . . . . 41
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 40 A.17. 16 to 17 . . . . . . . . . . . . . . . . . . . . . . . . 41
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 42
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 42
1. Introduction 1. Introduction
This document defines a YANG 1.1 [RFC7950] module called "ietf- This document defines a YANG 1.1 [RFC7950] module called "ietf-
keystore" that enables centralized configuration of both symmetric keystore" that enables centralized configuration of both symmetric
and asymmetric keys. The secret value for both key types may be and asymmetric keys. The secret value for both key types may be
encrypted. Asymmetric keys may be associated with certificates. encrypted. Asymmetric keys may be associated with certificates.
Notifications are sent when certificates are about to expire. Notifications are sent when certificates are about to expire.
The "ietf-keystore" module defines many "grouping" statements The "ietf-keystore" module defines many "grouping" statements
intended for use by other modules that may import it. For instance, intended for use by other modules that may import it. For instance,
there are groupings that defined enabling a key to be either there are groupings that defined enabling a key to be either
configured locally (within the defining data model) or be a reference configured locally (within the defining data model) or be a reference
to a key in the keystore. to a key in the Keystore.
Special consideration has been given for systems that have Special consideration has been given for systems that have
cryptographic hardware, such as a Trusted Protection Module (TPM). cryptographic hardware, such as a Trusted Protection Module (TPM).
These systems are unique in that the cryptographic hardware hides the These systems are unique in that the cryptographic hardware hides the
secret key values. To support such hardware, symmetric keys may have secret key values. To support such hardware, symmetric keys may have
the value "hidden-key" and asymmetric keys may have the value the value "hidden-key" and asymmetric keys may have the value
"hidden-private-key". While how such keys are created or destroyed "hidden-private-key". While how such keys are created or destroyed
is outside the scope of this document, the keystore can contain is outside the scope of this document, the Keystore can contain
entries for such keys, enabling them to be reference by other entries for such keys, enabling them to be referenced by other
configuration elements. configuration elements.
This document in compliant with Network Management Datastore This document in compliant with Network Management Datastore
Architecture (NMDA) [RFC8342]. For instance, keys and associated Architecture (NMDA) [RFC8342]. For instance, keys and associated
certificates installed during manufacturing (e.g., for a IDevID certificates installed during manufacturing (e.g., for a IDevID
[Std-802.1AR-2009] certificate), are expected to appear in [Std-802.1AR-2009] certificate), are expected to appear in
<operational> (see Section 4). <operational> (see Section 4).
It is not required that a system has an operating system level It is not required that a system has an operating system level
keystore utility to implement this module. Keystore utility to implement this module.
2. Requirements Language 2. Requirements Language
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP "OPTIONAL" in this document are to be interpreted as described in BCP
14 [RFC2119] [RFC8174] when, and only when, they appear in all 14 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here. capitals, as shown here.
3. The Keystore Model 3. The Keystore Model
skipping to change at page 4, line 29 skipping to change at page 5, line 38
This section provides a tree diagrams [RFC8340] for the "ietf- This section provides a tree diagrams [RFC8340] for the "ietf-
keystore" module that presents both the protocol-accessible keystore" module that presents both the protocol-accessible
"keystore" as well the all the groupings intended for external usage. "keystore" as well the all the groupings intended for external usage.
module: ietf-keystore module: ietf-keystore
+--rw keystore +--rw keystore
+--rw asymmetric-keys +--rw asymmetric-keys
| +--rw asymmetric-key* [name] | +--rw asymmetric-key* [name]
| +--rw name string | +--rw name string
| +--rw algorithm
| | iasa:asymmetric-algorithm-type
| +--rw public-key-format identityref | +--rw public-key-format identityref
| +--rw public-key binary | +--rw public-key binary
| +--rw private-key-format? identityref | +--rw private-key-format? identityref
| +--rw (private-key-type) | +--rw (private-key-type)
| | +--:(private-key) | | +--:(private-key)
| | | +--rw private-key? binary | | | +--rw private-key? binary
| | +--:(hidden-private-key) | | +--:(hidden-private-key)
| | | +--rw hidden-private-key? empty | | | +--rw hidden-private-key? empty
| | +--:(encrypted-private-key) | | +--:(encrypted-private-key)
| | +--rw encrypted-private-key | | +--rw encrypted-private-key
skipping to change at page 4, line 52 skipping to change at page 6, line 11
| | | +--:(symmetric-key-ref) | | | +--:(symmetric-key-ref)
| | | | +--rw symmetric-key-ref? leafref | | | | +--rw symmetric-key-ref? leafref
| | | | {keystore-supported}? | | | | {keystore-supported}?
| | | +--:(asymmetric-key-ref) | | | +--:(asymmetric-key-ref)
| | | +--rw asymmetric-key-ref? leafref | | | +--rw asymmetric-key-ref? leafref
| | | {keystore-supported}? | | | {keystore-supported}?
| | +--rw value? binary | | +--rw value? binary
| +--rw certificates | +--rw certificates
| | +--rw certificate* [name] | | +--rw certificate* [name]
| | +--rw name string | | +--rw name string
| | +--rw cert? end-entity-cert-cms | | +--rw cert end-entity-cert-cms
| | +---n certificate-expiration | | +---n certificate-expiration
| | +-- expiration-date yang:date-and-time | | +-- expiration-date yang:date-and-time
| +---x generate-certificate-signing-request | +---x generate-certificate-signing-request
| {certificate-signing-request-generation}?
| +---w input | +---w input
| | +---w subject binary | | +---w subject binary
| | +---w attributes? binary | | +---w attributes? binary
| +--ro output | +--ro output
| +--ro certificate-signing-request binary | +--ro certificate-signing-request ct:csr
+--rw symmetric-keys +--rw symmetric-keys
+--rw symmetric-key* [name] +--rw symmetric-key* [name]
+--rw name string +--rw name string
+--rw algorithm isa:symmetric-algorithm-type
+--rw key-format? identityref +--rw key-format? identityref
+--rw (key-type) +--rw (key-type)
+--:(key) +--:(key)
| +--rw key? binary | +--rw key? binary
+--:(hidden-key) +--:(hidden-key)
| +--rw hidden-key? empty | +--rw hidden-key? empty
+--:(encrypted-key) +--:(encrypted-key)
+--rw encrypted-key +--rw encrypted-key
+--rw (key-type) +--rw (key-type)
| +--:(symmetric-key-ref) | +--:(symmetric-key-ref)
| | +--rw symmetric-key-ref? leafref | | +--rw symmetric-key-ref? leafref
| | {keystore-supported}? | | {keystore-supported}?
| +--:(asymmetric-key-ref) | +--:(asymmetric-key-ref)
| +--rw asymmetric-key-ref? leafref | +--rw asymmetric-key-ref? leafref
| {keystore-supported}? | {keystore-supported}?
+--rw value? binary +--rw value? binary
augment /ct:generate-symmetric-key/ct:input:
+---w encrypt-with!
+---w (key-type)
+--:(symmetric-key-ref)
| +---w symmetric-key-ref?
| -> /keystore/symmetric-keys/symmetric-key/name
| {keystore-supported}?
+--:(asymmetric-key-ref)
+---w asymmetric-key-ref?
-> /keystore/asymmetric-keys/asymmetric-key/name
{keystore-supported}?
augment /ct:generate-symmetric-key/ct:output/ct:key-type:
+-- encrypted-key
+-- (key-type)
| +--:(symmetric-key-ref)
| | +-- symmetric-key-ref?
| | -> /keystore/symmetric-keys/symmetric-key/name
| | {keystore-supported}?
| +--:(asymmetric-key-ref)
| +-- asymmetric-key-ref?
| -> /keystore/asymmetric-keys/asymmetric-key/name
| {keystore-supported}?
+-- value? binary
augment /ct:generate-asymmetric-key/ct:input:
+---w encrypt-with!
+---w (key-type)
+--:(symmetric-key-ref)
| +---w symmetric-key-ref?
| -> /keystore/symmetric-keys/symmetric-key/name
| {keystore-supported}?
+--:(asymmetric-key-ref)
+---w asymmetric-key-ref?
-> /keystore/asymmetric-keys/asymmetric-key/name
{keystore-supported}?
augment /ct:generate-asymmetric-key/ct:output/ct:private-key-type:
+-- encrypted-private-key
+-- (key-type)
| +--:(symmetric-key-ref)
| | +-- symmetric-key-ref?
| | -> /keystore/symmetric-keys/symmetric-key/name
| | {keystore-supported}?
| +--:(asymmetric-key-ref)
| +-- asymmetric-key-ref?
| -> /keystore/asymmetric-keys/asymmetric-key/name
| {keystore-supported}?
+-- value? binary
grouping key-reference-type-grouping grouping key-reference-type-grouping
+-- (key-type) +-- (key-type)
+--:(symmetric-key-ref) +--:(symmetric-key-ref)
| +-- symmetric-key-ref? | +-- symmetric-key-ref?
| -> /keystore/symmetric-keys/symmetric-key/name | -> /keystore/symmetric-keys/symmetric-key/name
| {keystore-supported}? | {keystore-supported}?
+--:(asymmetric-key-ref) +--:(asymmetric-key-ref)
+-- asymmetric-key-ref? +-- asymmetric-key-ref?
-> /keystore/asymmetric-keys/asymmetric-key/name -> /keystore/asymmetric-keys/asymmetric-key/name
{keystore-supported}? {keystore-supported}?
skipping to change at page 7, line 6 skipping to change at page 7, line 15
| +--:(symmetric-key-ref) | +--:(symmetric-key-ref)
| | +-- symmetric-key-ref? | | +-- symmetric-key-ref?
| | -> /keystore/symmetric-keys/symmetric-key/name | | -> /keystore/symmetric-keys/symmetric-key/name
| | {keystore-supported}? | | {keystore-supported}?
| +--:(asymmetric-key-ref) | +--:(asymmetric-key-ref)
| +-- asymmetric-key-ref? | +-- asymmetric-key-ref?
| -> /keystore/asymmetric-keys/asymmetric-key/name | -> /keystore/asymmetric-keys/asymmetric-key/name
| {keystore-supported}? | {keystore-supported}?
+-- value? binary +-- value? binary
grouping symmetric-key-grouping grouping symmetric-key-grouping
+-- algorithm isa:symmetric-algorithm-type
+-- key-format? identityref +-- key-format? identityref
+-- (key-type) +-- (key-type)
+--:(key) +--:(key)
| +-- key? binary | +-- key? binary
+--:(hidden-key) +--:(hidden-key)
| +-- hidden-key? empty | +-- hidden-key? empty
+--:(encrypted-key) +--:(encrypted-key)
+-- encrypted-key +-- encrypted-key
+-- (key-type) +-- (key-type)
| +--:(symmetric-key-ref) | +--:(symmetric-key-ref)
| | +-- symmetric-key-ref? leafref | | +-- symmetric-key-ref? leafref
| | {keystore-supported}? | | {keystore-supported}?
| +--:(asymmetric-key-ref) | +--:(asymmetric-key-ref)
| +-- asymmetric-key-ref? leafref | +-- asymmetric-key-ref? leafref
| {keystore-supported}? | {keystore-supported}?
+-- value? binary +-- value? binary
grouping asymmetric-key-pair-grouping grouping asymmetric-key-pair-grouping
+-- algorithm iasa:asymmetric-algorithm-type
+-- public-key-format identityref +-- public-key-format identityref
+-- public-key binary +-- public-key binary
+-- private-key-format? identityref +-- private-key-format? identityref
+-- (private-key-type) +-- (private-key-type)
+--:(private-key) +--:(private-key)
| +-- private-key? binary | +-- private-key? binary
+--:(hidden-private-key) +--:(hidden-private-key)
| +-- hidden-private-key? empty | +-- hidden-private-key? empty
+--:(encrypted-private-key) +--:(encrypted-private-key)
+-- encrypted-private-key +-- encrypted-private-key
+-- (key-type) +-- (key-type)
| +--:(symmetric-key-ref) | +--:(symmetric-key-ref)
| | +-- symmetric-key-ref? leafref | | +-- symmetric-key-ref? leafref
| | {keystore-supported}? | | {keystore-supported}?
| +--:(asymmetric-key-ref) | +--:(asymmetric-key-ref)
| +-- asymmetric-key-ref? leafref | +-- asymmetric-key-ref? leafref
| {keystore-supported}? | {keystore-supported}?
+-- value? binary +-- value? binary
grouping asymmetric-key-pair-with-cert-grouping grouping asymmetric-key-pair-with-cert-grouping
+-- algorithm
| iasa:asymmetric-algorithm-type
+-- public-key-format identityref +-- public-key-format identityref
+-- public-key binary +-- public-key binary
+-- private-key-format? identityref +-- private-key-format? identityref
+-- (private-key-type) +-- (private-key-type)
| +--:(private-key) | +--:(private-key)
| | +-- private-key? binary | | +-- private-key? binary
| +--:(hidden-private-key) | +--:(hidden-private-key)
| | +-- hidden-private-key? empty | | +-- hidden-private-key? empty
| +--:(encrypted-private-key) | +--:(encrypted-private-key)
| +-- encrypted-private-key | +-- encrypted-private-key
skipping to change at page 8, line 20 skipping to change at page 8, line 25
| | | +-- symmetric-key-ref? leafref | | | +-- symmetric-key-ref? leafref
| | | {keystore-supported}? | | | {keystore-supported}?
| | +--:(asymmetric-key-ref) | | +--:(asymmetric-key-ref)
| | +-- asymmetric-key-ref? leafref | | +-- asymmetric-key-ref? leafref
| | {keystore-supported}? | | {keystore-supported}?
| +-- value? binary | +-- value? binary
+-- cert? end-entity-cert-cms +-- cert? end-entity-cert-cms
+---n certificate-expiration +---n certificate-expiration
| +-- expiration-date yang:date-and-time | +-- expiration-date yang:date-and-time
+---x generate-certificate-signing-request +---x generate-certificate-signing-request
{certificate-signing-request-generation}?
+---w input +---w input
| +---w subject binary | +---w subject binary
| +---w attributes? binary | +---w attributes? binary
+--ro output +--ro output
+--ro certificate-signing-request binary +--ro certificate-signing-request ct:csr
grouping asymmetric-key-pair-with-certs-grouping grouping asymmetric-key-pair-with-certs-grouping
+-- algorithm
| iasa:asymmetric-algorithm-type
+-- public-key-format identityref +-- public-key-format identityref
+-- public-key binary +-- public-key binary
+-- private-key-format? identityref +-- private-key-format? identityref
+-- (private-key-type) +-- (private-key-type)
| +--:(private-key) | +--:(private-key)
| | +-- private-key? binary | | +-- private-key? binary
| +--:(hidden-private-key) | +--:(hidden-private-key)
| | +-- hidden-private-key? empty | | +-- hidden-private-key? empty
| +--:(encrypted-private-key) | +--:(encrypted-private-key)
| +-- encrypted-private-key | +-- encrypted-private-key
skipping to change at page 8, line 49 skipping to change at page 9, line 5
| | +--:(symmetric-key-ref) | | +--:(symmetric-key-ref)
| | | +-- symmetric-key-ref? leafref | | | +-- symmetric-key-ref? leafref
| | | {keystore-supported}? | | | {keystore-supported}?
| | +--:(asymmetric-key-ref) | | +--:(asymmetric-key-ref)
| | +-- asymmetric-key-ref? leafref | | +-- asymmetric-key-ref? leafref
| | {keystore-supported}? | | {keystore-supported}?
| +-- value? binary | +-- value? binary
+-- certificates +-- certificates
| +-- certificate* [name] | +-- certificate* [name]
| +-- name? string | +-- name? string
| +-- cert? end-entity-cert-cms | +-- cert end-entity-cert-cms
| +---n certificate-expiration | +---n certificate-expiration
| +-- expiration-date yang:date-and-time | +-- expiration-date yang:date-and-time
+---x generate-certificate-signing-request +---x generate-certificate-signing-request
{certificate-signing-request-generation}?
+---w input +---w input
| +---w subject binary | +---w subject binary
| +---w attributes? binary | +---w attributes? binary
+--ro output +--ro output
+--ro certificate-signing-request binary +--ro certificate-signing-request ct:csr
grouping asymmetric-key-certificate-ref-grouping grouping asymmetric-key-certificate-ref-grouping
+-- asymmetric-key? ks:asymmetric-key-ref +-- asymmetric-key? ks:asymmetric-key-ref
+-- certificate? leafref +-- certificate? leafref
grouping local-or-keystore-symmetric-key-grouping grouping local-or-keystore-symmetric-key-grouping
+-- (local-or-keystore) +-- (local-or-keystore)
+--:(local) {local-definitions-supported}? +--:(local) {local-definitions-supported}?
| +-- local-definition | +-- local-definition
| +-- algorithm isa:symmetric-algorithm-type
| +-- key-format? identityref | +-- key-format? identityref
| +-- (key-type) | +-- (key-type)
| +--:(key) | +--:(key)
| | +-- key? binary | | +-- key? binary
| +--:(hidden-key) | +--:(hidden-key)
| | +-- hidden-key? empty | | +-- hidden-key? empty
| +--:(encrypted-key) | +--:(encrypted-key)
| +-- encrypted-key | +-- encrypted-key
| +-- (key-type) | +-- (key-type)
| | +--:(symmetric-key-ref) | | +--:(symmetric-key-ref)
skipping to change at page 9, line 40 skipping to change at page 9, line 44
| | +--:(asymmetric-key-ref) | | +--:(asymmetric-key-ref)
| | +-- asymmetric-key-ref? leafref | | +-- asymmetric-key-ref? leafref
| | {keystore-supported}? | | {keystore-supported}?
| +-- value? binary | +-- value? binary
+--:(keystore) {keystore-supported}? +--:(keystore) {keystore-supported}?
+-- keystore-reference? ks:symmetric-key-ref +-- keystore-reference? ks:symmetric-key-ref
grouping local-or-keystore-asymmetric-key-grouping grouping local-or-keystore-asymmetric-key-grouping
+-- (local-or-keystore) +-- (local-or-keystore)
+--:(local) {local-definitions-supported}? +--:(local) {local-definitions-supported}?
| +-- local-definition | +-- local-definition
| +-- algorithm
| | iasa:asymmetric-algorithm-type
| +-- public-key-format identityref | +-- public-key-format identityref
| +-- public-key binary | +-- public-key binary
| +-- private-key-format? identityref | +-- private-key-format? identityref
| +-- (private-key-type) | +-- (private-key-type)
| +--:(private-key) | +--:(private-key)
| | +-- private-key? binary | | +-- private-key? binary
| +--:(hidden-private-key) | +--:(hidden-private-key)
| | +-- hidden-private-key? empty | | +-- hidden-private-key? empty
| +--:(encrypted-private-key) | +--:(encrypted-private-key)
| +-- encrypted-private-key | +-- encrypted-private-key
skipping to change at page 10, line 18 skipping to change at page 10, line 20
| | +--:(asymmetric-key-ref) | | +--:(asymmetric-key-ref)
| | +-- asymmetric-key-ref? leafref | | +-- asymmetric-key-ref? leafref
| | {keystore-supported}? | | {keystore-supported}?
| +-- value? binary | +-- value? binary
+--:(keystore) {keystore-supported}? +--:(keystore) {keystore-supported}?
+-- keystore-reference? ks:asymmetric-key-ref +-- keystore-reference? ks:asymmetric-key-ref
grouping local-or-keystore-asymmetric-key-with-certs-grouping grouping local-or-keystore-asymmetric-key-with-certs-grouping
+-- (local-or-keystore) +-- (local-or-keystore)
+--:(local) {local-definitions-supported}? +--:(local) {local-definitions-supported}?
| +-- local-definition | +-- local-definition
| +-- algorithm
| | iasa:asymmetric-algorithm-type
| +-- public-key-format identityref | +-- public-key-format identityref
| +-- public-key binary | +-- public-key binary
| +-- private-key-format? identityref | +-- private-key-format? identityref
| +-- (private-key-type) | +-- (private-key-type)
| | +--:(private-key) | | +--:(private-key)
| | | +-- private-key? binary | | | +-- private-key? binary
| | +--:(hidden-private-key) | | +--:(hidden-private-key)
| | | +-- hidden-private-key? empty | | | +-- hidden-private-key? empty
| | +--:(encrypted-private-key) | | +--:(encrypted-private-key)
| | +-- encrypted-private-key | | +-- encrypted-private-key
skipping to change at page 10, line 41 skipping to change at page 10, line 41
| | | +--:(symmetric-key-ref) | | | +--:(symmetric-key-ref)
| | | | +-- symmetric-key-ref? leafref | | | | +-- symmetric-key-ref? leafref
| | | | {keystore-supported}? | | | | {keystore-supported}?
| | | +--:(asymmetric-key-ref) | | | +--:(asymmetric-key-ref)
| | | +-- asymmetric-key-ref? leafref | | | +-- asymmetric-key-ref? leafref
| | | {keystore-supported}? | | | {keystore-supported}?
| | +-- value? binary | | +-- value? binary
| +-- certificates | +-- certificates
| | +-- certificate* [name] | | +-- certificate* [name]
| | +-- name? string | | +-- name? string
| | +-- cert? end-entity-cert-cms | | +-- cert end-entity-cert-cms
| | +---n certificate-expiration | | +---n certificate-expiration
| | +-- expiration-date yang:date-and-time | | +-- expiration-date yang:date-and-time
| +---x generate-certificate-signing-request | +---x generate-certificate-signing-request
| {certificate-signing-request-generation}?
| +---w input | +---w input
| | +---w subject binary | | +---w subject binary
| | +---w attributes? binary | | +---w attributes? binary
| +--ro output | +--ro output
| +--ro certificate-signing-request binary | +--ro certificate-signing-request ct:csr
+--:(keystore) {keystore-supported}? +--:(keystore) {keystore-supported}?
+-- keystore-reference? ks:asymmetric-key-ref +-- keystore-reference? ks:asymmetric-key-ref
grouping local-or-keystore-end-entity-cert-with-key-grouping grouping local-or-keystore-end-entity-cert-with-key-grouping
+-- (local-or-keystore) +-- (local-or-keystore)
+--:(local) {local-definitions-supported}? +--:(local) {local-definitions-supported}?
| +-- local-definition | +-- local-definition
| +-- algorithm
| | iasa:asymmetric-algorithm-type
| +-- public-key-format identityref | +-- public-key-format identityref
| +-- public-key binary | +-- public-key binary
| +-- private-key-format? identityref | +-- private-key-format? identityref
| +-- (private-key-type) | +-- (private-key-type)
| | +--:(private-key) | | +--:(private-key)
| | | +-- private-key? binary | | | +-- private-key? binary
| | +--:(hidden-private-key) | | +--:(hidden-private-key)
| | | +-- hidden-private-key? empty | | | +-- hidden-private-key? empty
| | +--:(encrypted-private-key) | | +--:(encrypted-private-key)
| | +-- encrypted-private-key | | +-- encrypted-private-key
skipping to change at page 11, line 34 skipping to change at page 11, line 32
| | | | {keystore-supported}? | | | | {keystore-supported}?
| | | +--:(asymmetric-key-ref) | | | +--:(asymmetric-key-ref)
| | | +-- asymmetric-key-ref? leafref | | | +-- asymmetric-key-ref? leafref
| | | {keystore-supported}? | | | {keystore-supported}?
| | +-- value? binary | | +-- value? binary
| +-- cert? | +-- cert?
| | end-entity-cert-cms | | end-entity-cert-cms
| +---n certificate-expiration | +---n certificate-expiration
| | +-- expiration-date yang:date-and-time | | +-- expiration-date yang:date-and-time
| +---x generate-certificate-signing-request | +---x generate-certificate-signing-request
| {certificate-signing-request-generation}?
| +---w input | +---w input
| | +---w subject binary | | +---w subject binary
| | +---w attributes? binary | | +---w attributes? binary
| +--ro output | +--ro output
| +--ro certificate-signing-request binary | +--ro certificate-signing-request ct:csr
+--:(keystore) {keystore-supported}? +--:(keystore) {keystore-supported}?
+-- keystore-reference +-- keystore-reference
+-- asymmetric-key? ks:asymmetric-key-ref +-- asymmetric-key? ks:asymmetric-key-ref
+-- certificate? leafref +-- certificate? leafref
grouping keystore-grouping grouping keystore-grouping
+-- asymmetric-keys +-- asymmetric-keys
| +-- asymmetric-key* [name] | +-- asymmetric-key* [name]
| +-- name? string | +-- name? string
| +-- algorithm
| | iasa:asymmetric-algorithm-type
| +-- public-key-format identityref | +-- public-key-format identityref
| +-- public-key binary | +-- public-key binary
| +-- private-key-format? identityref | +-- private-key-format? identityref
| +-- (private-key-type) | +-- (private-key-type)
| | +--:(private-key) | | +--:(private-key)
| | | +-- private-key? binary | | | +-- private-key? binary
| | +--:(hidden-private-key) | | +--:(hidden-private-key)
| | | +-- hidden-private-key? empty | | | +-- hidden-private-key? empty
| | +--:(encrypted-private-key) | | +--:(encrypted-private-key)
| | +-- encrypted-private-key | | +-- encrypted-private-key
skipping to change at page 12, line 21 skipping to change at page 12, line 19
| | | +--:(symmetric-key-ref) | | | +--:(symmetric-key-ref)
| | | | +-- symmetric-key-ref? leafref | | | | +-- symmetric-key-ref? leafref
| | | | {keystore-supported}? | | | | {keystore-supported}?
| | | +--:(asymmetric-key-ref) | | | +--:(asymmetric-key-ref)
| | | +-- asymmetric-key-ref? leafref | | | +-- asymmetric-key-ref? leafref
| | | {keystore-supported}? | | | {keystore-supported}?
| | +-- value? binary | | +-- value? binary
| +-- certificates | +-- certificates
| | +-- certificate* [name] | | +-- certificate* [name]
| | +-- name? string | | +-- name? string
| | +-- cert? end-entity-cert-cms | | +-- cert end-entity-cert-cms
| | +---n certificate-expiration | | +---n certificate-expiration
| | +-- expiration-date yang:date-and-time | | +-- expiration-date yang:date-and-time
| +---x generate-certificate-signing-request | +---x generate-certificate-signing-request
| {certificate-signing-request-generation}?
| +---w input | +---w input
| | +---w subject binary | | +---w subject binary
| | +---w attributes? binary | | +---w attributes? binary
| +--ro output | +--ro output
| +--ro certificate-signing-request binary | +--ro certificate-signing-request ct:csr
+-- symmetric-keys +-- symmetric-keys
+-- symmetric-key* [name] +-- symmetric-key* [name]
+-- name? string +-- name? string
+-- algorithm isa:symmetric-algorithm-type
+-- key-format? identityref +-- key-format? identityref
+-- (key-type) +-- (key-type)
+--:(key) +--:(key)
| +-- key? binary | +-- key? binary
+--:(hidden-key) +--:(hidden-key)
| +-- hidden-key? empty | +-- hidden-key? empty
+--:(encrypted-key) +--:(encrypted-key)
+-- encrypted-key +-- encrypted-key
+-- (key-type) +-- (key-type)
| +--:(symmetric-key-ref) | +--:(symmetric-key-ref)
skipping to change at page 13, line 9 skipping to change at page 13, line 9
| | {keystore-supported}? | | {keystore-supported}?
| +--:(asymmetric-key-ref) | +--:(asymmetric-key-ref)
| +-- asymmetric-key-ref? leafref | +-- asymmetric-key-ref? leafref
| {keystore-supported}? | {keystore-supported}?
+-- value? binary +-- value? binary
3.2. Example Usage 3.2. Example Usage
3.2.1. A Keystore Instance 3.2.1. A Keystore Instance
The following example illustrates keys in <intended>. Please see The following example illustrates keys in <running>. Please see
Section 4 for an example illustrating built-in values in Section 4 for an example illustrating built-in values in
<operational>. <operational>.
========== NOTE: '\' line wrapping per BCP XXX (RFC XXXX) =========== ========== NOTE: '\' line wrapping per BCP XXX (RFC XXXX) ===========
<keystore xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore" <keystore xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore"
xmlns:ct="urn:ietf:params:xml:ns:yang:ietf-crypto-types"> xmlns:ct="urn:ietf:params:xml:ns:yang:ietf-crypto-types">
<symmetric-keys> <symmetric-keys>
<symmetric-key> <symmetric-key>
<name>cleartext-symmetric-key</name> <name>cleartext-symmetric-key</name>
<algorithm>aes-256-cbc</algorithm>
<key-format>ct:octet-string-key-format</key-format> <key-format>ct:octet-string-key-format</key-format>
<key>base64encodedvalue==</key> <key>base64encodedvalue==</key>
</symmetric-key> </symmetric-key>
<symmetric-key> <symmetric-key>
<name>hidden-symmetric-key</name> <name>hidden-symmetric-key</name>
<algorithm>aes-256-cbc</algorithm>
<hidden-key/> <hidden-key/>
</symmetric-key> </symmetric-key>
<symmetric-key> <symmetric-key>
<name>encrypted-symmetric-key</name> <!-- operator's key --> <name>encrypted-symmetric-key</name> <!-- operator's key -->
<algorithm>aes-256-cbc</algorithm>
<key-format>ct:encrypted-one-symmetric-key-format</key-format> <key-format>ct:encrypted-one-symmetric-key-format</key-format>
<encrypted-key> <encrypted-key>
<asymmetric-key-ref>hidden-asymmetric-key</asymmetric-key-re\ <asymmetric-key-ref>hidden-asymmetric-key</asymmetric-key-re\
f> f>
<value>base64encodedvalue==</value> <value>base64encodedvalue==</value>
</encrypted-key> </encrypted-key>
</symmetric-key> </symmetric-key>
</symmetric-keys> </symmetric-keys>
<asymmetric-keys> <asymmetric-keys>
<asymmetric-key> <asymmetric-key>
<name>ssh-rsa-key</name> <name>ssh-rsa-key</name>
<algorithm>rsa2048</algorithm>
<public-key-format>ct:ssh-public-key-format</public-key-format> <public-key-format>ct:ssh-public-key-format</public-key-format>
<public-key>base64encodedvalue==</public-key> <public-key>base64encodedvalue==</public-key>
<private-key-format>ct:rsa-private-key-format</private-key-for\ <private-key-format>ct:rsa-private-key-format</private-key-for\
mat> mat>
<private-key>base64encodedvalue==</private-key> <private-key>base64encodedvalue==</private-key>
</asymmetric-key> </asymmetric-key>
<asymmetric-key> <asymmetric-key>
<name>ssh-rsa-key-with-cert</name> <name>ssh-rsa-key-with-cert</name>
<algorithm>rsa2048</algorithm> <public-key-format>ct:subject-public-key-info-format</public-k\
<public-key-format>ct:ssh-public-key-format</public-key-format> ey-format>
<public-key>base64encodedvalue==</public-key> <public-key>base64encodedvalue==</public-key>
<private-key-format>ct:rsa-private-key-format</private-key-for\ <private-key-format>ct:rsa-private-key-format</private-key-for\
mat> mat>
<private-key>base64encodedvalue==</private-key> <private-key>base64encodedvalue==</private-key>
<certificates> <certificates>
<certificate> <certificate>
<name>ex-rsa-cert2</name> <name>ex-rsa-cert2</name>
<cert>base64encodedvalue==</cert> <cert>base64encodedvalue==</cert>
</certificate> </certificate>
</certificates> </certificates>
</asymmetric-key> </asymmetric-key>
<asymmetric-key> <asymmetric-key>
<name>raw-private-key</name> <name>raw-private-key</name>
<algorithm>rsa2048</algorithm>
<public-key-format>ct:subject-public-key-info-format</public-k\ <public-key-format>ct:subject-public-key-info-format</public-k\
ey-format> ey-format>
<public-key>base64encodedvalue==</public-key> <public-key>base64encodedvalue==</public-key>
<private-key-format>ct:rsa-private-key-format</private-key-for\ <private-key-format>ct:rsa-private-key-format</private-key-for\
mat> mat>
<private-key>base64encodedvalue==</private-key> <private-key>base64encodedvalue==</private-key>
</asymmetric-key> </asymmetric-key>
<asymmetric-key> <asymmetric-key>
<name>rsa-asymmetric-key</name> <name>rsa-asymmetric-key</name>
<algorithm>rsa2048</algorithm>
<public-key-format>ct:subject-public-key-info-format</public-k\ <public-key-format>ct:subject-public-key-info-format</public-k\
ey-format> ey-format>
<public-key>base64encodedvalue==</public-key> <public-key>base64encodedvalue==</public-key>
<private-key-format>ct:rsa-private-key-format</private-key-for\ <private-key-format>ct:rsa-private-key-format</private-key-for\
mat> mat>
<private-key>base64encodedvalue==</private-key> <private-key>base64encodedvalue==</private-key>
<certificates> <certificates>
<certificate> <certificate>
<name>ex-rsa-cert</name> <name>ex-rsa-cert</name>
<cert>base64encodedvalue==</cert> <cert>base64encodedvalue==</cert>
</certificate> </certificate>
</certificates> </certificates>
</asymmetric-key> </asymmetric-key>
<asymmetric-key> <asymmetric-key>
<name>ec-asymmetric-key</name> <name>ec-asymmetric-key</name>
<algorithm>secp256r1</algorithm>
<public-key-format>ct:subject-public-key-info-format</public-k\ <public-key-format>ct:subject-public-key-info-format</public-k\
ey-format> ey-format>
<public-key>base64encodedvalue==</public-key> <public-key>base64encodedvalue==</public-key>
<private-key-format>ct:ec-private-key-format</private-key-form\ <private-key-format>ct:ec-private-key-format</private-key-form\
at> at>
<private-key>base64encodedvalue==</private-key> <private-key>base64encodedvalue==</private-key>
<certificates> <certificates>
<certificate> <certificate>
<name>ex-ec-cert</name> <name>ex-ec-cert</name>
<cert>base64encodedvalue==</cert> <cert>base64encodedvalue==</cert>
</certificate> </certificate>
</certificates> </certificates>
</asymmetric-key> </asymmetric-key>
<asymmetric-key> <asymmetric-key>
<name>hidden-asymmetric-key</name> <name>hidden-asymmetric-key</name>
<algorithm>rsa2048</algorithm>
<public-key-format>ct:subject-public-key-info-format</public-k\ <public-key-format>ct:subject-public-key-info-format</public-k\
ey-format> ey-format>
<public-key>base64encodedvalue==</public-key> <public-key>base64encodedvalue==</public-key>
<hidden-private-key/> <!-- e.g., TPM protected --> <hidden-private-key/> <!-- e.g., TPM protected -->
<certificates> <certificates>
<certificate> <certificate>
<name>builtin-idevid-cert</name> <name>builtin-idevid-cert</name>
<cert>base64encodedvalue==</cert>
</certificate> </certificate>
<certificate> <certificate>
<name>my-ldevid-cert</name> <name>my-ldevid-cert</name>
<cert>base64encodedvalue==</cert> <cert>base64encodedvalue==</cert>
</certificate> </certificate>
</certificates> </certificates>
</asymmetric-key> </asymmetric-key>
<asymmetric-key> <asymmetric-key>
<name>encrypted-asymmetric-key</name> <name>encrypted-asymmetric-key</name>
<algorithm>secp256r1</algorithm>
<public-key-format>ct:subject-public-key-info-format</public-k\ <public-key-format>ct:subject-public-key-info-format</public-k\
ey-format> ey-format>
<public-key>base64encodedvalue==</public-key> <public-key>base64encodedvalue==</public-key>
<private-key-format>ct:encrypted-one-asymmetric-key-format</pr\ <private-key-format>ct:encrypted-one-asymmetric-key-format</pr\
ivate-key-format> ivate-key-format>
<encrypted-private-key> <encrypted-private-key>
<symmetric-key-ref>encrypted-symmetric-key</symmetric-key-re\ <symmetric-key-ref>encrypted-symmetric-key</symmetric-key-re\
f> f>
<value>base64encodedvalue==</value> <value>base64encodedvalue==</value>
</encrypted-private-key> </encrypted-private-key>
</asymmetric-key> </asymmetric-key>
</asymmetric-keys> </asymmetric-keys>
</keystore> </keystore>
3.2.2. The "generate-symmetric-key" RPC 3.2.2. Notable Keystore Groupings
The following example illustrates how the "generate-symmetric-key"
RPC defined in "ietf-crypto-types" module
[I-D.ietf-netconf-crypto-types] has been augmented to encrypt the
generated symmetric key.
This example references the key defined in the keystore example in
Section 3.2.1.
<rpc message-id="101"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<generate-symmetric-key
xmlns="urn:ietf:params:xml:ns:yang:ietf-crypto-types">
<algorithm>aes-256-cbc</algorithm>
<encrypt-with
xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore">
<asymmetric-key-ref>hidden-asymmetric-key</asymmetric-key-ref>
</encrypt-with>
</generate-symmetric-key>
</rpc>
Following is the RPC-reply.
========== NOTE: '\' line wrapping per BCP XXX (RFC XXXX) ===========
<rpc-reply message-id="101"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
xmlns:ks="urn:ietf:params:xml:ns:yang:ietf-keystore"
xmlns:ct="urn:ietf:params:xml:ns:yang:ietf-crypto-types">
<!--<data> yanglint validation fails -->
<ct:algorithm>aes-256-cbc</ct:algorithm>
<ct:key-format>ct:encrypted-one-symmetric-key-format</ct:key-for\
mat>
<ks:encrypted-key>
<ks:asymmetric-key-ref>hidden-asymmetric-key</ks:asymmetric-ke\
y-ref>
<ks:value>base64encodedvalue==</ks:value>
</ks:encrypted-key>
<!--</data> yanglint validation fails -->
</rpc-reply>
3.2.3. The "generate-asymmetric-key" RPC
The following example illustrates how the "generate-asymmetric-key"
RPC defined in "ietf-crypto-types" module
[I-D.ietf-netconf-crypto-types] has been augmented to encrypt the
generated asymmetric key.
This example references the key defined in the keystore example in
Section 3.2.1.
<rpc message-id="101"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<generate-asymmetric-key
xmlns="urn:ietf:params:xml:ns:yang:ietf-crypto-types">
<algorithm>secp256r1</algorithm>
<encrypt-with
xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore">
<symmetric-key-ref>encrypted-symmetric-key</symmetric-key-ref>
</encrypt-with>
</generate-asymmetric-key>
</rpc>
Following is the RPC-reply.
========== NOTE: '\' line wrapping per BCP XXX (RFC XXXX) ===========
<rpc-reply message-id="101"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
xmlns:ks="urn:ietf:params:xml:ns:yang:ietf-keystore"
xmlns:ct="urn:ietf:params:xml:ns:yang:ietf-crypto-types">
<!--<data> yanglint validation fails -->
<ct:algorithm>secp256r1</ct:algorithm>
<ct:public-key-format>ct:subject-public-key-info-format</ct:publ\
ic-key-format>
<ct:public-key>base64encodedvalue==</ct:public-key>
<ct:private-key-format>ct:encrypted-one-asymmetric-key-format</c\
t:private-key-format>
<ks:encrypted-private-key>
<ks:symmetric-key-ref>encrypted-symmetric-key</ks:symmetric-ke\
y-ref>
<ks:value>base64encodedvalue==</ks:value>
</ks:encrypted-private-key>
<!--</data> yanglint validation fails -->
</rpc-reply>
3.2.4. Notable Keystore Groupings
The following non-normative module is used by subsequent examples to The following non-normative module is used by subsequent examples to
illustrate groupings defined in the ietf-crypto-types module. illustrate groupings defined in the ietf-keystore module.
module ex-keystore-usage { module ex-keystore-usage {
yang-version 1.1; yang-version 1.1;
namespace "http://example.com/ns/example-keystore-usage"; namespace "http://example.com/ns/example-keystore-usage";
prefix "eku"; prefix "eku";
import ietf-keystore { import ietf-keystore {
prefix ks; prefix ks;
reference reference
skipping to change at page 20, line 9 skipping to change at page 18, line 9
========== NOTE: '\' line wrapping per BCP XXX (RFC XXXX) =========== ========== NOTE: '\' line wrapping per BCP XXX (RFC XXXX) ===========
<keystore-usage xmlns="http://example.com/ns/example-keystore-usage" <keystore-usage xmlns="http://example.com/ns/example-keystore-usage"
xmlns:ct="urn:ietf:params:xml:ns:yang:ietf-crypto-types"> xmlns:ct="urn:ietf:params:xml:ns:yang:ietf-crypto-types">
<!-- ks:local-or-keystore-asymmetric-key-grouping --> <!-- ks:local-or-keystore-asymmetric-key-grouping -->
<just-a-key> <just-a-key>
<name>a locally-defined key</name> <name>a locally-defined key</name>
<local-definition> <local-definition>
<algorithm>rsa2048</algorithm>
<public-key-format>ct:subject-public-key-info-format</public-k\ <public-key-format>ct:subject-public-key-info-format</public-k\
ey-format> ey-format>
<public-key>base64encodedvalue==</public-key> <public-key>base64encodedvalue==</public-key>
<private-key-format>ct:rsa-private-key-format</private-key-for\ <private-key-format>ct:rsa-private-key-format</private-key-for\
mat> mat>
<private-key>base64encodedvalue==</private-key> <private-key>base64encodedvalue==</private-key>
</local-definition> </local-definition>
</just-a-key> </just-a-key>
<just-a-key> <just-a-key>
<name>a keystore-defined key (and its associated certs)</name> <name>a keystore-defined key (and its associated certs)</name>
<keystore-reference>rsa-asymmetric-key</keystore-reference> <keystore-reference>rsa-asymmetric-key</keystore-reference>
</just-a-key> </just-a-key>
<!-- ks:local-or-keystore-key-and-end-entity-cert-grouping --> <!-- ks:local-or-keystore-key-and-end-entity-cert-grouping -->
<key-with-certs> <key-with-certs>
<name>a locally-defined key with certs</name> <name>a locally-defined key with certs</name>
<local-definition> <local-definition>
<algorithm>rsa2048</algorithm>
<public-key-format>ct:subject-public-key-info-format</public-k\ <public-key-format>ct:subject-public-key-info-format</public-k\
ey-format> ey-format>
<public-key>base64encodedvalue==</public-key> <public-key>base64encodedvalue==</public-key>
<private-key-format>ct:rsa-private-key-format</private-key-for\ <private-key-format>ct:rsa-private-key-format</private-key-for\
mat> mat>
<private-key>base64encodedvalue==</private-key> <private-key>base64encodedvalue==</private-key>
<certificates> <certificates>
<certificate> <certificate>
<name>a locally-defined cert</name> <name>a locally-defined cert</name>
<cert>base64encodedvalue==</cert> <cert>base64encodedvalue==</cert>
skipping to change at page 21, line 4 skipping to change at page 18, line 49
</certificates> </certificates>
</local-definition> </local-definition>
</key-with-certs> </key-with-certs>
<key-with-certs> <key-with-certs>
<name>a keystore-defined key (and its associated certs)</name> <name>a keystore-defined key (and its associated certs)</name>
<keystore-reference>rsa-asymmetric-key</keystore-reference> <keystore-reference>rsa-asymmetric-key</keystore-reference>
</key-with-certs> </key-with-certs>
<!-- ks:local-or-keystore-end-entity-cert-with-key-grouping --> <!-- ks:local-or-keystore-end-entity-cert-with-key-grouping -->
<end-entity-cert-with-key> <end-entity-cert-with-key>
<name>a locally-defined end-entity cert with key</name> <name>a locally-defined end-entity cert with key</name>
<local-definition> <local-definition>
<algorithm>rsa2048</algorithm>
<public-key-format>ct:subject-public-key-info-format</public-k\ <public-key-format>ct:subject-public-key-info-format</public-k\
ey-format> ey-format>
<public-key>base64encodedvalue==</public-key> <public-key>base64encodedvalue==</public-key>
<private-key-format>ct:rsa-private-key-format</private-key-for\ <private-key-format>ct:rsa-private-key-format</private-key-for\
mat> mat>
<private-key>base64encodedvalue==</private-key> <private-key>base64encodedvalue==</private-key>
<cert>base64encodedvalue==</cert> <cert>base64encodedvalue==</cert>
</local-definition> </local-definition>
</end-entity-cert-with-key> </end-entity-cert-with-key>
skipping to change at page 21, line 35 skipping to change at page 19, line 32
</end-entity-cert-with-key> </end-entity-cert-with-key>
</keystore-usage> </keystore-usage>
3.3. YANG Module 3.3. YANG Module
This YANG module has normative references to [RFC8341] and This YANG module has normative references to [RFC8341] and
[I-D.ietf-netconf-crypto-types], and an informative reference to [I-D.ietf-netconf-crypto-types], and an informative reference to
[RFC8342]. [RFC8342].
<CODE BEGINS> file "ietf-keystore@2020-03-08.yang" <CODE BEGINS> file "ietf-keystore@2020-05-20.yang"
module ietf-keystore { module ietf-keystore {
yang-version 1.1; yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-keystore"; namespace "urn:ietf:params:xml:ns:yang:ietf-keystore";
prefix ks; prefix ks;
import ietf-netconf-acm { import ietf-netconf-acm {
prefix nacm; prefix nacm;
reference reference
"RFC 8341: Network Configuration Access Control Model"; "RFC 8341: Network Configuration Access Control Model";
skipping to change at page 22, line 16 skipping to change at page 20, line 12
organization organization
"IETF NETCONF (Network Configuration) Working Group"; "IETF NETCONF (Network Configuration) Working Group";
contact contact
"WG Web: <http://datatracker.ietf.org/wg/netconf/> "WG Web: <http://datatracker.ietf.org/wg/netconf/>
WG List: <mailto:netconf@ietf.org> WG List: <mailto:netconf@ietf.org>
Author: Kent Watsen <mailto:kent+ietf@watsen.net>"; Author: Kent Watsen <mailto:kent+ietf@watsen.net>";
description description
"This module defines a keystore to centralize management "This module defines a Keystore to centralize management
of security credentials. of security credentials.
Copyright (c) 2019 IETF Trust and the persons identified Copyright (c) 2020 IETF Trust and the persons identified
as authors of the code. All rights reserved. as authors of the code. All rights reserved.
Redistribution and use in source and binary forms, with Redistribution and use in source and binary forms, with
or without modification, is permitted pursuant to, and or without modification, is permitted pursuant to, and
subject to the license terms contained in, the Simplified subject to the license terms contained in, the Simplified
BSD License set forth in Section 4.c of the IETF Trust's BSD License set forth in Section 4.c of the IETF Trust's
Legal Provisions Relating to IETF Documents Legal Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info). (https://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC XXXX This version of this YANG module is part of RFC CCCC
(https://www.rfc-editor.org/info/rfcXXXX); see the RFC (https://www.rfc-editor.org/info/rfcCCCC); see the RFC
itself for full legal notices. itself for full legal notices.
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document 'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
are to be interpreted as described in BCP 14 (RFC 2119) are to be interpreted as described in BCP 14 (RFC 2119)
(RFC 8174) when, and only when, they appear in all (RFC 8174) when, and only when, they appear in all
capitals, as shown here."; capitals, as shown here.";
revision 2020-03-08 { revision 2020-05-20 {
description description
"Initial version"; "Initial version";
reference reference
"RFC XXXX: A YANG Data Model for a Keystore"; "RFC CCCC: A YANG Data Model for a Keystore";
} }
/****************/ /****************/
/* Features */ /* Features */
/****************/ /****************/
feature keystore-supported { feature keystore-supported {
description description
"The 'keystore-supported' feature indicates that the server "The 'keystore-supported' feature indicates that the server
supports the keystore."; supports the Keystore.";
} }
feature local-definitions-supported { feature local-definitions-supported {
description description
"The 'local-definitions-supported' feature indicates that the "The 'local-definitions-supported' feature indicates that the
server supports locally-defined keys."; server supports locally-defined keys.";
} }
/****************/ /****************/
/* Typedefs */ /* Typedefs */
/****************/ /****************/
skipping to change at page 23, line 25 skipping to change at page 21, line 21
/* Typedefs */ /* Typedefs */
/****************/ /****************/
typedef symmetric-key-ref { typedef symmetric-key-ref {
type leafref { type leafref {
path "/ks:keystore/ks:symmetric-keys/ks:symmetric-key" path "/ks:keystore/ks:symmetric-keys/ks:symmetric-key"
+ "/ks:name"; + "/ks:name";
} }
description description
"This typedef enables modules to easily define a reference "This typedef enables modules to easily define a reference
to a symmetric key stored in the keystore."; to a symmetric key stored in the Keystore.";
} }
typedef asymmetric-key-ref { typedef asymmetric-key-ref {
type leafref { type leafref {
path "/ks:keystore/ks:asymmetric-keys/ks:asymmetric-key" path "/ks:keystore/ks:asymmetric-keys/ks:asymmetric-key"
+ "/ks:name"; + "/ks:name";
} }
description description
"This typedef enables modules to easily define a reference "This typedef enables modules to easily define a reference
to an asymmetric key stored in the keystore."; to an asymmetric key stored in the Keystore.";
} }
/*****************/ /*****************/
/* Groupings */ /* Groupings */
/*****************/ /*****************/
grouping key-reference-type-grouping { grouping key-reference-type-grouping {
description description
"A reusable grouping for a choice for the type of key "A reusable grouping for a choice for the type of key
referenced in the keystore."; referenced in the Keystore.";
choice key-type { choice key-type {
mandatory true; mandatory true;
description description
"A choice between a reference to a symmetric or asymmetric "A choice between a reference to a symmetric or asymmetric
key in the keystore."; key in the Keystore.";
leaf symmetric-key-ref { leaf symmetric-key-ref {
if-feature "keystore-supported"; if-feature "keystore-supported";
type leafref { type leafref {
path "/ks:keystore/ks:symmetric-keys/ks:symmetric-key/" path "/ks:keystore/ks:symmetric-keys/ks:symmetric-key/"
+ "ks:name"; + "ks:name";
} }
description description
"Identifies a symmetric key used to encrypt this key."; "Identifies a symmetric key used to encrypt this key.";
} }
leaf asymmetric-key-ref { leaf asymmetric-key-ref {
skipping to change at page 24, line 29 skipping to change at page 22, line 24
} }
description description
"Identifies an asymmetric key used to encrypt this key."; "Identifies an asymmetric key used to encrypt this key.";
} }
} }
} }
grouping encrypted-value-grouping { grouping encrypted-value-grouping {
description description
"A reusable grouping for a value that has been encrypted by "A reusable grouping for a value that has been encrypted by
a symmetric or asymmetric key in the keystore."; a symmetric or asymmetric key in the Keystore.";
uses "key-reference-type-grouping"; uses "key-reference-type-grouping";
leaf value { leaf value {
type binary; type binary;
description description
"The private key, encrypted using the specified symmetric "The private key, encrypted using the specified symmetric
or asymmetric key."; or asymmetric key.";
} }
} }
grouping symmetric-key-grouping { grouping symmetric-key-grouping {
description description
"This grouping is identical to the one in ietf-crypto-types "This grouping is identical to the one in ietf-crypto-types
except that it adds a case statement enabling the key except that it adds a case statement enabling the key
value to be encrypted by a symmetric or an asymmetric value to be encrypted by a symmetric or an asymmetric
key known to the keystore."; key known to the Keystore.";
uses ct:symmetric-key-grouping { uses ct:symmetric-key-grouping {
augment "key-type" { augment "key-type" {
description description
"Augments a new 'case' statement into the 'choice' "Augments a new 'case' statement into the 'choice'
statement defined by the ietf-crypto-types module."; statement defined by the ietf-crypto-types module.";
container encrypted-key { container encrypted-key {
must "../key-format"; must "../key-format";
description description
"A container for the encrypted symmetric key value."; "A container for the encrypted symmetric key value.";
uses encrypted-value-grouping; uses encrypted-value-grouping;
skipping to change at page 25, line 8 skipping to change at page 23, line 4
description description
"Augments a new 'case' statement into the 'choice' "Augments a new 'case' statement into the 'choice'
statement defined by the ietf-crypto-types module."; statement defined by the ietf-crypto-types module.";
container encrypted-key { container encrypted-key {
must "../key-format"; must "../key-format";
description description
"A container for the encrypted symmetric key value."; "A container for the encrypted symmetric key value.";
uses encrypted-value-grouping; uses encrypted-value-grouping;
} }
} }
} }
} }
grouping asymmetric-key-pair-grouping { grouping asymmetric-key-pair-grouping {
description description
"This grouping is identical to the one in ietf-crypto-types "This grouping is identical to the one in ietf-crypto-types
except that it adds a case statement enabling the key except that it adds a case statement enabling the key
value to be encrypted by a symmetric or an asymmetric value to be encrypted by a symmetric or an asymmetric
key known to the keystore."; key known to the Keystore.";
uses ct:asymmetric-key-pair-grouping { uses ct:asymmetric-key-pair-grouping {
augment "private-key-type" { augment "private-key-type" {
description description
"Augments a new 'case' statement into the 'choice' "Augments a new 'case' statement into the 'choice'
statement defined by the ietf-crypto-types module."; statement defined by the ietf-crypto-types module.";
container encrypted-private-key { container encrypted-private-key {
must "../private-key-format"; must "../private-key-format";
description description
"A container for the encrypted asymmetric private "A container for the encrypted asymmetric private
key value."; key value.";
skipping to change at page 25, line 38 skipping to change at page 23, line 35
} }
} }
} }
} }
grouping asymmetric-key-pair-with-cert-grouping { grouping asymmetric-key-pair-with-cert-grouping {
description description
"This grouping is identical to the one in ietf-crypto-types "This grouping is identical to the one in ietf-crypto-types
except that it adds a case statement enabling the key except that it adds a case statement enabling the key
value to be encrypted by a symmetric or an asymmetric value to be encrypted by a symmetric or an asymmetric
key known to the keystore."; key known to the Keystore.";
uses ct:asymmetric-key-pair-with-cert-grouping { uses ct:asymmetric-key-pair-with-cert-grouping {
augment "private-key-type" { augment "private-key-type" {
description description
"Augments a new 'case' statement into the 'choice' "Augments a new 'case' statement into the 'choice'
statement defined by the ietf-crypto-types module."; statement defined by the ietf-crypto-types module.";
container encrypted-private-key { container encrypted-private-key {
must "../private-key-format"; must "../private-key-format";
description description
"A container for the encrypted asymmetric private "A container for the encrypted asymmetric private
key value."; key value.";
skipping to change at page 26, line 4 skipping to change at page 23, line 49
"Augments a new 'case' statement into the 'choice' "Augments a new 'case' statement into the 'choice'
statement defined by the ietf-crypto-types module."; statement defined by the ietf-crypto-types module.";
container encrypted-private-key { container encrypted-private-key {
must "../private-key-format"; must "../private-key-format";
description description
"A container for the encrypted asymmetric private "A container for the encrypted asymmetric private
key value."; key value.";
uses encrypted-value-grouping; uses encrypted-value-grouping;
} }
} }
} }
} }
grouping asymmetric-key-pair-with-certs-grouping { grouping asymmetric-key-pair-with-certs-grouping {
description description
"This grouping is identical to the one in ietf-crypto-types "This grouping is identical to the one in ietf-crypto-types
except that it adds a case statement enabling the key except that it adds a case statement enabling the key
value to be encrypted by a symmetric or an asymmetric value to be encrypted by a symmetric or an asymmetric
key known to the keystore."; key known to the Keystore.";
uses ct:asymmetric-key-pair-with-certs-grouping { uses ct:asymmetric-key-pair-with-certs-grouping {
augment "private-key-type" { augment "private-key-type" {
description description
"Augments a new 'case' statement into the 'choice' "Augments a new 'case' statement into the 'choice'
statement defined by the ietf-crypto-types module."; statement defined by the ietf-crypto-types module.";
container encrypted-private-key { container encrypted-private-key {
must "../private-key-format"; must "../private-key-format";
description description
"A container for the encrypted asymmetric private "A container for the encrypted asymmetric private
key value."; key value.";
skipping to change at page 26, line 35 skipping to change at page 24, line 30
} }
} }
} }
} }
grouping asymmetric-key-certificate-ref-grouping { grouping asymmetric-key-certificate-ref-grouping {
leaf asymmetric-key { leaf asymmetric-key {
type ks:asymmetric-key-ref; type ks:asymmetric-key-ref;
must '../certificate'; must '../certificate';
description description
"A reference to an asymmetric key in the keystore."; "A reference to an asymmetric key in the Keystore.";
} }
leaf certificate { leaf certificate {
type leafref { type leafref {
path "/ks:keystore/ks:asymmetric-keys/ks:asymmetric-key[ks:" path "/ks:keystore/ks:asymmetric-keys/ks:asymmetric-key[ks:"
+ "name = current()/../asymmetric-key]/ks:certificates" + "name = current()/../asymmetric-key]/ks:certificates"
+ "/ks:certificate/ks:name"; + "/ks:certificate/ks:name";
} }
must '../asymmetric-key'; must '../asymmetric-key';
description description
"A reference to a specific certificate of the "A reference to a specific certificate of the
asymmetric key in the keystore."; asymmetric key in the Keystore.";
} }
description description
"This grouping defines a reference to a specific certificate "This grouping defines a reference to a specific certificate
associated with an asymmetric key stored in the keystore."; associated with an asymmetric key stored in the Keystore.";
} }
// local-or-keystore-* groupings // local-or-keystore-* groupings
grouping local-or-keystore-symmetric-key-grouping { grouping local-or-keystore-symmetric-key-grouping {
description description
"A grouping that expands to allow the symmetric key to be "A grouping that expands to allow the symmetric key to be
either stored locally, within the using data model, or be either stored locally, within the using data model, or be
a reference to an symmetric key stored in the keystore."; a reference to a symmetric key stored in the Keystore.";
choice local-or-keystore { choice local-or-keystore {
mandatory true; mandatory true;
case local { case local {
if-feature "local-definitions-supported"; if-feature "local-definitions-supported";
container local-definition { container local-definition {
description description
"Container to hold the local key definition."; "Container to hold the local key definition.";
uses symmetric-key-grouping; uses symmetric-key-grouping;
} }
} }
case keystore { case keystore {
if-feature "keystore-supported"; if-feature "keystore-supported";
leaf keystore-reference { leaf keystore-reference {
type ks:symmetric-key-ref; type ks:symmetric-key-ref;
description description
"A reference to an symmetric key that exists in "A reference to an symmetric key that exists in
the keystore."; the Keystore.";
} }
} }
description description
"A choice between an inlined definition and a definition "A choice between an inlined definition and a definition
that exists in the keystore."; that exists in the Keystore.";
} }
} }
grouping local-or-keystore-asymmetric-key-grouping { grouping local-or-keystore-asymmetric-key-grouping {
description description
"A grouping that expands to allow the asymmetric key to be "A grouping that expands to allow the asymmetric key to be
either stored locally, within the using data model, or be either stored locally, within the using data model, or be
a reference to an asymmetric key stored in the keystore."; a reference to an asymmetric key stored in the Keystore.";
choice local-or-keystore { choice local-or-keystore {
mandatory true; mandatory true;
case local { case local {
if-feature "local-definitions-supported"; if-feature "local-definitions-supported";
container local-definition { container local-definition {
description description
"Container to hold the local key definition."; "Container to hold the local key definition.";
uses asymmetric-key-pair-grouping; uses asymmetric-key-pair-grouping;
} }
} }
case keystore { case keystore {
if-feature "keystore-supported"; if-feature "keystore-supported";
leaf keystore-reference { leaf keystore-reference {
type ks:asymmetric-key-ref; type ks:asymmetric-key-ref;
description description
"A reference to an asymmetric key that exists in "A reference to an asymmetric key that exists in
the keystore. The intent is to reference just the the Keystore. The intent is to reference just the
asymmetric key without any regard for any certificates asymmetric key without any regard for any certificates
that may be associated with it."; that may be associated with it.";
} }
} }
description description
"A choice between an inlined definition and a definition "A choice between an inlined definition and a definition
that exists in the keystore."; that exists in the Keystore.";
} }
} }
grouping local-or-keystore-asymmetric-key-with-certs-grouping { grouping local-or-keystore-asymmetric-key-with-certs-grouping {
description description
"A grouping that expands to allow an asymmetric key and its "A grouping that expands to allow an asymmetric key and its
associated certificates to be either stored locally, within associated certificates to be either stored locally, within
the using data model, or be a reference to an asymmetric key the using data model, or be a reference to an asymmetric key
(and its associated certificates) stored in the keystore."; (and its associated certificates) stored in the Keystore.";
choice local-or-keystore { choice local-or-keystore {
mandatory true; mandatory true;
case local { case local {
if-feature "local-definitions-supported"; if-feature "local-definitions-supported";
container local-definition { container local-definition {
description description
"Container to hold the local key definition."; "Container to hold the local key definition.";
uses asymmetric-key-pair-with-certs-grouping; uses asymmetric-key-pair-with-certs-grouping;
} }
} }
case keystore { case keystore {
if-feature "keystore-supported"; if-feature "keystore-supported";
leaf keystore-reference { leaf keystore-reference {
type ks:asymmetric-key-ref; type ks:asymmetric-key-ref;
description description
"A reference to an asymmetric-key (and all of its "A reference to an asymmetric-key (and all of its
associated certificates) in the keystore."; associated certificates) in the Keystore.";
} }
} }
description description
"A choice between an inlined definition and a definition "A choice between an inlined definition and a definition
that exists in the keystore."; that exists in the Keystore.";
} }
} }
grouping local-or-keystore-end-entity-cert-with-key-grouping { grouping local-or-keystore-end-entity-cert-with-key-grouping {
description description
"A grouping that expands to allow an end-entity certificate "A grouping that expands to allow an end-entity certificate
(and its associated private key) to be either stored locally, (and its associated private key) to be either stored locally,
within the using data model, or be a reference to a specific within the using data model, or be a reference to a specific
certificate in the keystore."; certificate in the Keystore.";
choice local-or-keystore { choice local-or-keystore {
mandatory true; mandatory true;
case local { case local {
if-feature "local-definitions-supported"; if-feature "local-definitions-supported";
container local-definition { container local-definition {
description description
"Container to hold the local key definition."; "Container to hold the local key definition.";
uses asymmetric-key-pair-with-cert-grouping; uses asymmetric-key-pair-with-cert-grouping;
} }
} }
case keystore { case keystore {
if-feature "keystore-supported"; if-feature "keystore-supported";
container keystore-reference { container keystore-reference {
uses asymmetric-key-certificate-ref-grouping; uses asymmetric-key-certificate-ref-grouping;
description description
"A reference to a specific certificate (and its "A reference to a specific certificate (and its
associated private key) in the keystore."; associated private key) in the Keystore.";
} }
} }
description description
"A choice between an inlined definition and a definition "A choice between an inlined definition and a definition
that exists in the keystore."; that exists in the Keystore.";
} }
} }
grouping keystore-grouping { grouping keystore-grouping {
description description
"Grouping definition enables use in other contexts. If ever "Grouping definition enables use in other contexts. If ever
done, implementations SHOULD augment new 'case' statements done, implementations SHOULD augment new 'case' statements
into local-or-keystore 'choice' statements to supply leafrefs into local-or-keystore 'choice' statements to supply leafrefs
to the new location."; to the new location.";
container asymmetric-keys { container asymmetric-keys {
skipping to change at page 30, line 24 skipping to change at page 28, line 21
leaf name { leaf name {
type string; type string;
description description
"An arbitrary name for the symmetric key."; "An arbitrary name for the symmetric key.";
} }
uses ks:symmetric-key-grouping; uses ks:symmetric-key-grouping;
} }
} }
} // grouping keystore-grouping } // grouping keystore-grouping
/****************/
/* Augments */
/****************/
augment "/ct:generate-symmetric-key/ct:input" {
description
"This augmentation adds an input parameter to the
'generate-symmetric-key' RPC to specify another key
that is to be used to encypt the generated key
before it is returned in the RPC-reply.";
container encrypt-with {
presence
"Indicates that the key should be encrypted using
the specified symmetric or asymmetric key. If not
specified, then the private key is not encrypted
when returned.";
description
"A container for the 'key-type' choice.";
uses key-reference-type-grouping;
}
}
augment "/ct:generate-symmetric-key/ct:output/ct:key-type" {
description
"This augmentation extends the 'generate-symmetric-key'
RPC-reply to encode an encrypted key.";
container encrypted-key {
must "../ct:key-format";
description
"A container for the encrypted symmetric key value.";
uses encrypted-value-grouping;
}
}
augment "/ct:generate-asymmetric-key/ct:input" {
description
"This augmentation adds an input parameter to the
'generate-asymmetric-key' RPC to specify another key
that is to be used to encypt the generated key
before it is returned in the RPC-reply.";
container encrypt-with {
presence
"Indicates that the key should be encrypted using
the specified symmetric or asymmetric key. If not
specified, then the private key is not encrypted
when returned.";
description
"A container for the 'key-type' choice.";
uses key-reference-type-grouping;
}
}
augment
"/ct:generate-asymmetric-key/ct:output/ct:private-key-type" {
description
"This augmentation extends the 'generate-asymmetric-key'
RPC-reply to encode an encrypted key.";
container encrypted-private-key {
must "../ct:private-key-format";
description
"A container for the encrypted asymmetric private
key value.";
uses encrypted-value-grouping;
}
}
/*********************************/ /*********************************/
/* Protocol accessible nodes */ /* Protocol accessible nodes */
/*********************************/ /*********************************/
container keystore { container keystore {
nacm:default-deny-write; nacm:default-deny-write;
description description
"The keystore contains a list of keys."; "The Keystore contains a list of symmetric keys and a list
of asymmetric keys.";
uses keystore-grouping; uses keystore-grouping;
} }
} }
<CODE ENDS> <CODE ENDS>
4. Support for Built-in Keys 4. Support for Built-in Keys
In some implementations, a device's hardware may define some built-in In some implementations, a server may support built-in keys. Built-
keys set during the manufacturing process, and/or the operating in built-in keys MAY be set during the manufacturing process or be
system the device runs may dynamically generate some "hidden" keys dynamically generated the first time the server is booted or a
upon first boot. As an example, a built-in key may exist in particular service (e.g., SSH) is enabled.
conjunction with a secure device identity certificate (e.g., an
IDevID certificate).
Built-in keys are expected to be set by a vendor-specific process. The key characteristic of the built-in keys is that they are provided
Any ability for operators to modify the built-in keys is outside the by the system, as opposed to configuration. As such, they are
scope of this docuemnt. present in <operational>. The example below illustrates what the
truststore in <operational> might look like for a server in its
factory default state.
As built-in keys are provided by the system (not configuration), they ========== NOTE: '\' line wrapping per BCP XXX (RFC XXXX) ===========
are present in <operational>. The following example illustrates
built-in keys in <operational>.
(FIXME: add illustration with origin="system" here) <keystore xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore"
xmlns:ct="urn:ietf:params:xml:ns:yang:ietf-crypto-types"
xmlns:or="urn:ietf:params:xml:ns:yang:ietf-origin"
or:origin="or:intended">
<asymmetric-keys>
<asymmetric-key or:origin="or:system">
<name>Manufacturer-Generated Hidden Key</name>
<public-key-format>ct:subject-public-key-info-format</public-k\
ey-format>
<public-key>base64encodedvalue==</public-key>
<hidden-private-key/> <!-- e.g., TPM protected -->
<certificates>
<certificate>
<name>Manufacturer-Generated IDevID Cert</name>
<cert>base64encodedvalue==</cert>
</certificate>
</certificates>
</asymmetric-key>
</asymmetric-keys>
</keystore>
In order for the built-in keys to be referenced by configuration, In order for the built-in keys to be referenced by configuration, the
they must first be copied into <intended> as the example in referenced nodes MUST first be copied into <running>. They SHOULD be
Section 3.2 illustrates for the built-in keys above. Note that this copied into <running> using the same "key" values, so that the system
strategy is chosen, rather then setting "require-instance false" for can bind the references to the built-in entries. Only the referenced
the various leafrefs, as built-in keys are relatively few in number nodes need to be copied. When using the same key values as in
and hence not worth relaxing the validation for. <operational> no new values can be added and no existing values can
be changed; that which is in <running> can only be a subset of that
which is in <operational>.
5. Support for RMAs For instance, the following example illustrates how a single built-in
key definition from the previous example has been propagated to
<running>:
FIXME: https://mailarchive.ietf.org/arch/msg/netconf/ ========== NOTE: '\' line wrapping per BCP XXX (RFC XXXX) ===========
pn0LucnWx3Xz0rfBRqB31BVg-Bk
<keystore xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore"
xmlns:ct="urn:ietf:params:xml:ns:yang:ietf-crypto-types">
<asymmetric-keys>
<asymmetric-key>
<name>Manufacturer-Generated Hidden Key</name>
<public-key-format>ct:subject-public-key-info-format</public-k\
ey-format>
<public-key>base64encodedvalue==</public-key>
<hidden-private-key/> <!-- e.g., TPM protected -->
<certificates>
<certificate>
<name>Manufacturer-Generated IDevID Cert</name>
<cert>base64encodedvalue==</cert>
</certificate>
<certificate>
<name>Deployment-Specific LDevID Cert</name>
<cert>base64encodedvalue==</cert>
</certificate>
</certificates>
</asymmetric-key>
</asymmetric-keys>
</keystore>
After the above configuration is applied, <operational> should appear
as follows:
========== NOTE: '\' line wrapping per BCP XXX (RFC XXXX) ===========
<keystore xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore"
xmlns:ct="urn:ietf:params:xml:ns:yang:ietf-crypto-types"
xmlns:or="urn:ietf:params:xml:ns:yang:ietf-origin"
or:origin="or:intended">
<asymmetric-keys>
<asymmetric-key or:origin="or:system">
<name>Manufacturer-Generated Hidden Key</name>
<public-key-format>ct:subject-public-key-info-format</public-k\
ey-format>
<public-key>base64encodedvalue==</public-key>
<hidden-private-key/> <!-- e.g., TPM protected -->
<certificates>
<certificate>
<name>Manufacturer-Generated IDevID Cert</name>
<cert>base64encodedvalue==</cert>
</certificate>
<certificate or:origin="or:intended">
<name>Deployment-Specific LDevID Cert</name>
<cert>base64encodedvalue==</cert>
</certificate>
</certificates>
</asymmetric-key>
</asymmetric-keys>
</keystore>
5. Encrypting Keys in Configuration
This section describes an approach that enables all the private keys
on a server to be encrypted, such that traditional backup/restore
procedures can be used without concern for keys being compromised
when in transit.
5.1. Root Key
The cornerstone to this solution is the existence of a "root" key
that can be used to encrypt all the other keys. The server MUST be
able to use this key to decrypt the other keys in the configuration.
The root key SHOULD be a hidden key, i.e., one whose private data has
no presence in <running> or <operational> (see "hidden-key" and
"hidden-private-key" in "ietf-crypto-types"
[I-D.ietf-netconf-crypto-types]). If the server implementation does
not support hidden keys, then the private data part of key MUST be
protected by access control with access granted only to an
administrator with special access control rights (e.g., an
organization's crypto officer). Given the long lifetime of built-in
keys (see Section 4), built-in keys MUST be hidden.
A hidden root key MAY be either a symmetric key or an asymmetric key.
If the hidden root key is symmetric, then the server MUST provide
APIs enabling other keys (ideally generated by the server) to be
encrypted. If the hidden root key is asymmetric, then the server
SHOULD provide APIs enabling other keys to be both generated and
encrypted by it, but MAY alternatively enable administrators with
special access control rights to generate and encrypt the other keys
themselves, using the hidden key's public part. For practical
reasons, an unhidden root key SHOULD be asymmetric, so that its
public part can be accessed by other administrators without concern.
5.2. Configuring Encrypting Keys
Each time a new key is to be configured, it SHOULD be encrypted by
the root key.
In "ietf-crypto-types" [I-D.ietf-netconf-crypto-types], the format
for an encrypted symmetric key is described by the "encrypted-one-
symmetric-key-format" identity, while the format for an encrypted
asymmetric key is described by the "encrypted-one-asymmetric-key-
format" identity
Ideally, the server implementation provides an API to generate a
symmetric or asymmetric key, and encrypt the generated key using
another key known to the system (e.g., the root key). Thusly
administrators can safely call this API to configure new keys.
In case the server implementation does not provide such an API, then
the generating and encrypting steps MAY be performed outside the
server, e.g., by an administrator with special access control rights.
In either case, the encrypted key can be configured into the Keystore
using either the "encrypted-key" (for symmetric keys) or the
"encrypted-private-key" (for asymmetric keys) nodes. These two nodes
contain both the encrypted value as well as a reference to the other
key in the Keystore that it was encrypted by.
5.3. Migrating Configuration to Another Server
One concern that arose during discourse was how it could be possible
migrate configuration from one server to another server, if both
servers used different root keys (e.g., a TPM-protected built-in
key). It was noted that, in this case, the second server would be
unable to decrypt any of the keys encrypted by the first server.
The solution to this issue is simply to ensure that the same key is
known to both servers. How this is achieved may vary. If the first
server is still accessible, it may be possible to ask it to encrypt
the key using the second server's root key. That said, a common
scenario for needing to migrate configuration to another server is
because the first server is no longer available. Thus it is more
likely the case that the shared root key is known to administrators
with special access control rights (an organization's crypto
officer), such that the shared key can be provided to the second
server to unlock all the other keys in the configuration.
For systems that have a built-in key protected by hardware, the
shared root key SHOULD be encrypted by the built-in key. In this
way, at least from the system's perspective, it is more like an
intermediate key than a root key.
As a concrete example, assuming both servers have built-in asymmetric
keys, the shared key could be a symmetric key that an organization's
crypto officer encrypts offline knowing each server's public key,
which may be, e.g., in the server's IDevID certificate. The crypto
officer can then safely handoff the encrypted shared key to other
administrators responsible for server installations, including
migrations.
In order to migrate a configuration, the administrator would need to
make just a single modification to the configuration before loading
it onto the second server, which is to replace the shared key's
Keystore entry from the first server (an encrypted key), with the
shared key encrypted by the second server's built-in key.
6. Security Considerations 6. Security Considerations
The YANG module defined in this document is designed to be accessed The YANG module defined in this document is designed to be accessed
via YANG based management protocols, such as NETCONF [RFC6241] and via YANG based management protocols, such as NETCONF [RFC6241] and
RESTCONF [RFC8040]. Both of these protocols have mandatory-to- RESTCONF [RFC8040]. Both of these protocols have mandatory-to-
implement secure transport layers (e.g., SSH, TLS) with mutual implement secure transport layers (e.g., SSH, TLS) with mutual
authentication. authentication.
The NETCONF access control model (NACM) [RFC8341] provides the means The NETCONF access control model (NACM) [RFC8341] provides the means
skipping to change at page 34, line 26 skipping to change at page 35, line 14
7.2. The YANG Module Names Registry 7.2. The YANG Module Names Registry
This document registers one YANG module in the YANG Module Names This document registers one YANG module in the YANG Module Names
registry [RFC6020]. Following the format in [RFC6020], the the registry [RFC6020]. Following the format in [RFC6020], the the
following registration is requested: following registration is requested:
name: ietf-keystore name: ietf-keystore
namespace: urn:ietf:params:xml:ns:yang:ietf-keystore namespace: urn:ietf:params:xml:ns:yang:ietf-keystore
prefix: ks prefix: ks
reference: RFC XXXX reference: RFC CCCC
8. References 8. References
8.1. Normative References 8.1. Normative References
[I-D.ietf-netconf-crypto-types] [I-D.ietf-netconf-crypto-types]
Watsen, K. and H. Wang, "Common YANG Data Types for Watsen, K. and H. Wang, "Common YANG Data Types for
Cryptography", draft-ietf-netconf-crypto-types-13 (work in Cryptography", draft-ietf-netconf-crypto-types-14 (work in
progress), November 2019. progress), March 2020.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for
the Network Configuration Protocol (NETCONF)", RFC 6020, the Network Configuration Protocol (NETCONF)", RFC 6020,
DOI 10.17487/RFC6020, October 2010, DOI 10.17487/RFC6020, October 2010,
<https://www.rfc-editor.org/info/rfc6020>. <https://www.rfc-editor.org/info/rfc6020>.
skipping to change at page 36, line 5 skipping to change at page 36, line 33
and R. Wilton, "Network Management Datastore Architecture and R. Wilton, "Network Management Datastore Architecture
(NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018,
<https://www.rfc-editor.org/info/rfc8342>. <https://www.rfc-editor.org/info/rfc8342>.
[Std-802.1AR-2009] [Std-802.1AR-2009]
Group, W. -. H. L. L. P. W., "IEEE Standard for Local and Group, W. -. H. L. L. P. W., "IEEE Standard for Local and
metropolitan area networks - Secure Device Identity", metropolitan area networks - Secure Device Identity",
December 2009, <http://standards.ieee.org/findstds/ December 2009, <http://standards.ieee.org/findstds/
standard/802.1AR-2009.html>. standard/802.1AR-2009.html>.
8.3. URIs
[1] https://tools.ietf.org/html/draft-ietf-netconf-crypto-types
[2] https://tools.ietf.org/html/draft-ietf-netconf-trust-anchors
[3] https://tools.ietf.org/html/draft-ietf-netconf-keystore
[4] https://tools.ietf.org/html/draft-ietf-netconf-tcp-client-server
[5] https://tools.ietf.org/html/draft-ietf-netconf-ssh-client-server
[6] https://tools.ietf.org/html/draft-ietf-netconf-tls-client-server
[7] https://tools.ietf.org/html/draft-ietf-netconf-http-client-server
[8] https://tools.ietf.org/html/draft-ietf-netconf-netconf-client-
server
[9] https://tools.ietf.org/html/draft-ietf-netconf-restconf-client-
server
Appendix A. Change Log Appendix A. Change Log
A.1. 00 to 01 A.1. 00 to 01
o Replaced the 'certificate-chain' structures with PKCS#7 o Replaced the 'certificate-chain' structures with PKCS#7
structures. (Issue #1) structures. (Issue #1)
o Added 'private-key' as a configurable data node, and removed the o Added 'private-key' as a configurable data node, and removed the
'generate-private-key' and 'load-private-key' actions. (Issue #2) 'generate-private-key' and 'load-private-key' actions. (Issue #2)
skipping to change at page 39, line 40 skipping to change at page 41, line 40
A.16. 15 to 16 A.16. 15 to 16
o Moved the generate key actions to ietf-crypt-types as RPCs, which o Moved the generate key actions to ietf-crypt-types as RPCs, which
are augmented by ietf-keystore to support encrypted keys. are augmented by ietf-keystore to support encrypted keys.
Examples updated accordingly. Examples updated accordingly.
o Added a SSH certificate-based key (RFC 6187) and a raw private key o Added a SSH certificate-based key (RFC 6187) and a raw private key
to the example instance document (partly so they could be to the example instance document (partly so they could be
referenced by examples in the SSH and TLS client/server drafts. referenced by examples in the SSH and TLS client/server drafts.
A.17. 16 to 17
o Removed augments to the "generate-symmetric-key" and "generate-
asymmetric-key" groupings.
o Removed "generate-symmetric-key" and "generate-asymmetric-key"
examples.
o Removed the "algorithm" nodes from remaining examples.
o Renamed/updated the "Support for Built-in Keys" section.
o Added new section "Encrypting Keys in Configuration".
o Added a "Note to Reviewers" note to first page.
Acknowledgements Acknowledgements
The authors would like to thank for following for lively discussions The authors would like to thank for following for lively discussions
on list and in the halls (ordered by first name): Alan Luchuk, Andy on list and in the halls (ordered by first name): Alan Luchuk, Andy
Bierman, Benoit Claise, Bert Wijnen, Balazs Kovacs, David Lamparter, Bierman, Benoit Claise, Bert Wijnen, Balazs Kovacs, David Lamparter,
Eric Voit, Ladislav Lhotka, Liang Xia, Juergen Schoenwaelder, Mahesh Eric Voit, Ladislav Lhotka, Liang Xia, Juergen Schoenwaelder, Mahesh
Jethanandani, Martin Bjorklund, Mehmet Ersue, Phil Shafer, Radek Jethanandani, Martin Bjorklund, Mehmet Ersue, Phil Shafer, Radek
Krejci, Ramkumar Dhanapal, Reshad Rahman, Sean Turner, and Tom Petch. Krejci, Ramkumar Dhanapal, Reshad Rahman, Sean Turner, and Tom Petch.
Author's Address Author's Address
 End of changes. 111 change blocks. 
358 lines changed or deleted 398 lines changed or added

This html diff was produced by rfcdiff 1.47. The latest version is available from http://tools.ietf.org/tools/rfcdiff/