MCPcopy Index your code
hub / github.com/ThalesGroup/kmip-go

github.com/ThalesGroup/kmip-go @v0.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.0 ↗ · + Follow
840 symbols 2,278 edges 49 files 245 documented · 29% updated 9mo agov0.1.0 · 2025-10-07★ 502 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

kmip-go GoDoc Go Report Card Build

kmip-go is a go implemenation of KMIP protocol primitives. It supports marshaling data in TTLV, XML, or JSON encodings to and from go values and structs. It can be used to implement KMIP clients or servers.

Installation

go get github.com/gemalto/kmip-go

Or, to just install the ppkmip pretty printing tool:

go install github.com/gemalto/kmip-go/cmd/ppkmip

Packages

The ttlv package implements the core encoder and decoder logic.

The kmip14 package contains constants for all the tags, types, enumerations and bitmasks defined in the KMIP 1.4 specification. It also contains mappings from these values to the normalized names used in the JSON and XML encodings, and the canonical names used in Attribute structures.
The kmip14 definitions are all automatically registered with ttlv.DefaultRegistry.

The kmip20 package adds additional enumeration values from the 2.0 specification. It is meant to be registered on top of the 1.4 definitions.

The root package defines golang structures for some of the significant Structure definitions in the 1.4 specification, like Attributes, Request, Response, etc. It is incomplete, but can be used as an example for defining other structures. It also contains an example of a client and server.

cmd/kmipgen is a code generation tool which generates the tag and enum constants from a JSON specification input. It can also be used independently in your own code to generate additional tags and constants. make install to build and install the tool. See kmip14/kmip_1_4.go for an example of using the tool.

cmd/kmipgen is a tool for pretty printing kmip values. It can accept KMIP input from stdin or files, encoded in TTLV, XML, or JSON, and output in a variety of formats. make install to intall the tool, and ppkmip --help to see usage.

Contributing

To build, be sure to have a recent go SDK, and make. Run make tools to install other dependencies.

There is also a dockerized build, which only requires make and docker-compose: make docker. You can also do make fish or make bash to shell into the docker build container.

Merge requests are welcome! Before submitting, please run make and make sure all tests pass and there are no linter findings.

Extension points exported contracts — how you extend this code

ItemHandler (Interface)
ItemHandler handles a single batch item in a KMIP request. The *Request object's CurrentItem field will be populated wi [12 …
requests.go
Marshaler (Interface)
Marshaler knows how to encode itself to TTLV. The implementation should use the primitive methods of the encoder, such a [7 …
ttlv/encoder.go
Unmarshaler (Interface)
Unmarshaler knows how to unmarshal a ttlv value into itself. The decoder argument may be used to decode the ttlv value i [3 …
ttlv/decoder.go
EnumMap (Interface)
EnumMap defines a set of named enumeration values. Canonical names should be the name from the spec. Names should be in [1 …
ttlv/formatting.go
MarshalerFunc (FuncType)
(no doc)
ttlv/encoder_test.go
ProtocolHandler (Interface)
ProtocolHandler is responsible for handling raw requests read off the wire. The *Request object will only have TTLV fie [1 …
requests.go
MessageHandler (Interface)
MessageHandler handles KMIP requests which have already be decoded. The *Request object's Message field will be populat [1 …
requests.go
ErrorHandler (Interface)
ErrorHandler converts a golang error into a *ResponseBatchItem (which should hold information about the error to convey
requests.go

Core symbols most depended-on inside this repo

RegisterValue
called by 75
ttlv/registry.go
EncodeEnumeration
called by 73
ttlv/encoder.go
FormatEnum
called by 71
ttlv/formatting.go
NewEnum
called by 70
ttlv/registry.go
Type
called by 59
ttlv/ttlv.go
syntaxError
called by 38
ttlv/ttlv.go
String
called by 34
ttlv/tag.go
Marshal
called by 32
ttlv/encoder.go

Shape

Method 403
Function 188
Struct 142
TypeAlias 94
Interface 8
FuncType 5

Languages

Go100%

Modules by API surface

kmip14/kmip_1_4_generated.go256 symbols
kmip20/kmip_2_0_additions_generated.go111 symbols
ttlv/encoder.go51 symbols
requests.go51 symbols
ttlv/encoder_test.go49 symbols
ttlv/ttlv.go38 symbols
base_objects.go34 symbols
ttlv/registry.go33 symbols
ttlv/types.go17 symbols
ttlv/formatting.go16 symbols
ttlv/decoder_test.go15 symbols
ttlv/decoder.go14 symbols

For agents

$ claude mcp add kmip-go \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page