protocolskmip

What is the difference between a Template and Template-Attribute Structure in KMIP?


I'm currently learning and developing KMIP (Spec 1.0) using the open source library KMIP4J. I was looking through the use cases offered as examples in the spec sheet, and I am stuck trying to differentiate the use of a Template and a Template-Attribute Structure.

What is the difference between these two Use Cases? Both have the Cryptographic Algorithm and Cryptographic Length Attribute, but I don't understand the difference between them.


Solution

  • Within the KMIP Specification, there are two different types of objects: Managed Objects and Base Objects.



    So, let's look at the use cases you've pointed to:

    In Use Case 3.1.1:

    1. The client sends a Create request, which contains the Object Type (Symmetric Key) and a Template-Attribute Structure containing the list of desired attribute values for that key:
      • Cryptographic Algorithm
      • Cryptographic Length
      • Cryptographic Usage Mask.

    In Use Case 3.1.4:

    1. The client uses the Register operation to register a Template, containing a specific set of Attributes:
      • Cryptographic Algorithm
      • Cryptographic Length
      • Name, referring to the name of the Template to create: Template1
    2. The client sends a Create request, which, like before, contains the Object Type (Symmetric Key) and a Template-Attribute Structure. However, this time the Template-Attribute Structure contains:
      • A reference to a Template named Template1, indicating that the operation should use the attributes specified by Template1 (which we know from step 1 are Cryptographic Algorithm and Cryptographic Length)
      • Name, referring the name of the Key: key1
      • Cryptographic Usage Mask

    So the two operations essentially create the same Symmetric Key with the same attribute values, but the second case uses a pre-defined Template (and, trivially, adds a key name), while the first does not.


    A side note:

    The KMIP 1.0 Specification is fairly out of date at this point. KMIP 1.3 was released in December 2015. I mention this specifically because the Template Structure is deprecated as of 1.3.