Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 1 | .. _Signature: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 2 | |
| 3 | Signature |
| 4 | --------- |
| 5 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 6 | NDN Signature is defined as two consecutive TLV blocks: ``SignatureInfo`` and ``SignatureValue``. |
| 7 | The following general considerations about SignatureInfo and SignatureValue blocks that apply for all signature types: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 8 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 9 | 1. ``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 Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 10 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 11 | 2. ``SignatureValue`` is **excluded** from signature calculation and represent actual bits of the signature and any other supporting signature material. |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 12 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 13 | :: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 14 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 15 | Signature ::= SignatureInfo |
| 16 | SignatureBits |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 17 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 18 | SignatureInfo ::= SIGNATURE-INFO-TYPE TLV-LENGTH |
| 19 | SignatureType |
| 20 | ... (SignatureType-specific TLVs) |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 21 | |
Alexander Afanasyev | 23c2e41 | 2014-02-12 19:53:48 +0000 | [diff] [blame^] | 22 | SignatureValue ::= SIGNATURE-VALUE-TYPE TLV-LENGTH |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 23 | ... (SignatureType-specific TLVs and |
| 24 | BYTE+ |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 25 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 26 | SignatureType |
| 27 | ~~~~~~~~~~~~~ |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 28 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 29 | :: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 30 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 31 | SignatureType ::= SIGNATURE-TYPE-TYPE TLV-LENGTH |
| 32 | nonNegativeInteger |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 33 | |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 34 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 35 | This specification defines the following SignatureType values: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 36 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 37 | +-------+----------------------------------------+-------------------------------------------------+ |
| 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 Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 49 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 50 | .. +-------+----------------------------------------+-------------------------------------------------+ |
| 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 Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 57 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 58 | .. _DigestSha256: |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 59 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 60 | DigestSha256 |
| 61 | ^^^^^^^^^^^^ |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 62 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 63 | ``DigestSha256`` provides no provenance of a Data packet or any kind of guarantee that packet is from the original source. |
| 64 | This 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 Afanasyev | 23c2e41 | 2014-02-12 19:53:48 +0000 | [diff] [blame^] | 73 | SignatureValue ::= SIGNATURE-VALUE-TYPE TLV-LENGTH(=32) |
| 74 | BYTE+(=SHA256{Name, MetaInfo, Content, SignatureInfo}) |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 75 | |
| 76 | |
| 77 | .. _SignatureSha256WithRsa: |
| 78 | |
| 79 | SignatureSha256WithRsa |
| 80 | ^^^^^^^^^^^^^^^^^^^^^^ |
| 81 | |
| 82 | ``SignatureSha256WithRsa`` is the basic signature algorithm that MUST be supported by any NDN-compliant software. |
| 83 | As 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 Afanasyev | 23c2e41 | 2014-02-12 19:53:48 +0000 | [diff] [blame^] | 92 | SignatureValue ::= SIGNATURE-VALUE-TYPE TLV-LENGTH |
| 93 | BYTE+(=RSA over SHA256{Name, MetaInfo, Content, SignatureInfo}) |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 94 | |
Alexander Afanasyev | 16962fc | 2014-02-12 19:53:47 +0000 | [diff] [blame] | 95 | .. note:: |
| 96 | |
| 97 | SignatureValue size varies (typically 128 or 256 bytes) depending on the private key length used during the signing process. |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 98 | |
| 99 | This 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. |
| 100 | The signature issuer is idenfified using :ref:`KeyLocator` block in :ref:`SignatureInfo <Signature>` block of ``SignatureSha256WithRsa``. |
| 101 | See :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 Afanasyev | 23c2e41 | 2014-02-12 19:53:48 +0000 | [diff] [blame^] | 122 | .. SignatureValue ::= SIGNATURE-VALUE-TYPE TLV-LENGTH |
| 123 | .. BYTE+(=RSA over SHA256{Name, MetaInfo, Content, SignatureInfo}) |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 124 | .. Witness |
| 125 | |
| 126 | .. Witness ::= WITNESS-TYPE TLV-LENGTH BYTE+ |
| 127 | |
| 128 | .. _KeyLocator: |
| 129 | |
| 130 | KeyLocator |
| 131 | ~~~~~~~~~~ |
| 132 | |
| 133 | A ``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 Afanasyev | fffabfb | 2013-12-11 21:29:05 +0000 | [diff] [blame] | 137 | KeyLocator ::= KEY-LOCATOR-TYPE TLV-LENGTH KeyLocatorValue |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 138 | |
Alexander Afanasyev | fffabfb | 2013-12-11 21:29:05 +0000 | [diff] [blame] | 139 | KeyLocatorValue ::= Name | |
| 140 | KeyLocatorDigest | |
| 141 | ... |
| 142 | |
| 143 | KeyLocatorDigest ::= KEY-LOCATOR-DIGEST-TYPE TLV-LENGTH BYTE+ |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 144 | |
| 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 Afanasyev | fffabfb | 2013-12-11 21:29:05 +0000 | [diff] [blame] | 148 | 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 Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 149 | |
| 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 Afanasyev | fffabfb | 2013-12-11 21:29:05 +0000 | [diff] [blame] | 151 | 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 Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 152 | |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 153 | |
| 154 | Changes from CCNx |
| 155 | ~~~~~~~~~~~~~~~~~ |
| 156 | |
| 157 | - ``Signature`` is moved to the end of Data packet. |
| 158 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 159 | - ``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 Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 161 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 162 | - Signature type (or signing method information) is expressed as an assigned integer value (with no assumed default), rather than OID. |
Alexander Afanasyev | eee8c25 | 2013-11-21 23:22:41 +0000 | [diff] [blame] | 163 | |
| 164 | - Added support for cheaper signatures |
| 165 | |
Alexander Afanasyev | e280023 | 2013-11-27 02:24:14 +0000 | [diff] [blame] | 166 | - 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. |