blob: 23e93cb9c7398dfdf6b7ddca34b92251623005f1 [file] [log] [blame]
Davide Pesavento933a5672020-07-03 22:32:43 -04001SafeBag Format for Exported Credentials
2=======================================
Yingdi Yu55ea01a2015-07-21 22:42:17 -07003
4Sometimes, one may need to export credentials (e.g., certificate and private key) from
5one machine, and import them into another machine. This requires a secured container for
6sensitive information. We define **SafeBag**, which contains both an NDN certificate
7(:doc:`version 2.0 <certificate-format>`) and the corresponding private
Davide Pesavento933a5672020-07-03 22:32:43 -04008key, which is encrypted in `PKCS #8 format <https://tools.ietf.org/html/rfc5208>`_.
Yingdi Yu55ea01a2015-07-21 22:42:17 -07009
10The format of **SafeBag** is defined as:
11
Davide Pesavento933a5672020-07-03 22:32:43 -040012.. code-block:: abnf
Yingdi Yu55ea01a2015-07-21 22:42:17 -070013
Junxiao Shi9a04dda2019-07-02 15:18:20 +000014 SafeBag = SAFE-BAG-TYPE TLV-LENGTH
Davide Pesavento933a5672020-07-03 22:32:43 -040015 CertificateV2
Junxiao Shi9a04dda2019-07-02 15:18:20 +000016 EncryptedKeyBag
17
18 EncryptedKeyBag = ENCRYPTED-KEY-BAG-TYPE TLV-LENGTH
Davide Pesavento933a5672020-07-03 22:32:43 -040019 *OCTET ; private key encrypted in PKCS #8 format
Yingdi Yu55ea01a2015-07-21 22:42:17 -070020
Davide Pesavento933a5672020-07-03 22:32:43 -040021All TLV-TYPE numbers are application specific:
Yingdi Yu55ea01a2015-07-21 22:42:17 -070022
23+---------------------------------------------+-------------------+----------------+
Junxiao Shi9a04dda2019-07-02 15:18:20 +000024| TLV-TYPE | Assigned number | Assigned number|
Yingdi Yu55ea01a2015-07-21 22:42:17 -070025| | (decimal) | (hexadecimal) |
26+=============================================+===================+================+
27| SafeBag | 128 | 0x80 |
28+---------------------------------------------+-------------------+----------------+
29| EncryptedKeyBag | 129 | 0x81 |
30+---------------------------------------------+-------------------+----------------+