Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Sovereign, high-performance data protection

Bulk mode with Messages

Chapter 8 of the KMIP 2.1 specification defines the Messages functionality, which enables sending/receiving multiple requests/responses at once (also known as bulk mode). This is the standard way to communicate with the KMIP server using the Binary protocol on port 5696 or the JSON protocol on port 9998 and endpoint /kmip.

The /kmip/2_1 endpoint is a Eviden extension allowing the posting of Operations directly to the server without the need for a RequestMessage wrapper. This is particularly useful for operations like Encrypt and Decrypt.

Multiple operations can be included in a single RequestMessage query. Items run in order.

For every request message sent, the server returns a response message containing the result status of the requested operation, along with any relevant result data or error messages.

KMIP messages: three entry points, one batch of items run in order

Batch semantics

  • A BatchCount that differs from the number of items, or a message with zero items, returns Invalid_Message.
  • More than 10,000 items returns Invalid_Message.
  • An omitted Batch Error Continuation Option means Stop.
  • On Stop and Undo, processing ends at the first failure and later items are not returned.
  • The response BatchCount is the number of returned items.
  • Undo reverts earlier items (limit 1,000 items, else Server_Limit_Exceeded). Only items really reverted report Operation Undone; the others keep Success. Usage Limits consumed by an undone item stay consumed: its response is still returned. An item the server cannot revert (Destroy with remove, Create Split Key, Join Split Key, RNG Seed, tag or keyset handles, Covercrypt keys, a missing or forbidden target, an HSM creation) is refused before it runs with Operation_Not_Supported, which undoes the earlier items.
  • A critical Message Extension fails every item with Unknown_Message_Extension.
  • A Hashed Password credential returns Feature_Not_Supported.
  • Maximum Response Size is applied to Query only: a Query response that would exceed it becomes Response_Too_Large. A negative value returns Invalid_Field.
  • An unimplemented operation fails only its own item with Operation_Not_Supported.
  • A message-level error fails every item with that reason.
  • The ID Placeholder lives for one message. A failed Check empties it.
  • The Client Correlation Value is echoed in the response header.

Batch processing: validate the message, run the items in order, answer once

Request and response example

Below are canonical KMIP 2.1 message examples, following the mandatory XML schema AKLC-M-1-21.xml. Each request and response is shown in JSON TTLV format.

1. CreateKeyPair

{
    "tag": "RequestMessage",
    "type": "Structure",
    "value": [
        {
            "tag": "RequestHeader",
            "type": "Structure",
            "value": [
                { "tag": "ProtocolVersion", "type": "Structure", "value": [
                    { "tag": "ProtocolVersionMajor", "type": "Integer", "value": 2 },
                    { "tag": "ProtocolVersionMinor", "type": "Integer", "value": 1 }
                ] },
                { "tag": "ClientCorrelationValue", "type": "TextString", "value": "AKLC-M-1-21 step=0" },
                { "tag": "BatchCount", "type": "Integer", "value": 1 }
            ]
        },
        {
            "tag": "BatchItem",
            "type": "Structure",
            "value": [
                { "tag": "Operation", "type": "Enumeration", "value": "CreateKeyPair" },
                { "tag": "RequestPayload", "type": "Structure", "value": [
                    { "tag": "CommonAttributes", "type": "Structure", "value": [
                        { "tag": "CryptographicAlgorithm", "type": "Enumeration", "value": "RSA" },
                        { "tag": "CryptographicLength", "type": "Integer", "value": 2048 }
                    ] },
                    { "tag": "PrivateKeyAttributes", "type": "Structure", "value": [
                        { "tag": "Name", "type": "Structure", "value": [
                            { "tag": "NameValue", "type": "TextString", "value": "AKLC-M-1-21-private" },
                            { "tag": "NameType", "type": "Enumeration", "value": "UninterpretedTextString" }
                        ] },
                        { "tag": "CryptographicUsageMask", "type": "Integer", "value": "Sign" }
                    ] },
                    { "tag": "PublicKeyAttributes", "type": "Structure", "value": [
                        { "tag": "Name", "type": "Structure", "value": [
                            { "tag": "NameValue", "type": "TextString", "value": "AKLC-M-1-21-public" },
                            { "tag": "NameType", "type": "Enumeration", "value": "UninterpretedTextString" }
                        ] },
                        { "tag": "CryptographicUsageMask", "type": "Integer", "value": "Verify" }
                    ] }
                ] }
            ]
        }
    ]
}

