Correcting KeyLocator (allow different types) and initial type assignment

git-svn-id: svn+ssh://dyadis.cs.arizona.edu/NDN-spec/spec-sphinx@188 c5937c81-b952-4fd9-96ba-3036b240b622
diff --git a/index.rst b/index.rst
index 62a99f2..a6ff962 100644
--- a/index.rst
+++ b/index.rst
@@ -11,6 +11,7 @@
    interest
    data
    signature
+   types
    :maxdepth: 3
 
 
diff --git a/interest.rst b/interest.rst
index 7b5a263..0c47c04 100644
--- a/interest.rst
+++ b/interest.rst
@@ -29,21 +29,6 @@
 The Name element in an Interest is synonymous with the term *prefix*.
 See :ref:`Name section <Name>` for details.
 
-.. _Nonce:
-
-Nonce
-~~~~~
-
-Nonce defined as follows:
-
-::
-
-    Nonce ::= NONCE-TYPE TLV-LENGTH(=4) BYTE{4}
-
-The Nonce carries a randomly-genenerated 4-octet long byte-string.
-The combination of Name and Nonce should uniquely identify an Interest packet.
-This is used to detect looping Interests.
-
 .. _Selectors:
 
 Selectors
@@ -143,6 +128,26 @@
 
 The FreshnessPeriod carried in each Data packet (:ref:`Data Section<data>`) is set by the original producer.  It starts counting down when the Data packet arrives at a node. Consequently if a node is N hops away from the original producer, it may not consider the Data stale until N *X* FreshnessPeriod after the Data is produced.
 
+.. _Nonce:
+
+Nonce
+~~~~~
+
+Nonce defined as follows:
+
+::
+
+    Nonce ::= NONCE-TYPE TLV-LENGTH(=4) BYTE{4}
+
+The Nonce carries a randomly-genenerated 4-octet long byte-string.
+The combination of Name and Nonce should uniquely identify an Interest packet.
+This is used to detect looping Interests.
+
+.. _Guiders:
+
+Guiders
+~~~~~~~
+
 Scope
 +++++
 
diff --git a/signature.rst b/signature.rst
index c91c47d..f061dea 100644
--- a/signature.rst
+++ b/signature.rst
@@ -128,16 +128,21 @@
 
 ::
 
-    KeyLocator ::= KEY-LOCATOR-TYPE TLV-LENGTH Name
+    KeyLocator ::= KEY-LOCATOR-TYPE TLV-LENGTH KeyLocatorValue
 
+    KeyLocatorValue ::= Name |
+                        KeyLocatorDigest |
+                        ...
+
+    KeyLocatorDigest ::= KEY-LOCATOR-DIGEST-TYPE TLV-LENGTH BYTE+
 
 .. note::
 
     KeyLocator has meaning only for specific trust model and the current specification does not imply or suggest use of any specific trust model.
-    Generally, KeyLocator should point to another Data packet which is interpreted by the trust model, but trust model can allow alternative interpretations of the KeyLocator.
+    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.
 
     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.
-    Another possibility for the trust model is to define a naming convention for the KeyLocator, where Name ``/keyid/<sha256>`` identifies RSA public key using SHA256 digest, assuming that the trust model has some other means to obtain the public key.
+    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.
 
 
 Changes from CCNx
@@ -148,8 +153,6 @@
 - ``KeyLocator`` is moved to be a part of the ``SignatureInfo`` block, if it is applicable for the specific signature type.
   The rationale for the move is to make Signature (sequence of ``SignatureInfo`` and ``SignatureValue`` TLVs) self-contained and self-sufficient.
 
-- ``KeyLocator`` is expressed as a trust model-interpreted name, removing nested blocks and alternative packet-format specified representations (``KeyName``, ``Key``, and ``Certificate``)
-
 - Signature type (or signing method information) is expressed as an assigned integer value (with no assumed default), rather than OID.
 
 - Added support for cheaper signatures
diff --git a/types.rst b/types.rst
new file mode 100644
index 0000000..4d60938
--- /dev/null
+++ b/types.rst
@@ -0,0 +1,85 @@
+.. _types:
+
+Type value assignment
+---------------------
+
++---------------------------------------------+-------------------+
+| Type                                        | Assigned value    |
++=============================================+===================+
+|                      **Packet types**                           |
++---------------------------------------------+-------------------+
+| Interest                                    | 0                 |
++---------------------------------------------+-------------------+
+| Data                                        | 1                 |
++---------------------------------------------+-------------------+
+|                      **Common fields**                          |
++---------------------------------------------+-------------------+
+| Name                                        | 2                 |
++---------------------------------------------+-------------------+
+| NameComponent                               | 3                 |
++---------------------------------------------+-------------------+
+|                     **Interest packet**                         |
++---------------------------------------------+-------------------+
+| Selectors                                   | 4                 |
++---------------------------------------------+-------------------+
+| Nonce                                       | 5                 |
++---------------------------------------------+-------------------+
+| Scope                                       | 6                 |
++---------------------------------------------+-------------------+
+| InterestLifetime                            | 7                 |
++---------------------------------------------+-------------------+
+|                   **Interest/Selectors**                        |
++---------------------------------------------+-------------------+
+| MinSuffixComponents                         | 8                 |
++---------------------------------------------+-------------------+
+| MaxSuffixComponents                         | 9                 |
++---------------------------------------------+-------------------+
+| PublisherPublicKeyLocator                   | 10                |
++---------------------------------------------+-------------------+
+| Exclude                                     | 11                |
++---------------------------------------------+-------------------+
+| ChildSelector                               | 12                |
++---------------------------------------------+-------------------+
+| MustBeFresh                                 | 13                |
++---------------------------------------------+-------------------+
+| Any                                         | 14                |
++---------------------------------------------+-------------------+
+|                      **Data packet**                            |
++---------------------------------------------+-------------------+
+| MetaInfo                                    | 15                |
++---------------------------------------------+-------------------+
+| Content                                     | 16                |
++---------------------------------------------+-------------------+
+| SignatureInfo                               | 17                |
++---------------------------------------------+-------------------+
+| SignatureValue                              | 18                |
++---------------------------------------------+-------------------+
+|                      **Data/MetaInfo**                          |
++---------------------------------------------+-------------------+
+| ContentType                                 | 19                |
++---------------------------------------------+-------------------+
+| FreshnessPeriod                             | 20                |
++---------------------------------------------+-------------------+
+|                     **Data/Signature**                          |
++---------------------------------------------+-------------------+
+| SignatureType                               | 21                |
++---------------------------------------------+-------------------+
+| KeyLocator                                  | 22                |
++---------------------------------------------+-------------------+
+| KeyLocatorDigest                            | 23                |
++---------------------------------------------+-------------------+
+
+Type value reservations
+~~~~~~~~~~~~~~~~~~~~~~~
+
++----------------+-----------------------------------------------------------+
+| Values         | Designation                                               |
++================+===========================================================+
+| 24-127         | Reserved for future assignments (1-byte encoding)         | 
++----------------+-----------------------------------------------------------+
+| 128-252        | For application use (1-byte encoding)                     |
++----------------+-----------------------------------------------------------+
+| 253-32767      | Reserved for future assignments (3-byte encoding)         |
++----------------+-----------------------------------------------------------+
+| >32767         | For application use (3-byte encoding)                     |
++----------------+-----------------------------------------------------------+