BUG-9261: introduce netconf keystore service
[netconf.git] / netconf / sal-netconf-connector / src / main / yang / netconf-keystore.yang
1 module netconf-keystore {
2     namespace "urn:opendaylight:netconf:keystore";
3     prefix "keystore";
4
5     revision "2017-10-17" {
6         description "Initial revision of the Netconf SBP keystore.";
7     }
8
9     description "Store used for key based Credentials for Netconf SBP. Before a connector with key based authentication
10                  is created it needs to have a record for the key pair it uses. All the records here need to be
11                  encrypted as they contain sensitive data. Therefore NEVER do direct writes and only use the provided
12                  RPC's for adding/removing key entries.";
13
14     grouping keystore-entry {
15         list key-credential {
16             key key-id;
17
18             leaf key-id {
19                 type string;
20             }
21
22             leaf private-key {
23                 description "Base64 encoded private key that should be used for authentication with a netconf device.
24                              Do not include a public key as that is calculated from the private key.
25                              DO NOT write this directly into the datastore, use the provided rpc's as these will
26                              encrypt the key before the entry is written into the datastore.";
27                 type string;
28             }
29
30             leaf passphrase {
31                 description "If the provided key is encrypted by a passphrase this needs to be included. Leave empty
32                              if the key does not have a passphrase.
33                              DO NOT write write this directly into the datastore, use the provided rpc's as these will
34                              encrypt the passhprase before the entry is written into the datastore.";
35                 type string;
36             }
37         }
38     }
39
40     container keystore {
41         uses keystore-entry;
42     }
43
44     rpc add-keystore-entry {
45         description "Use this rpc to add a single or multiple new keys into the keystore. The private key
46                      and passphrase will both be encrypted before they are written into the datastore.";
47         input {
48             uses keystore-entry;
49         }
50     }
51
52     rpc remove-keystore-entry {
53         description "Use this rpc to remove a single or multiple keys from the datastore.";
54         input {
55             leaf-list key-id {
56                 type string;
57             }
58         }
59     }
60 }