draft-ietf-netconf-keystore-11.txt   draft-ietf-netconf-keystore-12.txt 
NETCONF Working Group K. Watsen NETCONF Working Group K. Watsen
Internet-Draft Watsen Networks Internet-Draft Watsen Networks
Intended status: Standards Track June 17, 2019 Intended status: Standards Track July 2, 2019
Expires: December 19, 2019 Expires: January 3, 2020
A YANG Data Model for a Keystore A YANG Data Model for a Keystore
draft-ietf-netconf-keystore-11 draft-ietf-netconf-keystore-12
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 asymmetric keys and their enables centralized configuration of both symmetric and asymmetric
associated certificates, and notification for when configured keys. The secret value for both key types may be encrypted.
certificates are about to expire. Asymmetric keys may be associated with certificates. Notifications
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 many placeholder values that need to be replaced
with finalized values at the time of publication. This note with finalized values at the time of publication. This note
summarizes all of the substitutions that are needed. No other RFC summarizes all of the substitutions that are needed. No other RFC
Editor instructions are specified elsewhere in this document. Editor 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 "VVVV" --> the assigned RFC value for this draft o "VVVV" --> 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 "2019-06-17" --> the publication date of this draft o "2019-07-02" --> 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
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 December 19, 2019. This Internet-Draft will expire on January 3, 2020.
Copyright Notice Copyright Notice
Copyright (c) 2019 IETF Trust and the persons identified as the Copyright (c) 2019 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 . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Requirements Language . . . . . . . . . . . . . . . . . . . . 4 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 3
3. The Keystore Model . . . . . . . . . . . . . . . . . . . . . 4 3. The Keystore Model . . . . . . . . . . . . . . . . . . . . . 4
3.1. Tree Diagram . . . . . . . . . . . . . . . . . . . . . . 4 3.1. Tree Diagram . . . . . . . . . . . . . . . . . . . . . . 4
3.2. Example Usage . . . . . . . . . . . . . . . . . . . . . . 11 3.2. Example Usage . . . . . . . . . . . . . . . . . . . . . . 12
3.3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . 16 3.2.1. A Keystore Instance . . . . . . . . . . . . . . . . . 12
4. Security Considerations . . . . . . . . . . . . . . . . . . . 26 3.2.2. The "generate-symmetric-key" RPC . . . . . . . . . . 14
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 27 3.2.3. Notable Keystore Groupings . . . . . . . . . . . . . 14
5.1. The IETF XML Registry . . . . . . . . . . . . . . . . . . 27 3.3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . 18
5.2. The YANG Module Names Registry . . . . . . . . . . . . . 28 4. Security Considerations . . . . . . . . . . . . . . . . . . . 27
6. References . . . . . . . . . . . . . . . . . . . . . . . . . 28 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 28
6.1. Normative References . . . . . . . . . . . . . . . . . . 28 5.1. The IETF XML Registry . . . . . . . . . . . . . . . . . . 29
6.2. Informative References . . . . . . . . . . . . . . . . . 29 5.2. The YANG Module Names Registry . . . . . . . . . . . . . 29
Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 30 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 29
A.1. 00 to 01 . . . . . . . . . . . . . . . . . . . . . . . . 30 6.1. Normative References . . . . . . . . . . . . . . . . . . 29
A.2. 01 to 02 . . . . . . . . . . . . . . . . . . . . . . . . 30 6.2. Informative References . . . . . . . . . . . . . . . . . 30
A.3. 02 to 03 . . . . . . . . . . . . . . . . . . . . . . . . 30 Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 31
A.4. 03 to 04 . . . . . . . . . . . . . . . . . . . . . . . . 30 A.1. 00 to 01 . . . . . . . . . . . . . . . . . . . . . . . . 31
A.5. 04 to 05 . . . . . . . . . . . . . . . . . . . . . . . . 31 A.2. 01 to 02 . . . . . . . . . . . . . . . . . . . . . . . . 31
A.6. 05 to 06 . . . . . . . . . . . . . . . . . . . . . . . . 31 A.3. 02 to 03 . . . . . . . . . . . . . . . . . . . . . . . . 31
A.7. 06 to 07 . . . . . . . . . . . . . . . . . . . . . . . . 31 A.4. 03 to 04 . . . . . . . . . . . . . . . . . . . . . . . . 31
A.8. 07 to 08 . . . . . . . . . . . . . . . . . . . . . . . . 31 A.5. 04 to 05 . . . . . . . . . . . . . . . . . . . . . . . . 32
A.9. 08 to 09 . . . . . . . . . . . . . . . . . . . . . . . . 31 A.6. 05 to 06 . . . . . . . . . . . . . . . . . . . . . . . . 32
A.10. 09 to 10 . . . . . . . . . . . . . . . . . . . . . . . . 32 A.7. 06 to 07 . . . . . . . . . . . . . . . . . . . . . . . . 32
A.11. 10 to 11 . . . . . . . . . . . . . . . . . . . . . . . . 32 A.8. 07 to 08 . . . . . . . . . . . . . . . . . . . . . . . . 32
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 32 A.9. 08 to 09 . . . . . . . . . . . . . . . . . . . . . . . . 32
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 33 A.10. 09 to 10 . . . . . . . . . . . . . . . . . . . . . . . . 33
A.11. 10 to 11 . . . . . . . . . . . . . . . . . . . . . . . . 33
A.12. 11 to 12 . . . . . . . . . . . . . . . . . . . . . . . . 33
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 34
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 34
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 asymmetric keys keystore" that enables centralized configuration of both symmetric
and their associated certificates, and notification for when and asymmetric keys. The secret value for both key types may be
configured certificates are about to expire. encrypted. Asymmetric keys may be associated with certificates.
Notifications are sent when certificates are about to expire.
This module also defines Six groupings designed for maximum reuse. The "ietf-keystore" module defines many "grouping" statements
These groupings include one for the public half of an asymmetric key, intended for use by other modules that may import it. For instance,
one for both the public and private halves of an asymmetric key, one there are groupings that defined enabling a key to be either
for both halves of an asymmetric key and a list of associated configured locally (within the defining data model) or be a reference
certificates, one for an asymmetric key that may be configured to a key in the keystore.
locally or via a reference to an asymmetric key in the keystore, one
for a trust anchor certificate and, lastly, one for an end entity
certificate.
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 These systems are unique in that the cryptographic hardware hides the
completely hides the private keys and must perform all private key secret key values. To support such hardware, symmetric keys may have
operations. To support such hardware, the "private-key" can be the the value "hidden-key" and asymmetric keys may have the value
special value "permanently-hidden" and the actions "generate-hidden- "hidden-private-key". While how such keys are created or destroyed
key" and "generate-certificate-signing-request" can be used to direct is outside the scope of this document, the keystore can contain
these operations to the hardware . entries for such keys, enabling them to be reference by other
configuration elements.
This document in compliant with Network Management Datastore This document in compliant with Network Management Datastore
Architecture (NMDA) [RFC8342]. For instance, to support keys and Architecture (NMDA) [RFC8342]. For instance, keys and associated
associated certificates installed during manufacturing (e.g., for a certificates installed during manufacturing (e.g., for a IDevID
IDevID [Std-802.1AR-2009] certificate), it is expected that such data [Std-802.1AR-2009] certificate), it is expected that such data may
may appear only in <operational>. appear only in <operational>.
While only asymmetric keys are currently supported, the module has
been designed to enable other key types to be introduced in the
future.
The module does not support protecting the contents of the keystore
(e.g., via encryption), though it could be extended to do so in the
future.
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
skipping to change at page 4, line 27 skipping to change at page 4, line 19
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 | +--rw algorithm
| | asymmetric-key-algorithm-ref | | asymmetric-key-algorithm-t
| +--rw public-key binary | +--rw public-key binary
| +--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
| | +--rw (key-type) | | +--rw (key-type)
| | | +--:(symmetric-key) | | | +--:(symmetric-key-ref)
| | | | +--rw symmetric-key? leafref | | | | +--rw symmetric-key-ref? leafref
| | | +--:(asymmetric-key) | | | | {keystore-supported}?
| | | +--rw asymmetric-key? leafref | | | +--:(asymmetric-key-ref)
| | +--rw value? binary | | | +--rw asymmetric-key-ref? leafref
| | | {keystore-supported}?
| | +--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
| +---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 binary
+--rw symmetric-keys +--rw symmetric-keys
+--rw symmetric-key* [name] +--rw symmetric-key* [name]
+--rw name string +--rw name string
+--rw algorithm identityref +--rw algorithm encryption-algorithm-t
+--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) | +--:(symmetric-key-ref)
| | +--rw symmetric-key? leafref | | +--rw symmetric-key-ref? leafref
| +--:(asymmetric-key) | | {keystore-supported}?
| +--rw asymmetric-key? leafref | +--:(asymmetric-key-ref)
+--rw value? binary | +--rw asymmetric-key-ref? leafref
| {keystore-supported}?
+--rw value? binary
rpcs: rpcs:
+---x generate-symmetric-key +---x generate-symmetric-key
| +---w input | +---w input
| | +---w algorithm identityref | | +---w algorithm ct:encryption-algorithm-t
| | +---w encrypt-with! | | +---w encrypt-with!
| | +---w (key-type) | | +---w (key-type)
| | +--:(symmetric-key) | | +--:(symmetric-key-ref)
| | | +---w symmetric-key? leafref | | | +---w symmetric-key-ref? leafref
| | +--:(asymmetric-key) | | | {keystore-supported}?
| | +---w asymmetric-key? leafref | | +--:(asymmetric-key-ref)
| | +---w asymmetric-key-ref? leafref
| | {keystore-supported}?
| +--ro output | +--ro output
| +--ro algorithm identityref | +--ro algorithm encryption-algorithm-t
| +--ro (key-type) | +--ro (key-type)
| +--:(key) | +--:(key)
| | +--ro key? binary | | +--ro key? binary
| +--:(hidden-key) | +--:(hidden-key)
| | +--ro hidden-key? empty | | +--ro hidden-key? empty
| +--:(encrypted-key) | +--:(encrypted-key)
| +--ro encrypted-key | +--ro encrypted-key
| +--ro (key-type) | +--ro (key-type)
| | +--:(symmetric-key) | | +--:(symmetric-key-ref)
| | | +--ro symmetric-key? leafref | | | +--ro symmetric-key-ref? leafref
| | +--:(asymmetric-key) | | | {keystore-supported}?
| | +--ro asymmetric-key? leafref | | +--:(asymmetric-key-ref)
| +--ro value? binary | | +--ro asymmetric-key-ref? leafref
| | {keystore-supported}?
| +--ro value? binary
+---x generate-asymmetric-key +---x generate-asymmetric-key
+---w input +---w input
| +---w algorithm identityref | +---w algorithm ct:asymmetric-key-algorithm-t
| +---w encrypt-with! | +---w encrypt-with!
| +---w (key-type) | +---w (key-type)
| +--:(symmetric-key) | +--:(symmetric-key-ref)
| | +---w symmetric-key? leafref | | +---w symmetric-key-ref? leafref
| +--:(asymmetric-key) | | {keystore-supported}?
| +---w asymmetric-key? leafref | +--:(asymmetric-key-ref)
| +---w asymmetric-key-ref? leafref
| {keystore-supported}?
+--ro output +--ro output
+--ro algorithm +--ro algorithm
| asymmetric-key-algorithm-ref | asymmetric-key-algorithm-t
+--ro public-key binary +--ro public-key binary
+--ro (private-key-type) +--ro (private-key-type)
+--:(private-key) +--:(private-key)
| +--ro private-key? binary | +--ro private-key? binary
+--:(hidden-private-key) +--:(hidden-private-key)
| +--ro hidden-private-key? empty | +--ro hidden-private-key? empty
+--:(encrypted-private-key) +--:(encrypted-private-key)
+--ro encrypted-private-key +--ro encrypted-private-key
+--ro (key-type) +--ro (key-type)
| +--:(symmetric-key) | +--:(symmetric-key-ref)
| | +--ro symmetric-key? leafref | | +--ro symmetric-key-ref? leafref
| +--:(asymmetric-key) | | {keystore-supported}?
| +--ro asymmetric-key? leafref | +--:(asymmetric-key-ref)
+--ro value? binary | +--ro asymmetric-key-ref? leafref
| {keystore-supported}?
+--ro value? binary
grouping key-reference-type-grouping
+-- (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}?
grouping encrypted-value-grouping grouping encrypted-value-grouping
+-- (key-type) +-- (key-type)
| +--:(symmetric-key) | +--:(symmetric-key-ref)
| | +-- symmetric-key? | | +-- symmetric-key-ref?
| | -> /keystore/symmetric-keys/symmetric-key/name | | -> /keystore/symmetric-keys/symmetric-key/name
| +--:(asymmetric-key) | | {keystore-supported}?
| +-- asymmetric-key? | +--:(asymmetric-key-ref)
| +-- asymmetric-key-ref?
| -> /keystore/asymmetric-keys/asymmetric-key/name | -> /keystore/asymmetric-keys/asymmetric-key/name
+-- value? binary | {keystore-supported}?
+-- value? binary
grouping symmetric-key-grouping grouping symmetric-key-grouping
+-- algorithm identityref +-- algorithm encryption-algorithm-t
+-- (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) | +--:(symmetric-key-ref)
| | +-- symmetric-key? leafref | | +-- symmetric-key-ref? leafref
| +--:(asymmetric-key) | | {keystore-supported}?
| +-- asymmetric-key? leafref | +--:(asymmetric-key-ref)
+-- value? binary | +-- asymmetric-key-ref? leafref
| {keystore-supported}?
+-- value? binary
grouping asymmetric-key-pair-grouping grouping asymmetric-key-pair-grouping
+-- algorithm asymmetric-key-algorithm-ref +-- algorithm asymmetric-key-algorithm-t
+-- public-key binary +-- public-key binary
+-- (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) | +--:(symmetric-key-ref)
| | +-- symmetric-key? leafref | | +-- symmetric-key-ref? leafref
| +--:(asymmetric-key) | | {keystore-supported}?
| +-- asymmetric-key? leafref | +--:(asymmetric-key-ref)
+-- value? binary | +-- asymmetric-key-ref? leafref
| {keystore-supported}?
+-- value? binary
grouping asymmetric-key-pair-with-cert-grouping grouping asymmetric-key-pair-with-cert-grouping
+-- algorithm +-- algorithm
| asymmetric-key-algorithm-ref | asymmetric-key-algorithm-t
+-- public-key binary +-- public-key binary
+-- (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) | | +--:(symmetric-key-ref)
| | | +-- symmetric-key? leafref | | | +-- symmetric-key-ref? leafref
| | +--:(asymmetric-key) | | | {keystore-supported}?
| | +-- asymmetric-key? leafref | | +--:(asymmetric-key-ref)
| +-- value? binary | | +-- asymmetric-key-ref? leafref
| | {keystore-supported}?
| +-- 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
+---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 binary
grouping asymmetric-key-pair-with-certs-grouping grouping asymmetric-key-pair-with-certs-grouping
+-- algorithm +-- algorithm
| asymmetric-key-algorithm-ref | asymmetric-key-algorithm-t
+-- public-key binary +-- public-key binary
+-- (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) | | +--:(symmetric-key-ref)
| | | +-- symmetric-key? leafref | | | +-- symmetric-key-ref? leafref
| | +--:(asymmetric-key) | | | {keystore-supported}?
| | +-- asymmetric-key? leafref | | +--:(asymmetric-key-ref)
| +-- value? binary | | +-- asymmetric-key-ref? leafref
| | {keystore-supported}?
| +-- 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
+---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 binary
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-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 | +-- algorithm
| | asymmetric-key-algorithm-ref | | asymmetric-key-algorithm-t
| +-- public-key binary | +-- public-key binary
| +-- (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) | | +--:(symmetric-key-ref)
| | | +-- symmetric-key? leafref | | | +-- symmetric-key-ref? leafref
| | +--:(asymmetric-key) | | | {keystore-supported}?
| | +-- asymmetric-key? leafref | | +--:(asymmetric-key-ref)
| +-- value? binary | | +-- asymmetric-key-ref? leafref
| | {keystore-supported}?
| +-- 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 | +-- algorithm
| | asymmetric-key-algorithm-ref | | asymmetric-key-algorithm-t
| +-- public-key binary | +-- public-key binary
| +-- (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) | | | +--:(symmetric-key-ref)
| | | | +-- symmetric-key? leafref | | | | +-- symmetric-key-ref? leafref
| | | +--:(asymmetric-key) | | | | {keystore-supported}?
| | | +-- asymmetric-key? leafref | | | +--:(asymmetric-key-ref)
| | +-- value? binary | | | +-- asymmetric-key-ref? leafref
| | | {keystore-supported}?
| | +-- 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
| +---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 binary
+--:(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 | +-- algorithm
| | asymmetric-key-algorithm-ref | | asymmetric-key-algorithm-t
| +-- public-key binary | +-- public-key binary
| +-- (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) | | | +--:(symmetric-key-ref)
| | | | +-- symmetric-key? leafref | | | | +-- symmetric-key-ref? leafref
| | | +--:(asymmetric-key) | | | | {keystore-supported}?
| | | +-- asymmetric-key? leafref | | | +--:(asymmetric-key-ref)
| | +-- value? binary | | | +-- asymmetric-key-ref? leafref
| | | {keystore-supported}?
| | +-- 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
| +---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 binary
+--:(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 | +-- algorithm
| | asymmetric-key-algorithm-ref | | asymmetric-key-algorithm-t
| +-- public-key binary | +-- public-key binary
| +-- (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) | | | +--:(symmetric-key-ref)
| | | | +-- symmetric-key? leafref | | | | +-- symmetric-key-ref? leafref
| | | +--:(asymmetric-key) | | | | {keystore-supported}?
| | | +-- asymmetric-key? leafref | | | +--:(asymmetric-key-ref)
| | +-- value? binary | | | +-- asymmetric-key-ref? leafref
| | | {keystore-supported}?
| | +-- 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
| +---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 binary
+-- symmetric-keys +-- symmetric-keys
+-- symmetric-key* [name] +-- symmetric-key* [name]
+-- name? string +-- name? string
+-- algorithm identityref +-- algorithm encryption-algorithm-t
+-- (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) | +--:(symmetric-key-ref)
| | +-- symmetric-key? leafref | | +-- symmetric-key-ref? leafref
| +--:(asymmetric-key) | | {keystore-supported}?
| +-- asymmetric-key? leafref | +--:(asymmetric-key-ref)
+-- value? binary | +-- asymmetric-key-ref? leafref
| {keystore-supported}?
+-- value? binary
3.2. Example Usage 3.2. Example Usage
3.2.1. A Keystore Instance
The following example illustrates what a fully configured keystore The following example illustrates what a fully configured keystore
might look like in <operational>, as described by Section 5.3 in might look like in <operational>, as described by Section 5.3 in
[RFC8342]. This datastore view illustrates data set by the [RFC8342]. This datastore view illustrates data set by the
manufacturing process alongside conventional configuration. This manufacturing process alongside conventional configuration. This
keystore instance has four keys, two having one associated keystore instance has four keys, two having one associated
certificate, one having two associated certificates, and one empty certificate, one having two associated certificates, and one empty
key. key.
=========== NOTE: '\' line wrapping per BCP XX (RFC XXXX) ===========
<keystore xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore" <keystore xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore"
xmlns:or="urn:ietf:params:xml:ns:yang:ietf-origin" xmlns:or="urn:ietf:params:xml:ns:yang:ietf-origin"
xmlns:ct="urn:ietf:params:xml:ns:yang:ietf-crypto-types"
or:origin="or:intended"> or:origin="or:intended">
<!-- Asymmetric Keys -->
<asymmetric-keys> <asymmetric-keys>
<asymmetric-key> <asymmetric-key>
<name>ex-rsa-key</name> <name>ex-rsa-key</name>
<algorithm>ct:rsa2048</algorithm> <algorithm>rsa2048</algorithm>
<public-key>base64encodedvalue==</public-key> <public-key>base64encodedvalue==</public-key>
<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>tls-ec-key</name> <name>tls-ec-key</name>
<algorithm>ct:secp256r1</algorithm> <algorithm>secp256r1</algorithm>
<public-key>base64encodedvalue==</public-key> <public-key>base64encodedvalue==</public-key>
<private-key>base64encodedvalue==</private-key> <private-key>base64encodedvalue==</private-key>
<certificates> <certificates>
<certificate> <certificate>
<name>tls-ec-cert</name> <name>tls-ec-cert</name>
<cert>base64encodedvalue==</cert> <cert>base64encodedvalue==</cert>
</certificate> </certificate>
</certificates> </certificates>
</asymmetric-key> </asymmetric-key>
<!-- all except 'my-ldevid-cert' copied from <operational> -->
<asymmetric-key> <asymmetric-key>
<name>tpm-protected-key</name> <name>tpm-protected-key</name>
<algorithm>ct:rsa2048</algorithm> <algorithm>rsa2048</algorithm>
<public-key>base64encodedvalue==</public-key> <public-key>base64encodedvalue==</public-key>
<hidden-private-key/> <hidden-private-key/>
<certificates> <certificates>
<certificate> <certificate>
<name>builtin-idevid-cert</name> <name>builtin-idevid-cert</name>
</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>
<name>encrypted-key</name>
<algorithm>secp256r1</algorithm>
<public-key>base64encodedvalue==</public-key>
<encrypted-private-key>
<symmetric-key-ref>operators-encrypted-key</symmetric-key-re\
f>
<value>base64encodedvalue==</value>
</encrypted-private-key>
</asymmetric-key>
</asymmetric-keys> </asymmetric-keys>
<!-- Symmetric Keys -->
<symmetric-keys>
<symmetric-key>
<name>operators-encrypted-key</name>
<algorithm>aes-256-cbc</algorithm>
<encrypted-key>
<asymmetric-key-ref>tpm-protected-key</asymmetric-key-ref>
<value>base64encodedvalue==</value>
</encrypted-key>
</symmetric-key>
</symmetric-keys>
</keystore> </keystore>
The following example module has been constructed to illustrate the 3.2.2. The "generate-symmetric-key" RPC
"local-or-keystore-asymmetric-key-grouping" grouping defined in the
"ietf-keystore" module. The following example illustrates the "generate-symmetric-key" RPC.
The key being referenced is defined in the keystore example above.
<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-keystore">
<algorithm>aes-256-cbc</algorithm>
<encrypt-with>
<asymmetric-key-ref>tpm-protected-key</asymmetric-key-ref>
</encrypt-with>
</generate-symmetric-key>
</rpc>
Following is the complimentary RPC-reply.
=========== NOTE: '\' line wrapping per BCP XX (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">
<!--<data> yanglint validation fails -->
<ks:algorithm>aes-256-cbc</ks:algorithm>
<ks:encrypted-key>
<ks:asymmetric-key-ref>tpm-protected-key</ks:asymmetric-key-re\
f>
<ks:value>base64encodedvalue==</ks:value>
</ks:encrypted-key>
<!--</data> yanglint validation fails -->
</rpc-reply>
3.2.3. Notable Keystore Groupings
The following non-normative module is used by subsequent examples to
illustrate groupings defined in the ietf-crypto-types 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 14, line 43 skipping to change at page 16, line 45
=========== NOTE: '\' line wrapping per BCP XX (RFC XXXX) =========== =========== NOTE: '\' line wrapping per BCP XX (RFC XXXX) ===========
<keystore-usage xmlns="http://example.com/ns/example-keystore-usage"> <keystore-usage xmlns="http://example.com/ns/example-keystore-usage">
<!-- 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 <algorithm>rsa2048</algorithm>
xmlns:ct="urn:ietf:params:xml:ns:yang:ietf-crypto-types">
ct:rsa2048
</algorithm>
<private-key>base64encodedvalue==</private-key> <private-key>base64encodedvalue==</private-key>
<public-key>base64encodedvalue==</public-key> <public-key>base64encodedvalue==</public-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>ex-rsa-key</keystore-reference> <keystore-reference>ex-rsa-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>
skipping to change at page 15, line 14 skipping to change at page 17, line 12
<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>ex-rsa-key</keystore-reference> <keystore-reference>ex-rsa-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 <algorithm>rsa2048</algorithm>
xmlns:ct="urn:ietf:params:xml:ns:yang:ietf-crypto-types">
ct:rsa2048
</algorithm>
<private-key>base64encodedvalue==</private-key> <private-key>base64encodedvalue==</private-key>
<public-key>base64encodedvalue==</public-key> <public-key>base64encodedvalue==</public-key>
<certificates> <certificates>
<certificate> <certificate>
<name>a locally-defined cert</name> <name>a locally-defined cert</name>
<cert>base64encodedvalue==</cert> <cert>base64encodedvalue==</cert>
</certificate> </certificate>
</certificates> </certificates>
</local-definition> </local-definition>
</key-with-certs> </key-with-certs>
skipping to change at page 15, line 39 skipping to change at page 17, line 34
<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>ex-rsa-key</keystore-reference> <keystore-reference>ex-rsa-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 <algorithm>rsa2048</algorithm>
xmlns:ct="urn:ietf:params:xml:ns:yang:ietf-crypto-types">
ct:rsa2048
</algorithm>
<private-key>base64encodedvalue==</private-key> <private-key>base64encodedvalue==</private-key>
<public-key>base64encodedvalue==</public-key> <public-key>base64encodedvalue==</public-key>
<cert>base64encodedvalue==</cert> <cert>base64encodedvalue==</cert>
</local-definition> </local-definition>
</end-entity-cert-with-key> </end-entity-cert-with-key>
<end-entity-cert-with-key> <end-entity-cert-with-key>
<name>a keystore-defined certificate (and its associated key)</n\ <name>a keystore-defined certificate (and its associated key)</n\
ame> ame>
<keystore-reference> <keystore-reference>
skipping to change at page 16, line 18 skipping to change at page 18, line 11
</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@2019-06-17.yang" <CODE BEGINS> file "ietf-keystore@2019-07-02.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-crypto-types { import ietf-crypto-types {
prefix ct; prefix ct;
reference reference
"RFC CCCC: Common YANG Data Types for Cryptography"; "RFC CCCC: Common YANG Data Types for Cryptography";
} }
skipping to change at page 17, line 21 skipping to change at page 19, line 14
(https://www.rfc-editor.org/info/rfcXXXX); see the RFC (https://www.rfc-editor.org/info/rfcXXXX); 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 2019-06-17 { revision 2019-07-02 {
description description
"Initial version"; "Initial version";
reference reference
"RFC VVVV: A YANG Data Model for a Keystore"; "RFC VVVV: A YANG Data Model for a Keystore";
} }
/****************/ /****************/
/* Features */ /* Features */
/****************/ /****************/
skipping to change at page 18, line 22 skipping to change at page 20, line 15
} }
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 encrypted-value-grouping { grouping key-reference-type-grouping {
description description
"A reusable grouping for a value that has been encrypted by "A reusable grouping for a choice for the type of key
a symmeteric or asymmetric key 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 symmtric or asymmetric "A choice between a reference to a symmetric or asymmetric
key in the keystore."; key in the keystore.";
leaf symmetric-key { leaf symmetric-key-ref {
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 { leaf asymmetric-key-ref {
if-feature "keystore-supported";
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
"Identifies an asymmetric key used to encrypt this key."; "Identifies an asymmetric key used to encrypt this key.";
} }
} }
}
grouping encrypted-value-grouping {
description
"A reusable grouping for a value that has been encrypted by
a symmetric or asymmetric key in the keystore.";
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
skipping to change at page 23, line 51 skipping to change at page 26, line 4
list symmetric-key { list symmetric-key {
key "name"; key "name";
description description
"A symmetric key."; "A symmetric key.";
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
/*********************************/ /*********************************/
/* Protocol accessible nodes */ /* Protocol accessible nodes */
/*********************************/ /*********************************/
container keystore { container keystore {
nacm:default-deny-write; nacm:default-deny-write;
description description
skipping to change at page 24, line 28 skipping to change at page 26, line 29
rpc generate-symmetric-key { rpc generate-symmetric-key {
//nacm:default-deny-all; //nacm:default-deny-all;
description description
"Requests the device to generate an symmetric key using "Requests the device to generate an symmetric key using
the specified key algorithm, optionally encrypted using the specified key algorithm, optionally encrypted using
a key in the keystore. The output is this RPC can be a key in the keystore. The output is this RPC can be
used as input to a subsequent configuration request."; used as input to a subsequent configuration request.";
input { input {
leaf algorithm { leaf algorithm {
type identityref { type ct:encryption-algorithm-t;
base "ct:encryption-algorithm";
}
mandatory true; mandatory true;
description description
"The algorithm to be used when generating the key."; "The algorithm to be used when generating the key.";
reference reference
"RFC CCCC: Common YANG Data Types for Cryptography"; "RFC CCCC: Common YANG Data Types for Cryptography";
} }
container encrypt-with { container encrypt-with {
presence presence
"Indicates that the key should be encrypted using "Indicates that the key should be encrypted using
the specified symmetric or asymmetric key. If not the specified symmetric or asymmetric key. If not
specified, then the private key is not encrypted specified, then the private key is not encrypted
when returned."; when returned.";
description description
"A container for the 'key-type' choice."; "A container for the 'key-type' choice.";
choice key-type { uses key-reference-type-grouping;
mandatory true;
description
"Choice between a symmetric and asymmetric key.";
leaf symmetric-key {
type leafref {
path "/ks:keystore/ks:symmetric-keys/ks:symmetric-key/"
+ "ks:name";
}
description
"Identifies a symmetric key used to encrypt this key.";
}
leaf asymmetric-key {
type leafref {
path "/ks:keystore/ks:asymmetric-keys/ks:asymmetric-"
+ "key/ks:name";
}
description
"Identifies an asymmetric key used to encrypt this
key.";
}
}
} }
} }
output { output {
uses ks:symmetric-key-grouping; uses ks:symmetric-key-grouping;
} }
} // end generate-symmetric-key } // end generate-symmetric-key
rpc generate-asymmetric-key { rpc generate-asymmetric-key {
//nacm:default-deny-all; //nacm:default-deny-all;
description description
"Requests the device to generate an asymmetric key using "Requests the device to generate an asymmetric key using
the specified key algorithm, optionally encrypted using the specified key algorithm, optionally encrypted using
a key in the keystore. The output is this RPC can be a key in the keystore. The output is this RPC can be
used as input to a subsequent configuration request."; used as input to a subsequent configuration request.";
input { input {
leaf algorithm { leaf algorithm {
type identityref { type ct:asymmetric-key-algorithm-t;
base "ct:asymmetric-key-algorithm";
}
mandatory true; mandatory true;
description description
"The algorithm to be used when generating the key."; "The algorithm to be used when generating the key.";
reference reference
"RFC CCCC: Common YANG Data Types for Cryptography"; "RFC CCCC: Common YANG Data Types for Cryptography";
} }
container encrypt-with { container encrypt-with {
presence presence
"Indicates that the key should be encrypted using "Indicates that the key should be encrypted using
the specified symmetric or asymmetric key. If not the specified symmetric or asymmetric key. If not
specified, then the private key is not encrypted specified, then the private key is not encrypted
when returned."; when returned.";
description description
"A container for the 'key-type' choice."; "A container for the 'key-type' choice.";
choice key-type { uses key-reference-type-grouping;
mandatory true;
description
"Choice between a symmetric and asymmetric key.";
leaf symmetric-key {
type leafref {
path "/ks:keystore/ks:symmetric-keys/ks:symmetric-key/"
+ "ks:name";
}
description
"Identifies a symmetric key used to encrypt this key.";
}
leaf asymmetric-key {
type leafref {
path "/ks:keystore/ks:asymmetric-keys/ks:asymmetric-"
+ "key/ks:name";
}
description
"Identifies an asymmetric key used to encrypt this
key.";
}
}
} }
} }
output { output {
uses ks:asymmetric-key-pair-grouping; uses ks:asymmetric-key-pair-grouping;
} }
} // end generate-asymmetric-key } // end generate-asymmetric-key
} }
<CODE ENDS> <CODE ENDS>
4. Security Considerations 4. 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.
skipping to change at page 28, line 26 skipping to change at page 29, line 31
namespace: urn:ietf:params:xml:ns:yang:ietf-keystore namespace: urn:ietf:params:xml:ns:yang:ietf-keystore
prefix: ks prefix: ks
reference: RFC VVVV reference: RFC VVVV
6. References 6. References
6.1. Normative References 6.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-06 (work in Cryptography", draft-ietf-netconf-crypto-types-09 (work in
progress), April 2019. progress), June 2019.
[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 32, line 47 skipping to change at page 33, line 47
each new case statements for values that have been encrypted by each new case statements for values that have been encrypted by
other keys in the keystore. Refactored keystore model to use other keys in the keystore. Refactored keystore model to use
these groupings. these groupings.
o Added new 'symmetric-keys' lists, as a sibling to the existing o Added new 'symmetric-keys' lists, as a sibling to the existing
'asymmetric-keys' list. 'asymmetric-keys' list.
o Added RPCs (not actions) 'generate-symmetric-key' and 'generate- o Added RPCs (not actions) 'generate-symmetric-key' and 'generate-
asymmetric-key' to *return* a (potentially encrypted) key. asymmetric-key' to *return* a (potentially encrypted) key.
A.12. 11 to 12
o Updated to reflect crypto-type's draft using enumerations over
identities.
o Added examples for the 'generate-symmetric-key' and 'generate-
asymmetric-key' RPCs.
o Updated the Introduction section.
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 last name): Andy Bierman, Martin on list and in the halls (ordered by first name): Alan Luchuk, Andy
Bjorklund, Benoit Claise, Ramkumar Dhanapal, Mehmet Ersue, Balazs Bierman, Benoit Claise, Bert Wijnen, Balazs Kovacs, David Lamparter,
Kovacs, David Lamparter, Ladislav Lhotka, Alan Luchuk, Mahesh Eric Voit, Ladislav Lhotka, Liang Xia, Juergen Schoenwaelder, Mahesh
Jethanandani, Radek Krejci, Reshad Rahman, Tom Petch, Juergen Jethanandani, Martin Bjorklund, Mehmet Ersue, Phil Shafer, Radek
Schoenwaelder, Phil Shafer, Sean Turner, Eric Voit, Bert Wijnen, and Krejci, Ramkumar Dhanapal, Reshad Rahman, Sean Turner, and Tom Petch.
Liang Xia.
Author's Address Author's Address
Kent Watsen Kent Watsen
Watsen Networks Watsen Networks
EMail: kent+ietf@watsen.net EMail: kent+ietf@watsen.net
 End of changes. 80 change blocks. 
243 lines changed or deleted 310 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/