blob: 8c35adaaed6878d4bff8f255b19c92b905b6f6b8 [file] [log] [blame]
Alexander Afanasyeve2800232013-11-27 02:24:14 +00001.. _Signature:
Alexander Afanasyeveee8c252013-11-21 23:22:41 +00002
3Signature
4---------
5
Alexander Afanasyeve2800232013-11-27 02:24:14 +00006NDN Signature is defined as two consecutive TLV blocks: ``SignatureInfo`` and ``SignatureValue``.
7The following general considerations about SignatureInfo and SignatureValue blocks that apply for all signature types:
Alexander Afanasyeveee8c252013-11-21 23:22:41 +00008
Alexander Afanasyeve2800232013-11-27 02:24:14 +000091. ``SignatureInfo`` is **included** in signature calculation and fully describes the signature, signature algorithm, and any other relevant information to obtain parent certificate(s), such as :ref:`KeyLocator`
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000010
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000112. ``SignatureValue`` is **excluded** from signature calculation and represent actual bits of the signature and any other supporting signature material.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000012
Alexander Afanasyeve2800232013-11-27 02:24:14 +000013::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000014
Alexander Afanasyeve2800232013-11-27 02:24:14 +000015 Signature ::= SignatureInfo
16 SignatureBits
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000017
Alexander Afanasyeve2800232013-11-27 02:24:14 +000018 SignatureInfo ::= SIGNATURE-INFO-TYPE TLV-LENGTH
19 SignatureType
20 ... (SignatureType-specific TLVs)
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000021
Alexander Afanasyev23c2e412014-02-12 19:53:48 +000022 SignatureValue ::= SIGNATURE-VALUE-TYPE TLV-LENGTH
Alexander Afanasyeve2800232013-11-27 02:24:14 +000023 ... (SignatureType-specific TLVs and
24 BYTE+
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000025
Alexander Afanasyeve2800232013-11-27 02:24:14 +000026SignatureType
27~~~~~~~~~~~~~
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000028
Alexander Afanasyeve2800232013-11-27 02:24:14 +000029::
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000030
Alexander Afanasyeve2800232013-11-27 02:24:14 +000031 SignatureType ::= SIGNATURE-TYPE-TYPE TLV-LENGTH
32 nonNegativeInteger
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000033
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000034
Alexander Afanasyeve2800232013-11-27 02:24:14 +000035This specification defines the following SignatureType values:
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000036
Alexander Afanasyeve2800232013-11-27 02:24:14 +000037+-------+----------------------------------------+-------------------------------------------------+
38| Value | Reference | Description |
39+=======+========================================+=================================================+
40| 0 | :ref:`DigestSha256` | Integrity protection using SHA-256 digest |
41+-------+----------------------------------------+-------------------------------------------------+
42| 1 | :ref:`SignatureSha256WithRsa` | Integrity and provenance protection using |
43| | | RSA signature over a SHA-256 digest |
44+-------+----------------------------------------+-------------------------------------------------+
45| 2-200 | | reserved for future assignments |
46+-------+----------------------------------------+-------------------------------------------------+
47| >200 | | unassigned |
48+-------+----------------------------------------+-------------------------------------------------+
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000049
Alexander Afanasyeve2800232013-11-27 02:24:14 +000050.. +-------+----------------------------------------+-------------------------------------------------+
51.. | 2 | :ref:`SignatureSha256WithRsaAndMerkle` | Integrity and provenance protection using |
52.. | | | RSA signature over SHA-256-Merkle-Hash digest. |
53.. | | | |
54.. | | | This signature type defines an aggregated |
55.. | | | signing algorithm that reduces cost of signing |
56.. | | | of a large segmented content (e.g., video file).|
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000057
Alexander Afanasyeve2800232013-11-27 02:24:14 +000058.. _DigestSha256:
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000059
Alexander Afanasyeve2800232013-11-27 02:24:14 +000060DigestSha256
61^^^^^^^^^^^^
Alexander Afanasyeveee8c252013-11-21 23:22:41 +000062
Alexander Afanasyeve2800232013-11-27 02:24:14 +000063``DigestSha256`` provides no provenance of a Data packet or any kind of guarantee that packet is from the original source.
64This signature type is indended only for debug purposes and limited circumstances when it is necessary to protect only against unexpected modification during the transmition.
65
66``DigestSha256`` is defined as a SHA256 hash of the :ref:`Name`, :ref:`MetaInfo`, :ref:`Content`, and :ref:`SignatureInfo <Signature>` TLVs:
67
68::
69
70 SignatureInfo ::= SIGNATURE-INFO-TYPE TLV-LENGTH(=3)
71 SIGNATURE-TYPE-TYPE TLV-LENGTH(=1) 0
72
Alexander Afanasyev23c2e412014-02-12 19:53:48 +000073 SignatureValue ::= SIGNATURE-VALUE-TYPE TLV-LENGTH(=32)
74 BYTE+(=SHA256{Name, MetaInfo, Content, SignatureInfo})
Alexander Afanasyeve2800232013-11-27 02:24:14 +000075
76
77.. _SignatureSha256WithRsa:
78
79SignatureSha256WithRsa
80^^^^^^^^^^^^^^^^^^^^^^
81
82``SignatureSha256WithRsa`` is the basic signature algorithm that MUST be supported by any NDN-compliant software.
83As suggested by the name, it defines an RSA public key signature that is calculated over SHA256 hash of the :ref:`Name`, :ref:`MetaInfo`, :ref:`Content`, and :ref:`SignatureInfo <Signature>` TLVs.
84
85
86::
87
88 SignatureInfo ::= SIGNATURE-INFO-TYPE TLV-LENGTH
89 SIGNATURE-TYPE-TYPE TLV-LENGTH(=1) 1
90 KeyLocator
91
Alexander Afanasyev23c2e412014-02-12 19:53:48 +000092 SignatureValue ::= SIGNATURE-VALUE-TYPE TLV-LENGTH
93 BYTE+(=RSA over SHA256{Name, MetaInfo, Content, SignatureInfo})
Alexander Afanasyeve2800232013-11-27 02:24:14 +000094
Alexander Afanasyev16962fc2014-02-12 19:53:47 +000095.. note::
96
97 SignatureValue size varies (typically 128 or 256 bytes) depending on the private key length used during the signing process.
Alexander Afanasyeve2800232013-11-27 02:24:14 +000098
99This type of signature ensures strict provenance of a Data packet, provided that the signature verifies and signature issuer is authorized to sign the Data packet.
100The signature issuer is idenfified using :ref:`KeyLocator` block in :ref:`SignatureInfo <Signature>` block of ``SignatureSha256WithRsa``.
101See :ref:`KeyLocator section <KeyLocator>` for more detail.
102
103.. note::
104
105 It is application's responsibility to define rules (trust model) of when a specific issuer (KeyLocator) is authorized to sign a specific Data packet.
106 While trust model is outside the scope of the current specification, generally, trust model needs to specify authorization rules between KeyName and Data packet Name, as well as clearly define trust anchor(s).
107 For example, an application can elect to use hierarchical trust model :cite:`testbed-key-management` to ensure Data integrity and provenance.
108
109 .. bibliography:: ndnspec-refs.bib
110
111.. .. _SignatureSha256WithRsaAndMerkle:
112
113.. SignatureSha256WithRsaAndMerkle
114.. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
115
116.. ::
117
118.. SignatureInfo ::= SIGNATURE-INFO-TYPE TLV-LENGTH
119.. SIGNATURE-TYPE-TYPE TLV-LENGTH(=1) 2
120.. KeyLocator
121
Alexander Afanasyev23c2e412014-02-12 19:53:48 +0000122.. SignatureValue ::= SIGNATURE-VALUE-TYPE TLV-LENGTH
123.. BYTE+(=RSA over SHA256{Name, MetaInfo, Content, SignatureInfo})
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000124.. Witness
125
126.. Witness ::= WITNESS-TYPE TLV-LENGTH BYTE+
127
128.. _KeyLocator:
129
130KeyLocator
131~~~~~~~~~~
132
133A ``KeyLocator`` specifies a name that points to another Data packet containing certificate or public key, or can be used by the specific trust model in another way to verify the the content.
134
135::
136
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +0000137 KeyLocator ::= KEY-LOCATOR-TYPE TLV-LENGTH KeyLocatorValue
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000138
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +0000139 KeyLocatorValue ::= Name |
140 KeyLocatorDigest |
141 ...
142
143 KeyLocatorDigest ::= KEY-LOCATOR-DIGEST-TYPE TLV-LENGTH BYTE+
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000144
145.. note::
146
147 KeyLocator has meaning only for specific trust model and the current specification does not imply or suggest use of any specific trust model.
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +0000148 Generally, KeyLocator should point to another Data packet which is interpreted by the trust model, but trust model can allow alternative forms of the KeyLocator.
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000149
150 For example, one can define a trust model that does not interpret KeyLocator at all (KeyLocator MUST be present, but TLV-LENGTH could be 0) and uses naming conventions to infer proper public key or public key certificate for the name of the Data packet itself.
Alexander Afanasyevfffabfb2013-12-11 21:29:05 +0000151 Another possibility for the trust model is to define digest-based KeyLocatorValue (``KeyLocatorDigest``), where RSA public key will be identified using SHA256 digest, assuming that the trust model has some other means to obtain the public key.
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000152
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000153
154Changes from CCNx
155~~~~~~~~~~~~~~~~~
156
157- ``Signature`` is moved to the end of Data packet.
158
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000159- ``KeyLocator`` is moved to be a part of the ``SignatureInfo`` block, if it is applicable for the specific signature type.
160 The rationale for the move is to make Signature (sequence of ``SignatureInfo`` and ``SignatureValue`` TLVs) self-contained and self-sufficient.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000161
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000162- Signature type (or signing method information) is expressed as an assigned integer value (with no assumed default), rather than OID.
Alexander Afanasyeveee8c252013-11-21 23:22:41 +0000163
164- Added support for cheaper signatures
165
Alexander Afanasyeve2800232013-11-27 02:24:14 +0000166- The current specification does not define Merkle Hash Tree Aggregated Signatures, but it is expected that such (or similar) signatures will be defined in future version of this specification.