2. GetAttributes (Private Key)

{
    "tag": "RequestMessage",
    "type": "Structure",
    "value": [
        {
            "tag": "RequestHeader",
            "type": "Structure",
            "value": [
                { "tag": "ProtocolVersion", "type": "Structure", "value": [
                    { "tag": "ProtocolVersionMajor", "type": "Integer", "value": 2 },
                    { "tag": "ProtocolVersionMinor", "type": "Integer", "value": 1 }
                ] },
                { "tag": "ClientCorrelationValue", "type": "TextString", "value": "AKLC-M-1-21 step=1" },
                { "tag": "BatchCount", "type": "Integer", "value": 1 }
            ]
        },
        {
            "tag": "BatchItem",
            "type": "Structure",
            "value": [
                { "tag": "Operation", "type": "Enumeration", "value": "GetAttributes" },
                { "tag": "RequestPayload", "type": "Structure", "value": [
                    { "tag": "UniqueIdentifier", "type": "TextString", "value": "$UNIQUE_IDENTIFIER_0" },
                    { "tag": "AttributeReference", "type": "Enumeration", "value": "State" },
                    { "tag": "AttributeReference", "type": "Enumeration", "value": "CryptographicUsageMask" },
                    { "tag": "AttributeReference", "type": "Enumeration", "value": "UniqueIdentifier" },
                    { "tag": "AttributeReference", "type": "Enumeration", "value": "ObjectType" },
                    { "tag": "AttributeReference", "type": "Enumeration", "value": "CryptographicAlgorithm" },
                    { "tag": "AttributeReference", "type": "Enumeration", "value": "CryptographicLength" },
                    { "tag": "AttributeReference", "type": "Enumeration", "value": "Digest" },
                    { "tag": "AttributeReference", "type": "Enumeration", "value": "InitialDate" },
                    { "tag": "AttributeReference", "type": "Enumeration", "value": "LastChangeDate" },
                    { "tag": "AttributeReference", "type": "Enumeration", "value": "ActivationDate" },
                    { "tag": "AttributeReference", "type": "Enumeration", "value": "OriginalCreationDate" },
                    { "tag": "AttributeReference", "type": "Enumeration", "value": "RandomNumberGenerator" },
                    { "tag": "AttributeReference", "type": "Enumeration", "value": "KeyFormatType" }
                ] }
            ]
        }
    ]
}

3. Destroy (Private Key)

{
    "tag": "RequestMessage",
    "type": "Structure",
    "value": [
        {
            "tag": "RequestHeader",
            "type": "Structure",
            "value": [
                { "tag": "ProtocolVersion", "type": "Structure", "value": [
                    { "tag": "ProtocolVersionMajor", "type": "Integer", "value": 2 },
                    { "tag": "ProtocolVersionMinor", "type": "Integer", "value": 1 }
                ] },
                { "tag": "ClientCorrelationValue", "type": "TextString", "value": "AKLC-M-1-21 step=3" },
                { "tag": "BatchCount", "type": "Integer", "value": 1 }
            ]
        },
        {
            "tag": "BatchItem",
            "type": "Structure",
            "value": [
                { "tag": "Operation", "type": "Enumeration", "value": "Destroy" },
                { "tag": "RequestPayload", "type": "Structure", "value": [
                    { "tag": "UniqueIdentifier", "type": "TextString", "value": "$UNIQUE_IDENTIFIER_0" }
                ] }
            ]
        }
    ]
}