kmip

package module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2025 License: Apache-2.0 Imports: 14 Imported by: 3

README

kmip-go

Go Reference license test Go Report Card

A go implementation of the KMIP protocol and client, supporting KMIP v1.0 to v1.4. See KMIP v1.4 protocole specification

This library is developped for and tested against OVHcloud KMS.

NOTE: THIS PROJECT IS CURRENTLY UNDER DEVELOPMENT AND SUBJECT TO BREAKING CHANGES.

Usage

Add it to your project by running

go get github.com/ovh/kmip-go@latest

and import required packages

import (
	"github.com/ovh/kmip-go"
	"github.com/ovh/kmip-go/kmipclient"
	"github.com/ovh/kmip-go/payloads"
	"github.com/ovh/kmip-go/ttlv"
)

Then you can connect to your KMS service:

const (
	ADDR = "eu-west-rbx.okms.ovh.net:5696"
	CA   = "ca.pem"
	CERT = "cert.pem"
	KEY  = "key.pem"
)

client, err := kmipclient.Dial(
	ADDR,
	// Optional if server's CA is known by the system
	// kmipclient.WithRootCAFile(CA),
	kmipclient.WithClientCertFiles(CERT, KEY),
	kmipclient.WithMiddlewares(
		kmipclient.CorrelationValueMiddleware(uuid.NewString),
		kmipclient.DebugMiddleware(os.Stdout, ttlv.MarshalXML),
	),
	// kmipclient.EnforceVersion(kmip.V1_4),
)
if err != nil {
	panic(err)
}
defer client.Close()
fmt.Println("Connected using KMIP version", client.Version())

You can then use the high level client helper methods to create and send requests to the server:

resp := client.Create().
	AES(256, kmip.CryptographicUsageEncrypt|kmip.CryptographicUsageDecrypt).
	WithName("my-key").
	MustExec()
fmt.Println("Created AES key with ID", resp.UniqueIdentifier)

Or alternatively if more flexibility is required, craft your kmip requests payloads:

request := payloads.CreateRequestPayload{
	ObjectType: kmip.ObjectTypeSymmetricKey,
	TemplateAttribute: kmip.TemplateAttribute{
		Attribute: []kmip.Attribute{
			{
				AttributeName:  kmip.AttributeNameCryptographicAlgorithm,
				AttributeValue: kmip.CryptographicAlgorithmAES,
			}, {
				AttributeName:  kmip.AttributeNameCryptographicLength,
				AttributeValue: int32(256),
			}, {
				AttributeName: kmip.AttributeNameName,
				AttributeValue: kmip.Name{
					NameType:  kmip.NameTypeUninterpretedTextString,
					NameValue: "another-key",
				},
			}, {
				AttributeName:  kmip.AttributeNameCryptographicUsageMask,
				AttributeValue: kmip.CryptographicUsageEncrypt | kmip.CryptographicUsageDecrypt,
			},
		},
	},
}

response, err := client.Request(context.Background(), &request)
if err != nil {
	panic(err)
}
id := response.(*payloads.CreateResponsePayload).UniqueIdentifier
fmt.Println("Created an AES key with ID", id)

You can also send batches of requests:

batchResponse, err := client.Batch(context.Background(), &request, &request)
if err != nil {
	panic(err)
}
id1 := batchResponse[0].ResponsePayload.(*payloads.CreateResponsePayload).UniqueIdentifier
id2 := batchResponse[1].ResponsePayload.(*payloads.CreateResponsePayload).UniqueIdentifier
fmt.Println("Created 2 AES keys with IDs", id1, id2)

And directly craft your request message with one or more payloads batched together:

msg := kmip.NewRequestMessage(client.Version(), &request, &request)
rMsg, err := client.Roundtrip(context.Background(), &msg)
if err != nil {
	panic(err)
}
id1 := rMsg.BatchItem[0].ResponsePayload.(*payloads.CreateResponsePayload).UniqueIdentifier
id2 := rMsg.BatchItem[1].ResponsePayload.(*payloads.CreateResponsePayload).UniqueIdentifier
fmt.Println("Created a 5th and 6th AES keys with IDs", id1, id2)

}

See examples for more possibilities.

Implementation status

Legend:

  • N/A : Not Applicable
  • ✅ : Fully compatible
  • ❌ : Not implemented or reviewed
  • 🚧 : Work in progress / Partially compatible
  • 💀 : Deprecated
Messages
v1.0 v1.1 v1.2 v1.3 v1.4
Request Message
Response Message
Operations
Operation v1.0 v1.1 v1.2 v1.3 v1.4
Create
Create Key Pair
Register
Re-key
DeriveKey
Certify
Re-certify
Locate
Check
Get
Get Attributes
Get Attribute List
Add Attribute
Modify Attribute
Delete Attribute
Obtain Lease
Get Usage Allocation
Activate
Revoke
Destroy
Archive
Recover
Validate
Query
Cancel
Poll
Notify
Put
Discover N/A
Re-key Key Pair N/A
Encrypt N/A N/A
Decrypt N/A N/A
Sign N/A N/A
Signature Verify N/A N/A
MAC N/A N/A
MAC Verify N/A N/A
RNG Retrieve N/A N/A
RNG Seed N/A N/A
Hash N/A N/A
Create Split Key N/A N/A
Join Split Key N/A N/A
Export N/A N/A N/A N/A
Import N/A N/A N/A N/A
Managed Objects
Object v1.0 v1.1 v1.2 v1.3 v1.4
Certificate
Symmetric Key
Public Key
Private Key
Split Key
Template 💀 💀
Secret Data
Opaque Object
PGP Key N/A N/A
Base Objects
Object v1.0 v1.1 v1.2 v1.3 v1.4
Attribute
 Credential
 Key Block
Key Value
Key Wrapping Data
Key Wrapping Specification
Transparent Key Structures 🚧 🚧 🚧 🚧 🚧
Template-Attribute Structures
Extension Information N/A
Data N/A N/A
Data Length N/A N/A
Signature Data N/A N/A
MAC Data N/A N/A
Nonce N/A N/A
Correlation Value N/A N/A N/A
Init Indicator N/A N/A N/A
Final Indicator N/A N/A N/A
RNG Parameter N/A N/A N/A
Profile Information N/A N/A N/A
Validation Information N/A N/A N/A
Capability Information N/A N/A N/A
Authenticated Encryption Additional Data N/A N/A N/A N/A
Authenticated Encryption Tag N/A N/A N/A N/A
Transparent Key Structures
Object v1.0 v1.1 v1.2 v1.3 v1.4
Symmetric Key
DSA Private/Public Key
RSA Private/Public Key
DH Private/Public Key
ECDSA Private/Public Key 💀 💀
ECDH Private/Public Key 💀 💀
ECMQV Private/Public 💀 💀
EC Private/Public N/A N/A N/A
Attributes
Attribute v1.0 v1.1 v1.2 v1.3 v1.4
Unique Identifier
Name
Object Type
Cryptographic Algorithm
Cryptographic Length
Cryptographic Parameters
Cryptographic Domain Parameters
Certificate Type
Certificate Identifier 💀 💀 💀 💀
Certificate Subject 💀 💀 💀 💀
Certificate Issuer 💀 💀 💀 💀
Digest
Operation Policy Name 💀 💀
Cryptographic Usage Mask
Lease Time
Usage Limits
State
Initial Date
Activation Date
Process Start Date
Protect Stop Date
Deactivation Date
Destroy Date
Compromise Occurrence Date
Compromise Date
Revocation Reason
Archive Date
Object Group
Link
Application Specific Information
Contact Information
Last Change Date
Custom Attribute
Certificate Length N/A
X.509 Certificate Identifier N/A
X.509 Certificate Subject N/A
X.509 Certificate Issuer N/A
Digital Signature Algorithm N/A
Fresh N/A
Alternative Name N/A N/A
Key Value Present N/A N/A
Key Value Location N/A N/A
Original Creation Date N/A N/A
Random Number Generator N/A N/A N/A
PKCS#12 Friendly Name N/A N/A N/A N/A
Description N/A N/A N/A N/A
Comment N/A N/A N/A N/A
Sensitive N/A N/A N/A N/A
Always Sensitive N/A N/A N/A N/A
Extractable N/A N/A N/A N/A
Never Extractable N/A N/A N/A N/A

Documentation

Index

Constants

View Source
const (
	// KMIP 1.0.
	TagActivationDate                 = 0x420001
	TagApplicationData                = 0x420002
	TagApplicationNamespace           = 0x420003
	TagApplicationSpecificInformation = 0x420004
	TagArchiveDate                    = 0x420005
	TagAsynchronousCorrelationValue   = 0x420006
	TagAsynchronousIndicator          = 0x420007
	TagAttribute                      = 0x420008
	TagAttributeIndex                 = 0x420009
	TagAttributeName                  = 0x42000A
	TagAttributeValue                 = 0x42000B
	TagAuthentication                 = 0x42000C
	TagBatchCount                     = 0x42000D
	TagBatchErrorContinuationOption   = 0x42000E
	TagBatchItem                      = 0x42000F
	TagBatchOrderOption               = 0x420010
	TagBlockCipherMode                = 0x420011
	TagCancellationResult             = 0x420012
	TagCertificate                    = 0x420013
	// Deprecated: deprecated as of kmip 1.1.
	TagCertificateIdentifier = 0x420014
	// Deprecated: deprecated as of kmip 1.1.
	TagCertificateIssuer = 0x420015
	// Deprecated: deprecated as of kmip 1.1.
	TagCertificateIssuerAlternativeName = 0x420016
	// Deprecated: deprecated as of kmip 1.1.
	TagCertificateIssuerDistinguishedName = 0x420017
	TagCertificateRequest                 = 0x420018
	TagCertificateRequestType             = 0x420019
	// Deprecated: deprecated as of kmip 1.1.
	TagCertificateSubject = 0x42001A
	// Deprecated: deprecated as of kmip 1.1.
	TagCertificateSubjectAlternativeName = 0x42001B
	// Deprecated: deprecated as of kmip 1.1.
	TagCertificateSubjectDistinguishedName = 0x42001C
	TagCertificateType                     = 0x42001D
	TagCertificateValue                    = 0x42001E
	TagCommonTemplateAttribute             = 0x42001F
	TagCompromiseDate                      = 0x420020
	TagCompromiseOccurrenceDate            = 0x420021
	TagContactInformation                  = 0x420022
	TagCredential                          = 0x420023
	TagCredentialType                      = 0x420024
	TagCredentialValue                     = 0x420025
	TagCriticalityIndicator                = 0x420026
	TagCRTCoefficient                      = 0x420027
	TagCryptographicAlgorithm              = 0x420028
	TagCryptographicDomainParameters       = 0x420029
	TagCryptographicLength                 = 0x42002A
	TagCryptographicParameters             = 0x42002B
	TagCryptographicUsageMask              = 0x42002C
	TagCustomAttribute                     = 0x42002D
	TagD                                   = 0x42002E
	TagDeactivationDate                    = 0x42002F
	TagDerivationData                      = 0x420030
	TagDerivationMethod                    = 0x420031
	TagDerivationParameters                = 0x420032
	TagDestroyDate                         = 0x420033
	TagDigest                              = 0x420034
	TagDigestValue                         = 0x420035
	TagEncryptionKeyInformation            = 0x420036
	TagG                                   = 0x420037
	TagHashingAlgorithm                    = 0x420038
	TagInitialDate                         = 0x420039
	TagInitializationVector                = 0x42003A
	// Deprecated: deprecated as of kmip 1.1.
	TagIssuer                     = 0x42003B
	TagIterationCount             = 0x42003C
	TagIVCounterNonce             = 0x42003D
	TagJ                          = 0x42003E
	TagKey                        = 0x42003F
	TagKeyBlock                   = 0x420040
	TagKeyCompressionType         = 0x420041
	TagKeyFormatType              = 0x420042
	TagKeyMaterial                = 0x420043
	TagKeyPartIdentifier          = 0x420044
	TagKeyValue                   = 0x420045
	TagKeyWrappingData            = 0x420046
	TagKeyWrappingSpecification   = 0x420047
	TagLastChangeDate             = 0x420048
	TagLeaseTime                  = 0x420049
	TagLink                       = 0x42004A
	TagLinkType                   = 0x42004B
	TagLinkedObjectIdentifier     = 0x42004C
	TagMACSignature               = 0x42004D
	TagMACSignatureKeyInformation = 0x42004E
	TagMaximumItems               = 0x42004F
	TagMaximumResponseSize        = 0x420050
	TagMessageExtension           = 0x420051
	TagModulus                    = 0x420052
	TagName                       = 0x420053
	TagNameType                   = 0x420054
	TagNameValue                  = 0x420055
	TagObjectGroup                = 0x420056
	TagObjectType                 = 0x420057
	TagOffset                     = 0x420058
	TagOpaqueDataType             = 0x420059
	TagOpaqueDataValue            = 0x42005A
	TagOpaqueObject               = 0x42005B
	TagOperation                  = 0x42005C
	// Deprecated: deprecated as of kmip 1.3.
	TagOperationPolicyName         = 0x42005D
	TagP                           = 0x42005E
	TagPaddingMethod               = 0x42005F
	TagPrimeExponentP              = 0x420060
	TagPrimeExponentQ              = 0x420061
	TagPrimeFieldSize              = 0x420062
	TagPrivateExponent             = 0x420063
	TagPrivateKey                  = 0x420064
	TagPrivateKeyTemplateAttribute = 0x420065
	TagPrivateKeyUniqueIdentifier  = 0x420066
	TagProcessStartDate            = 0x420067
	TagProtectStopDate             = 0x420068
	TagProtocolVersion             = 0x420069
	TagProtocolVersionMajor        = 0x42006A
	TagProtocolVersionMinor        = 0x42006B
	TagPublicExponent              = 0x42006C
	TagPublicKey                   = 0x42006D
	TagPublicKeyTemplateAttribute  = 0x42006E
	TagPublicKeyUniqueIdentifier   = 0x42006F
	TagPutFunction                 = 0x420070
	TagQ                           = 0x420071
	TagQString                     = 0x420072
	TagQlength                     = 0x420073
	TagQueryFunction               = 0x420074
	TagRecommendedCurve            = 0x420075
	TagReplacedUniqueIdentifier    = 0x420076
	TagRequestHeader               = 0x420077
	TagRequestMessage              = 0x420078
	TagRequestPayload              = 0x420079
	TagResponseHeader              = 0x42007A
	TagResponseMessage             = 0x42007B
	TagResponsePayload             = 0x42007C
	TagResultMessage               = 0x42007D
	TagResultReason                = 0x42007E
	TagResultStatus                = 0x42007F
	TagRevocationMessage           = 0x420080
	TagRevocationReason            = 0x420081
	TagRevocationReasonCode        = 0x420082
	TagKeyRoleType                 = 0x420083
	TagSalt                        = 0x420084
	TagSecretData                  = 0x420085
	TagSecretDataType              = 0x420086
	// Deprecated: deprecated as of kmip 1.1.
	TagSerialNumber         = 0x420087
	TagServerInformation    = 0x420088
	TagSplitKey             = 0x420089
	TagSplitKeyMethod       = 0x42008A
	TagSplitKeyParts        = 0x42008B
	TagSplitKeyThreshold    = 0x42008C
	TagState                = 0x42008D
	TagStorageStatusMask    = 0x42008E
	TagSymmetricKey         = 0x42008F
	TagTemplate             = 0x420090
	TagTemplateAttribute    = 0x420091
	TagTimeStamp            = 0x420092
	TagUniqueBatchItemID    = 0x420093
	TagUniqueIdentifier     = 0x420094
	TagUsageLimits          = 0x420095
	TagUsageLimitsCount     = 0x420096
	TagUsageLimitsTotal     = 0x420097
	TagUsageLimitsUnit      = 0x420098
	TagUsername             = 0x420099
	TagValidityDate         = 0x42009A
	TagValidityIndicator    = 0x42009B
	TagVendorExtension      = 0x42009C
	TagVendorIdentification = 0x42009D
	TagWrappingMethod       = 0x42009E
	TagX                    = 0x42009F
	TagY                    = 0x4200A0
	TagPassword             = 0x4200A1

	// KMIP 1.1.
	TagDeviceIdentifier           = 0x4200A2
	TagEncodingOption             = 0x4200A3
	TagExtensionInformation       = 0x4200A4
	TagExtensionName              = 0x4200A5
	TagExtensionTag               = 0x4200A6
	TagExtensionType              = 0x4200A7
	TagFresh                      = 0x4200A8
	TagMachineIdentifier          = 0x4200A9
	TagMediaIdentifier            = 0x4200AA
	TagNetworkIdentifier          = 0x4200AB
	TagObjectGroupMember          = 0x4200AC
	TagCertificateLength          = 0x4200AD
	TagDigitalSignatureAlgorithm  = 0x4200AE
	TagCertificateSerialNumber    = 0x4200AF
	TagDeviceSerialNumber         = 0x4200B0
	TagIssuerAlternativeName      = 0x4200B1
	TagIssuerDistinguishedName    = 0x4200B2
	TagSubjectAlternativeName     = 0x4200B3
	TagSubjectDistinguishedName   = 0x4200B4
	TagX_509CertificateIdentifier = 0x4200B5
	TagX_509CertificateIssuer     = 0x4200B6
	TagX_509CertificateSubject    = 0x4200B7

	// KMIP 1.2.
	TagKeyValueLocationValue       = 0x4200B9
	TagKeyValueLocationType        = 0x4200BA
	TagKeyValuePresent             = 0x4200BB
	TagOriginalCreationDate        = 0x4200BC
	TagPGPKey                      = 0x4200BD
	TagPGPKeyVersion               = 0x4200BE
	TagAlternativeName             = 0x4200BF
	TagAlternativeNameValue        = 0x4200C0
	TagAlternativeNameType         = 0x4200C1
	TagData                        = 0x4200C2
	TagSignatureData               = 0x4200C3
	TagDataLength                  = 0x4200C4
	TagRandomIV                    = 0x4200C5
	TagMACData                     = 0x4200C6
	TagAttestationType             = 0x4200C7
	TagNonce                       = 0x4200C8
	TagNonceID                     = 0x4200C9
	TagNonceValue                  = 0x4200CA
	TagAttestationMeasurement      = 0x4200CB
	TagAttestationAssertion        = 0x4200CC
	TagIVLength                    = 0x4200CD
	TagTagLength                   = 0x4200CE
	TagFixedFieldLength            = 0x4200CF
	TagCounterLength               = 0x4200D0
	TagInitialCounterValue         = 0x4200D1
	TagInvocationFieldLength       = 0x4200D2
	TagAttestationCapableIndicator = 0x4200D3
	TagKeyValueLocation            = 0x4200B8

	// KMIP 1.3.
	TagOffsetItems                     = 0x4200D4
	TagLocatedItems                    = 0x4200D5
	TagCorrelationValue                = 0x4200D6
	TagInitIndicator                   = 0x4200D7
	TagFinalIndicator                  = 0x4200D8
	TagRNGParameters                   = 0x4200D9
	TagRNGAlgorithm                    = 0x4200DA
	TagDRBGAlgorithm                   = 0x4200DB
	TagFIPS186Variation                = 0x4200DC
	TagPredictionResistance            = 0x4200DD
	TagRandomNumberGenerator           = 0x4200DE
	TagValidationInformation           = 0x4200DF
	TagValidationAuthorityType         = 0x4200E0
	TagValidationAuthorityCountry      = 0x4200E1
	TagValidationAuthorityURI          = 0x4200E2
	TagValidationVersionMajor          = 0x4200E3
	TagValidationVersionMinor          = 0x4200E4
	TagValidationType                  = 0x4200E5
	TagValidationLevel                 = 0x4200E6
	TagValidationCertificateIdentifier = 0x4200E7
	TagValidationCertificateURI        = 0x4200E8
	TagValidationVendorURI             = 0x4200E9
	TagValidationProfile               = 0x4200EA
	TagProfileInformation              = 0x4200EB
	TagProfileName                     = 0x4200EC
	TagServerURI                       = 0x4200ED
	TagServerPort                      = 0x4200EE
	TagStreamingCapability             = 0x4200EF
	TagAsynchronousCapability          = 0x4200F0
	TagAttestationCapability           = 0x4200F1
	TagUnwrapMode                      = 0x4200F2
	TagDestroyAction                   = 0x4200F3
	TagShreddingAlgorithm              = 0x4200F4
	TagRNGMode                         = 0x4200F5
	TagClientRegistrationMethod        = 0x4200F6
	TagCapabilityInformation           = 0x4200F7

	// KMIP 1.4.
	TagKeyWrapType                           = 0x4200F8
	TagBatchUndoCapability                   = 0x4200F9
	TagBatchContinueCapability               = 0x4200FA
	TagPKCS_12FriendlyName                   = 0x4200FB
	TagDescription                           = 0x4200FC
	TagComment                               = 0x4200FD
	TagAuthenticatedEncryptionAdditionalData = 0x4200FE
	TagAuthenticatedEncryptionTag            = 0x4200FF
	TagSaltLength                            = 0x420100
	TagMaskGenerator                         = 0x420101
	TagMaskGeneratorHashingAlgorithm         = 0x420102
	TagPSource                               = 0x420103
	TagTrailerField                          = 0x420104
	TagClientCorrelationValue                = 0x420105
	TagServerCorrelationValue                = 0x420106
	TagDigestedData                          = 0x420107
	TagCertificateSubjectCN                  = 0x420108
	TagCertificateSubjectO                   = 0x420109
	TagCertificateSubjectOU                  = 0x42010A
	TagCertificateSubjectEmail               = 0x42010B
	TagCertificateSubjectC                   = 0x42010C
	TagCertificateSubjectST                  = 0x42010D
	TagCertificateSubjectL                   = 0x42010E
	TagCertificateSubjectUID                 = 0x42010F
	TagCertificateSubjectSerialNumber        = 0x420110
	TagCertificateSubjectTitle               = 0x420111
	TagCertificateSubjectDC                  = 0x420112
	TagCertificateSubjectDNQualifier         = 0x420113
	TagCertificateIssuerCN                   = 0x420114
	TagCertificateIssuerO                    = 0x420115
	TagCertificateIssuerOU                   = 0x420116
	TagCertificateIssuerEmail                = 0x420117
	TagCertificateIssuerC                    = 0x420118
	TagCertificateIssuerST                   = 0x420119
	TagCertificateIssuerL                    = 0x42011A
	TagCertificateIssuerUID                  = 0x42011B
	TagCertificateIssuerSerialNumber         = 0x42011C
	TagCertificateIssuerTitle                = 0x42011D
	TagCertificateIssuerDC                   = 0x42011E
	TagCertificateIssuerDNQualifier          = 0x42011F
	TagSensitive                             = 0x420120
	TagAlwaysSensitive                       = 0x420121
	TagExtractable                           = 0x420122
	TagNeverExtractable                      = 0x420123
	TagReplaceExisting                       = 0x420124
)

Variables

View Source
var (
	V1_0 = ProtocolVersion{ProtocolVersionMajor: 1, ProtocolVersionMinor: 0}
	V1_1 = ProtocolVersion{ProtocolVersionMajor: 1, ProtocolVersionMinor: 1}
	V1_2 = ProtocolVersion{ProtocolVersionMajor: 1, ProtocolVersionMinor: 2}
	V1_3 = ProtocolVersion{ProtocolVersionMajor: 1, ProtocolVersionMinor: 3}
	V1_4 = ProtocolVersion{ProtocolVersionMajor: 1, ProtocolVersionMinor: 4}
	V2_0 = ProtocolVersion{ProtocolVersionMajor: 2, ProtocolVersionMinor: 0}
	V2_1 = ProtocolVersion{ProtocolVersionMajor: 2, ProtocolVersionMinor: 1}
	V2_2 = ProtocolVersion{ProtocolVersionMajor: 2, ProtocolVersionMinor: 2}
)
View Source
var AllAttributeNames = []AttributeName{
	AttributeNameUniqueIdentifier, AttributeNameName, AttributeNameObjectType, AttributeNameOperationPolicyName, AttributeNameObjectGroup,
	AttributeNameContactInformation, AttributeNameInitialDate, AttributeNameActivationDate, AttributeNameProcessStartDate, AttributeNameProtectStopDate,
	AttributeNameDeactivationDate, AttributeNameDestroyDate, AttributeNameCompromiseOccurrenceDate, AttributeNameCompromiseDate, AttributeNameArchiveDate,
	AttributeNameLastChangeDate, AttributeNameCryptographicLength, AttributeNameLeaseTime, AttributeNameCryptographicAlgorithm, AttributeNameCryptographicParameters,
	AttributeNameCryptographicDomainParameters, AttributeNameCertificateType, AttributeNameDigest, AttributeNameCryptographicUsageMask, AttributeNameState, AttributeNameRevocationReason,
	AttributeNameLink, AttributeNameCertificateIdentifier, AttributeNameCertificateSubject, AttributeNameCertificateIssuer, AttributeNameUsageLimits,
	AttributeNameApplicationSpecificInformation, AttributeNameCertificateLength, AttributeNameFresh, AttributeNameX509CertificateIdentifier, AttributeNameX509CertificateSubject,
	AttributeNameX509CertificateIssuer, AttributeNameDigitalSignatureAlgorithm, AttributeNameAlternativeName, AttributeNameKeyValuePresent, AttributeNameKeyValueLocation,
	AttributeNameOriginalCreationDate, AttributeNameRandomNumberGenerator, AttributeNamePKCS_12FriendlyName, AttributeNameDescription, AttributeNameComment, AttributeNameSensitive,
	AttributeNameAlwaysSensitive, AttributeNameExtractable, AttributeNameNeverExtractable,
}

Functions

func RegisterOperationPayload

func RegisterOperationPayload[Req, Resp any](op Operation)

Types

type AlternativeName

type AlternativeName struct {
	AlternativeNameValue string              `ttlv:",omitempty"`
	AlternativeNameType  AlternativeNameType `ttlv:",omitempty"`
}

type AlternativeNameType

type AlternativeNameType uint32
const (
	AlternativeNameTypeUninterpretedTextString AlternativeNameType = 0x00000001
	AlternativeNameTypeURI                     AlternativeNameType = 0x00000002
	AlternativeNameTypeObjectSerialNumber      AlternativeNameType = 0x00000003
	AlternativeNameTypeEmailAddress            AlternativeNameType = 0x00000004
	AlternativeNameTypeDNSName                 AlternativeNameType = 0x00000005
	AlternativeNameTypeX_500DistinguishedName  AlternativeNameType = 0x00000006
	AlternativeNameTypeIPAddress               AlternativeNameType = 0x00000007
)

func (AlternativeNameType) MarshalText added in v0.2.2

func (enum AlternativeNameType) MarshalText() ([]byte, error)

type ApplicationSpecificInformation

type ApplicationSpecificInformation struct {
	ApplicationNamespace string `ttlv:",omitempty"`
	ApplicationData      string `ttlv:",omitempty"` //TODO: Optional since kmip 1.3, not before.
}

type AttestationType

type AttestationType uint32
const (
	AttestationTypeTPMQuote           AttestationType = 0x00000001
	AttestationTypeTCGIntegrityReport AttestationType = 0x00000002
	AttestationTypeSAMLAssertion      AttestationType = 0x00000003
)

func (AttestationType) MarshalText added in v0.2.2

func (enum AttestationType) MarshalText() ([]byte, error)

type Attribute

type Attribute struct {
	AttributeName  AttributeName
	AttributeIndex *int32
	AttributeValue any
}

func (*Attribute) TagDecodeTTLV

func (att *Attribute) TagDecodeTTLV(d *ttlv.Decoder, tag int) error

type AttributeName

type AttributeName string
const (
	AttributeNameUniqueIdentifier AttributeName = "Unique Identifier"
	AttributeNameName             AttributeName = "Name"
	AttributeNameObjectType       AttributeName = "Object Type"
	// Deprecated: deprecated as of kmip 1.3.
	AttributeNameOperationPolicyName           AttributeName = "Operation Policy Name"
	AttributeNameObjectGroup                   AttributeName = "Object Group"
	AttributeNameContactInformation            AttributeName = "Contact Information"
	AttributeNameInitialDate                   AttributeName = "Initial Date"
	AttributeNameActivationDate                AttributeName = "Activation Date"
	AttributeNameProcessStartDate              AttributeName = "Process Start Date"
	AttributeNameProtectStopDate               AttributeName = "Protect Stop Date"
	AttributeNameDeactivationDate              AttributeName = "Deactivation Date"
	AttributeNameDestroyDate                   AttributeName = "Destroy Date"
	AttributeNameCompromiseOccurrenceDate      AttributeName = "Compromise Occurrence Date"
	AttributeNameCompromiseDate                AttributeName = "Compromise Date"
	AttributeNameArchiveDate                   AttributeName = "Archive Date"
	AttributeNameLastChangeDate                AttributeName = "Last Change Date"
	AttributeNameCryptographicLength           AttributeName = "Cryptographic Length"
	AttributeNameLeaseTime                     AttributeName = "Lease Time"
	AttributeNameCryptographicAlgorithm        AttributeName = "Cryptographic Algorithm"
	AttributeNameCryptographicParameters       AttributeName = "Cryptographic Parameters"
	AttributeNameCryptographicDomainParameters AttributeName = "Cryptographic Domain Parameters"
	AttributeNameCertificateType               AttributeName = "Certificate Type"
	AttributeNameDigest                        AttributeName = "Digest"
	AttributeNameCryptographicUsageMask        AttributeName = "Cryptographic Usage Mask"
	AttributeNameState                         AttributeName = "State"
	AttributeNameRevocationReason              AttributeName = "Revocation Reason"
	AttributeNameLink                          AttributeName = "Link"
	// Deprecated: deprecated as of kmip 1.1.
	AttributeNameCertificateIdentifier AttributeName = "Certificate Identifier"
	// Deprecated: deprecated as of kmip 1.1.
	AttributeNameCertificateSubject AttributeName = "Certificate Subject"
	// Deprecated: deprecated as of kmip 1.1.
	AttributeNameCertificateIssuer              AttributeName = "Certificate Issuer"
	AttributeNameUsageLimits                    AttributeName = "Usage Limits"
	AttributeNameApplicationSpecificInformation AttributeName = "Application Specific Information"

	// KMIP 1.1.
	AttributeNameCertificateLength         AttributeName = "Certificate Length"
	AttributeNameFresh                     AttributeName = "Fresh"
	AttributeNameX509CertificateIdentifier AttributeName = "X.509 Certificate Identifier"
	AttributeNameX509CertificateSubject    AttributeName = "X.509 Certificate Subject"
	AttributeNameX509CertificateIssuer     AttributeName = "X.509 Certificate Issuer"
	AttributeNameDigitalSignatureAlgorithm AttributeName = "Digital Signature Algorithm"

	// KMIP 1.2.
	AttributeNameAlternativeName      AttributeName = "Alternative Name"
	AttributeNameKeyValuePresent      AttributeName = "Key Value Present"
	AttributeNameKeyValueLocation     AttributeName = "Key Value Location"
	AttributeNameOriginalCreationDate AttributeName = "Original Creation Date"

	// KMIP 1.3.
	AttributeNameRandomNumberGenerator AttributeName = "Random Number Generator"

	// KMIP 1.4.
	AttributeNamePKCS_12FriendlyName AttributeName = "PKCS#12 Friendly Name"
	AttributeNameDescription         AttributeName = "Description"
	AttributeNameComment             AttributeName = "Comment"
	AttributeNameSensitive           AttributeName = "Sensitive"
	AttributeNameAlwaysSensitive     AttributeName = "Always Sensitive"
	AttributeNameExtractable         AttributeName = "Extractable"
	AttributeNameNeverExtractable    AttributeName = "Never Extractable"
)

func (AttributeName) IsCustom

func (atn AttributeName) IsCustom() bool

type Authentication

type Authentication struct {
	Credential Credential
	// Starting from KMIP 1.2, Credential can be repeated
	AdditionalCredential []Credential `ttlv:",version=v1.2.."`
}

type BatchErrorContinuationOption

type BatchErrorContinuationOption uint32
const (
	BatchErrorContinuationOptionContinue BatchErrorContinuationOption = 1
	BatchErrorContinuationOptionStop     BatchErrorContinuationOption = 2
	BatchErrorContinuationOptionUndo     BatchErrorContinuationOption = 3
)

func (BatchErrorContinuationOption) MarshalText added in v0.2.2

func (enum BatchErrorContinuationOption) MarshalText() ([]byte, error)

type BlockCipherMode

type BlockCipherMode uint32
const (
	BlockCipherModeCBC               BlockCipherMode = 0x00000001
	BlockCipherModeECB               BlockCipherMode = 0x00000002
	BlockCipherModePCBC              BlockCipherMode = 0x00000003
	BlockCipherModeCFB               BlockCipherMode = 0x00000004
	BlockCipherModeOFB               BlockCipherMode = 0x00000005
	BlockCipherModeCTR               BlockCipherMode = 0x00000006
	BlockCipherModeCMAC              BlockCipherMode = 0x00000007
	BlockCipherModeCCM               BlockCipherMode = 0x00000008
	BlockCipherModeGCM               BlockCipherMode = 0x00000009
	BlockCipherModeCBCMAC            BlockCipherMode = 0x0000000A
	BlockCipherModeXTS               BlockCipherMode = 0x0000000B
	BlockCipherModeAESKeyWrapPadding BlockCipherMode = 0x0000000C
	BlockCipherModeNISTKeyWrap       BlockCipherMode = 0x0000000D
	BlockCipherModeX9_102AESKW       BlockCipherMode = 0x0000000E
	BlockCipherModeX9_102TDKW        BlockCipherMode = 0x0000000F
	BlockCipherModeX9_102AKW1        BlockCipherMode = 0x00000010
	BlockCipherModeX9_102AKW2        BlockCipherMode = 0x00000011
	// KMIP 1.4.
	BlockCipherModeAEAD BlockCipherMode = 0x00000012
)

func (BlockCipherMode) MarshalText added in v0.2.2

func (enum BlockCipherMode) MarshalText() ([]byte, error)

type CancellationResult

type CancellationResult uint32
const (
	CancellationResultCanceled       CancellationResult = 0x00000001
	CancellationResultUnableToCancel CancellationResult = 0x00000002
	CancellationResultCompleted      CancellationResult = 0x00000003
	CancellationResultFailed         CancellationResult = 0x00000004
	CancellationResultUnavailable    CancellationResult = 0x00000005
)

func (CancellationResult) MarshalText added in v0.2.2

func (enum CancellationResult) MarshalText() ([]byte, error)

type CapabilityInformation

type CapabilityInformation struct {
	StreamingCapability     *bool
	AsynchronousCapability  *bool
	AttestationCapability   *bool
	BatchUndoCapability     *bool              `ttlv:",version=v1.4.."`
	BatchContinueCapability *bool              `ttlv:",version=v1.4.."`
	UnwrapMode              UnwrapMode         `ttlv:",omitempty"`
	DestroyAction           DestroyAction      `ttlv:",omitempty"`
	ShreddingAlgorithm      ShreddingAlgorithm `ttlv:",omitempty"`
	RNGMode                 RNGMode            `ttlv:",omitempty"`
}

type Certificate

type Certificate struct {
	CertificateType  CertificateType
	CertificateValue []byte
}

func (*Certificate) ObjectType

func (sd *Certificate) ObjectType() ObjectType

func (*Certificate) PemCertificate added in v0.2.0

func (sd *Certificate) PemCertificate() (string, error)

PemCertificate returns the PEM encoded value of an x509 certificate. It returns an error if the kmip object is not a certificate of type X509, or if the certificate data is invalid.

func (*Certificate) X509Certificate

func (sd *Certificate) X509Certificate() (*x509.Certificate, error)

type CertificateIdentifier deprecated

type CertificateIdentifier struct {
	Issuer       string `ttlv:",omitempty"`
	SerialNumber string `ttlv:",omitempty"`
}

Deprecated: deprecated as of kmip 1.1.

type CertificateIssuer deprecated

type CertificateIssuer struct {
	CertificateIssuerDistinguishedName string `ttlv:",omitempty"`
	CertificateIssuerAlternativeName   []string
}

Deprecated: deprecated as of kmip 1.1.

type CertificateRequestType

type CertificateRequestType uint32
const (
	CertificateRequestTypeCRMF    CertificateRequestType = 0x00000001
	CertificateRequestTypePKCS_10 CertificateRequestType = 0x00000002
	CertificateRequestTypePEM     CertificateRequestType = 0x00000003
	CertificateRequestTypePGP     CertificateRequestType = 0x00000004
)

func (CertificateRequestType) MarshalText added in v0.2.2

func (enum CertificateRequestType) MarshalText() ([]byte, error)

type CertificateSubject deprecated

type CertificateSubject struct {
	CertificateSubjectDistinguishedName string `ttlv:",omitempty"`
	CertificateSubjectAlternativeName   []string
}

Deprecated: deprecated as of kmip 1.1.

type CertificateType

type CertificateType uint32
const (
	CertificateTypeX_509 CertificateType = 0x00000001
	// Deprecated: deprecated as of version 1.2.
	CertificateTypePGP CertificateType = 0x00000002
)

func (CertificateType) MarshalText added in v0.2.2

func (enum CertificateType) MarshalText() ([]byte, error)

type ClientRegistrationMethod

type ClientRegistrationMethod uint32
const (
	ClientRegistrationMethodUnspecified        ClientRegistrationMethod = 0x00000001
	ClientRegistrationMethodServerPreGenerated ClientRegistrationMethod = 0x00000002
	ClientRegistrationMethodServerOnDemand     ClientRegistrationMethod = 0x00000003
	ClientRegistrationMethodClientGenerated    ClientRegistrationMethod = 0x00000004
	ClientRegistrationMethodClientRegistered   ClientRegistrationMethod = 0x00000005
)

func (ClientRegistrationMethod) MarshalText added in v0.2.2

func (enum ClientRegistrationMethod) MarshalText() ([]byte, error)

type Credential

type Credential struct {
	CredentialType  CredentialType
	CredentialValue CredentialValue
}

func (*Credential) TagDecodeTTLV

func (kb *Credential) TagDecodeTTLV(d *ttlv.Decoder, tag int) error

type CredentialType

type CredentialType uint32
const (
	CredentialTypeUsernameAndPassword CredentialType = 0x00000001
	// KMIP 1.1.
	CredentialTypeDevice CredentialType = 0x00000002
	// KMIP 1.2.
	CredentialTypeAttestation CredentialType = 0x00000003
)

func (CredentialType) MarshalText added in v0.2.2

func (enum CredentialType) MarshalText() ([]byte, error)

type CredentialValue

type CredentialValue struct {
	UserPassword *CredentialValueUserPassword
	Device       *CredentialValueDevice
	Attestation  *CredentialValueAttestation
}

func (*CredentialValue) TagEncodeTTLV

func (cred *CredentialValue) TagEncodeTTLV(e *ttlv.Encoder, tag int)

type CredentialValueAttestation

type CredentialValueAttestation struct {
	Nonce                  Nonce
	AttestationType        AttestationType
	AttestationMeasurement []byte `ttlv:",omitempty"`
	AttestationAssertion   []byte `ttlv:",omitempty"`
}

type CredentialValueDevice

type CredentialValueDevice struct {
	DeviceSerialNumber string `ttlv:",omitempty"`
	Password           string `ttlv:",omitempty"`
	DeviceIdentifier   string `ttlv:",omitempty"`
	NetworkIdentifier  string `ttlv:",omitempty"`
	MachineIdentifier  string `ttlv:",omitempty"`
	MediaIdentifier    string `ttlv:",omitempty"`
}

type CredentialValueUserPassword

type CredentialValueUserPassword struct {
	Username string
	Password string `ttlv:",omitempty"`
}

type CryptographicAlgorithm

type CryptographicAlgorithm uint32
const (
	CryptographicAlgorithmDES        CryptographicAlgorithm = 0x00000001
	CryptographicAlgorithmTDES       CryptographicAlgorithm = 0x00000002
	CryptographicAlgorithmAES        CryptographicAlgorithm = 0x00000003
	CryptographicAlgorithmRSA        CryptographicAlgorithm = 0x00000004
	CryptographicAlgorithmDSA        CryptographicAlgorithm = 0x00000005
	CryptographicAlgorithmECDSA      CryptographicAlgorithm = 0x00000006
	CryptographicAlgorithmHMACSHA1   CryptographicAlgorithm = 0x00000007
	CryptographicAlgorithmHMACSHA224 CryptographicAlgorithm = 0x00000008
	CryptographicAlgorithmHMACSHA256 CryptographicAlgorithm = 0x00000009
	CryptographicAlgorithmHMACSHA384 CryptographicAlgorithm = 0x0000000A
	CryptographicAlgorithmHMACSHA512 CryptographicAlgorithm = 0x0000000B
	CryptographicAlgorithmHMACMD5    CryptographicAlgorithm = 0x0000000C
	CryptographicAlgorithmDH         CryptographicAlgorithm = 0x0000000D
	CryptographicAlgorithmECDH       CryptographicAlgorithm = 0x0000000E
	CryptographicAlgorithmECMQV      CryptographicAlgorithm = 0x0000000F
	CryptographicAlgorithmBlowfish   CryptographicAlgorithm = 0x00000010
	CryptographicAlgorithmCamellia   CryptographicAlgorithm = 0x00000011
	CryptographicAlgorithmCAST5      CryptographicAlgorithm = 0x00000012
	CryptographicAlgorithmIDEA       CryptographicAlgorithm = 0x00000013
	CryptographicAlgorithmMARS       CryptographicAlgorithm = 0x00000014
	CryptographicAlgorithmRC2        CryptographicAlgorithm = 0x00000015
	CryptographicAlgorithmRC4        CryptographicAlgorithm = 0x00000016
	CryptographicAlgorithmRC5        CryptographicAlgorithm = 0x00000017
	CryptographicAlgorithmSKIPJACK   CryptographicAlgorithm = 0x00000018
	CryptographicAlgorithmTwofish    CryptographicAlgorithm = 0x00000019

	// KMIP 1.2.
	CryptographicAlgorithmEC CryptographicAlgorithm = 0x0000001A

	// KMIP 1.3.
	CryptographicAlgorithmOneTimePad CryptographicAlgorithm = 0x0000001B

	// KMIP 1.4.
	CryptographicAlgorithmChaCha20         CryptographicAlgorithm = 0x0000001C
	CryptographicAlgorithmPoly1305         CryptographicAlgorithm = 0x0000001D
	CryptographicAlgorithmChaCha20Poly1305 CryptographicAlgorithm = 0x0000001E
	CryptographicAlgorithmSHA3_224         CryptographicAlgorithm = 0x0000001F
	CryptographicAlgorithmSHA3_256         CryptographicAlgorithm = 0x00000020
	CryptographicAlgorithmSHA3_384         CryptographicAlgorithm = 0x00000021
	CryptographicAlgorithmSHA3_512         CryptographicAlgorithm = 0x00000022
	CryptographicAlgorithmHMAC_SHA3_224    CryptographicAlgorithm = 0x00000023
	CryptographicAlgorithmHMAC_SHA3_256    CryptographicAlgorithm = 0x00000024
	CryptographicAlgorithmHMAC_SHA3_384    CryptographicAlgorithm = 0x00000025
	CryptographicAlgorithmHMAC_SHA3_512    CryptographicAlgorithm = 0x00000026
	CryptographicAlgorithmSHAKE_128        CryptographicAlgorithm = 0x00000027
	CryptographicAlgorithmSHAKE_256        CryptographicAlgorithm = 0x00000028
)

func (CryptographicAlgorithm) MarshalText added in v0.2.2

func (enum CryptographicAlgorithm) MarshalText() ([]byte, error)

type CryptographicDomainParameters

type CryptographicDomainParameters struct {
	Qlength          int32            `ttlv:",omitempty"`
	RecommendedCurve RecommendedCurve `ttlv:",omitempty"`
}

type CryptographicParameters

type CryptographicParameters struct {
	BlockCipherMode  BlockCipherMode  `ttlv:",omitempty"`
	PaddingMethod    PaddingMethod    `ttlv:",omitempty"`
	HashingAlgorithm HashingAlgorithm `ttlv:",omitempty"`
	KeyRoleType      KeyRoleType      `ttlv:",omitempty"`

	DigitalSignatureAlgorithm DigitalSignatureAlgorithm `ttlv:",omitempty,version=v1.2.."`
	CryptographicAlgorithm    CryptographicAlgorithm    `ttlv:",omitempty,version=v1.2.."`
	RandomIV                  *bool                     `ttlv:",version=v1.2.."`
	IVLength                  int32                     `ttlv:",omitempty,version=v1.2.."`
	TagLength                 int32                     `ttlv:",omitempty,version=v1.2.."`
	FixedFieldLength          int32                     `ttlv:",omitempty,version=v1.2.."`
	InvocationFieldLength     int32                     `ttlv:",omitempty,version=v1.2.."`
	CounterLength             int32                     `ttlv:",omitempty,version=v1.2.."`
	InitialCounterValue       *int32                    `ttlv:",version=v1.2.."`

	SaltLength                    int32            `ttlv:",omitempty,version=v1.4.."`
	MaskGenerator                 MaskGenerator    `ttlv:",omitempty,version=v1.4.."`
	MaskGeneratorHashingAlgorithm HashingAlgorithm `ttlv:",omitempty,version=v1.4.."`
	PSource                       []byte           `ttlv:",omitempty,version=v1.4.."`
	TrailerField                  *int32           `ttlv:",version=v1.4.."`
}

type CryptographicUsageMask

type CryptographicUsageMask int32
const (
	CryptographicUsageSign CryptographicUsageMask = 1 << iota
	CryptographicUsageVerify
	CryptographicUsageEncrypt
	CryptographicUsageDecrypt
	CryptographicUsageWrapKey
	CryptographicUsageUnwrapKey
	CryptographicUsageExport
	CryptographicUsageMACGenerate
	CryptographicUsageDeriveKey
	CryptographicUsageContentCommitment
	CryptographicUsageKeyAgreement
	CryptographicUsageCertificateSign
	CryptographicUsageCRLSign
	CryptographicUsageGenerateCryptogram
	CryptographicUsageValidateCryptogram
	CryptographicUsageTranslateEncrypt
	CryptographicUsageTranslateDecrypt
	CryptographicUsageTranslateWrap
	CryptographicUsageTranslateUnwrap
)

func (CryptographicUsageMask) MarshalText added in v0.2.2

func (mask CryptographicUsageMask) MarshalText() ([]byte, error)

type DRBGAlgorithm

type DRBGAlgorithm uint32
const (
	DRBGAlgorithmUnspecified DRBGAlgorithm = 0x00000001
	DRBGAlgorithmDual_EC     DRBGAlgorithm = 0x00000002
	DRBGAlgorithmHash        DRBGAlgorithm = 0x00000003
	DRBGAlgorithmHMAC        DRBGAlgorithm = 0x00000004
	DRBGAlgorithmCTR         DRBGAlgorithm = 0x00000005
)

func (DRBGAlgorithm) MarshalText added in v0.2.2

func (enum DRBGAlgorithm) MarshalText() ([]byte, error)

type DestroyAction

type DestroyAction uint32
const (
	DestroyActionUnspecified         DestroyAction = 0x00000001
	DestroyActionKeyMaterialDeleted  DestroyAction = 0x00000002
	DestroyActionKeyMaterialShredded DestroyAction = 0x00000003
	DestroyActionMetaDataDeleted     DestroyAction = 0x00000004
	DestroyActionMetaDataShredded    DestroyAction = 0x00000005
	DestroyActionDeleted             DestroyAction = 0x00000006
	DestroyActionShredded            DestroyAction = 0x00000007
)

func (DestroyAction) MarshalText added in v0.2.2

func (enum DestroyAction) MarshalText() ([]byte, error)

type Digest

type Digest struct {
	HashingAlgorithm HashingAlgorithm
	DigestValue      []byte
	KeyFormatType    KeyFormatType `ttlv:",omitempty,version=1.1.."`
}

type DigitalSignatureAlgorithm

type DigitalSignatureAlgorithm uint32
const (
	DigitalSignatureAlgorithmMD2WithRSAEncryptionPKCS_1v1_5     DigitalSignatureAlgorithm = 0x00000001
	DigitalSignatureAlgorithmMD5WithRSAEncryptionPKCS_1v1_5     DigitalSignatureAlgorithm = 0x00000002
	DigitalSignatureAlgorithmSHA_1WithRSAEncryptionPKCS_1v1_5   DigitalSignatureAlgorithm = 0x00000003
	DigitalSignatureAlgorithmSHA_224WithRSAEncryptionPKCS_1v1_5 DigitalSignatureAlgorithm = 0x00000004
	DigitalSignatureAlgorithmSHA_256WithRSAEncryptionPKCS_1v1_5 DigitalSignatureAlgorithm = 0x00000005
	DigitalSignatureAlgorithmSHA_384WithRSAEncryptionPKCS_1v1_5 DigitalSignatureAlgorithm = 0x00000006
	DigitalSignatureAlgorithmSHA_512WithRSAEncryptionPKCS_1v1_5 DigitalSignatureAlgorithm = 0x00000007
	DigitalSignatureAlgorithmRSASSA_PSSPKCS_1v2_1               DigitalSignatureAlgorithm = 0x00000008
	DigitalSignatureAlgorithmDSAWithSHA_1                       DigitalSignatureAlgorithm = 0x00000009
	DigitalSignatureAlgorithmDSAWithSHA224                      DigitalSignatureAlgorithm = 0x0000000A
	DigitalSignatureAlgorithmDSAWithSHA256                      DigitalSignatureAlgorithm = 0x0000000B
	DigitalSignatureAlgorithmECDSAWithSHA_1                     DigitalSignatureAlgorithm = 0x0000000C
	DigitalSignatureAlgorithmECDSAWithSHA224                    DigitalSignatureAlgorithm = 0x0000000D
	DigitalSignatureAlgorithmECDSAWithSHA256                    DigitalSignatureAlgorithm = 0x0000000E
	DigitalSignatureAlgorithmECDSAWithSHA384                    DigitalSignatureAlgorithm = 0x0000000F
	DigitalSignatureAlgorithmECDSAWithSHA512                    DigitalSignatureAlgorithm = 0x00000010

	// KMIP 1.4.
	DigitalSignatureAlgorithmSHA3_256WithRSAEncryption DigitalSignatureAlgorithm = 0x00000011
	DigitalSignatureAlgorithmSHA3_384WithRSAEncryption DigitalSignatureAlgorithm = 0x00000012
	DigitalSignatureAlgorithmSHA3_512WithRSAEncryption DigitalSignatureAlgorithm = 0x00000013
)

func (DigitalSignatureAlgorithm) MarshalText added in v0.2.2

func (enum DigitalSignatureAlgorithm) MarshalText() ([]byte, error)

type EncodingOption

type EncodingOption uint32
const (
	EncodingOptionNoEncoding   EncodingOption = 0x00000001
	EncodingOptionTTLVEncoding EncodingOption = 0x00000002
)

func (EncodingOption) MarshalText added in v0.2.2

func (enum EncodingOption) MarshalText() ([]byte, error)

type EncryptionKeyInformation

type EncryptionKeyInformation struct {
	UniqueIdentifier        string
	CryptographicParameters *CryptographicParameters
}

type ExtensionInformation

type ExtensionInformation struct {
	ExtensionName string
	ExtensionTag  int32 `ttlv:",omitempty"`
	ExtensionType int32 `ttlv:",omitempty"`
}

type FIPS186Variation

type FIPS186Variation uint32
const (
	FIPS186VariationUnspecified     FIPS186Variation = 0x00000001
	FIPS186VariationGPXOriginal     FIPS186Variation = 0x00000002
	FIPS186VariationGPXChangeNotice FIPS186Variation = 0x00000003
	FIPS186VariationXOriginal       FIPS186Variation = 0x00000004
	FIPS186VariationXChangeNotice   FIPS186Variation = 0x00000005
	FIPS186VariationKOriginal       FIPS186Variation = 0x00000006
	FIPS186VariationKChangeNotice   FIPS186Variation = 0x00000007
)

func (FIPS186Variation) MarshalText added in v0.2.2

func (enum FIPS186Variation) MarshalText() ([]byte, error)

type HashingAlgorithm

type HashingAlgorithm uint32
const (
	HashingAlgorithmMD2        HashingAlgorithm = 0x00000001
	HashingAlgorithmMD4        HashingAlgorithm = 0x00000002
	HashingAlgorithmMD5        HashingAlgorithm = 0x00000003
	HashingAlgorithmSHA_1      HashingAlgorithm = 0x00000004
	HashingAlgorithmSHA_224    HashingAlgorithm = 0x00000005
	HashingAlgorithmSHA_256    HashingAlgorithm = 0x00000006
	HashingAlgorithmSHA_384    HashingAlgorithm = 0x00000007
	HashingAlgorithmSHA_512    HashingAlgorithm = 0x00000008
	HashingAlgorithmRIPEMD_160 HashingAlgorithm = 0x00000009
	HashingAlgorithmTiger      HashingAlgorithm = 0x0000000A
	HashingAlgorithmWhirlpool  HashingAlgorithm = 0x0000000B

	// KMIP 1.2.
	HashingAlgorithmSHA_512_224 HashingAlgorithm = 0x0000000C
	HashingAlgorithmSHA_512_256 HashingAlgorithm = 0x0000000D

	// KMIP 1.4.
	HashingAlgorithmSHA_3_224 HashingAlgorithm = 0x0000000E
	HashingAlgorithmSHA_3_256 HashingAlgorithm = 0x0000000F
	HashingAlgorithmSHA_3_384 HashingAlgorithm = 0x00000010
	HashingAlgorithmSHA_3_512 HashingAlgorithm = 0x00000011
)

func (HashingAlgorithm) MarshalText added in v0.2.2

func (enum HashingAlgorithm) MarshalText() ([]byte, error)

type KeyBlock

type KeyBlock struct {
	KeyFormatType          KeyFormatType
	KeyCompressionType     KeyCompressionType `ttlv:",omitempty"`
	KeyValue               *KeyValue
	CryptographicAlgorithm CryptographicAlgorithm `ttlv:",omitempty"`
	CryptographicLength    int32                  `ttlv:",omitempty"`
	KeyWrappingData        *KeyWrappingData
}

func (*KeyBlock) GetAttributes

func (kb *KeyBlock) GetAttributes() []Attribute

func (*KeyBlock) GetBytes

func (kb *KeyBlock) GetBytes() ([]byte, error)

func (*KeyBlock) GetMaterial

func (kb *KeyBlock) GetMaterial() (KeyMaterial, error)

func (*KeyBlock) TagDecodeTTLV

func (kb *KeyBlock) TagDecodeTTLV(d *ttlv.Decoder, tag int) error

type KeyCompressionType

type KeyCompressionType uint32
const (
	KeyCompressionTypeECPublicKeyTypeUncompressed         KeyCompressionType = 0x00000001
	KeyCompressionTypeECPublicKeyTypeX9_62CompressedPrime KeyCompressionType = 0x00000002
	KeyCompressionTypeECPublicKeyTypeX9_62CompressedChar2 KeyCompressionType = 0x00000003
	KeyCompressionTypeECPublicKeyTypeX9_62Hybrid          KeyCompressionType = 0x00000004
)

func (KeyCompressionType) MarshalText added in v0.2.2

func (enum KeyCompressionType) MarshalText() ([]byte, error)

type KeyFormatType

type KeyFormatType uint32
const (
	KeyFormatTypeRaw                      KeyFormatType = 0x00000001
	KeyFormatTypeOpaque                   KeyFormatType = 0x00000002
	KeyFormatTypePKCS_1                   KeyFormatType = 0x00000003
	KeyFormatTypePKCS_8                   KeyFormatType = 0x00000004
	KeyFormatTypeX_509                    KeyFormatType = 0x00000005
	KeyFormatTypeECPrivateKey             KeyFormatType = 0x00000006
	KeyFormatTypeTransparentSymmetricKey  KeyFormatType = 0x00000007
	KeyFormatTypeTransparentDSAPrivateKey KeyFormatType = 0x00000008
	KeyFormatTypeTransparentDSAPublicKey  KeyFormatType = 0x00000009
	KeyFormatTypeTransparentRSAPrivateKey KeyFormatType = 0x0000000A
	KeyFormatTypeTransparentRSAPublicKey  KeyFormatType = 0x0000000B
	KeyFormatTypeTransparentDHPrivateKey  KeyFormatType = 0x0000000C
	KeyFormatTypeTransparentDHPublicKey   KeyFormatType = 0x0000000D
	// Deprecated: deprecated as of kmip 1.3.
	KeyFormatTypeTransparentECDSAPrivateKey KeyFormatType = 0x0000000E
	// Deprecated: deprecated as of kmip 1.3.
	KeyFormatTypeTransparentECDSAPublicKey KeyFormatType = 0x0000000F
	// Deprecated: deprecated as of kmip 1.3.
	KeyFormatTypeTransparentECDHPrivateKey KeyFormatType = 0x00000010
	// Deprecated: deprecated as of kmip 1.3.
	KeyFormatTypeTransparentECDHPublicKey KeyFormatType = 0x00000011
	// Deprecated: deprecated as of kmip 1.3.
	KeyFormatTypeTransparentECMQVPrivateKey KeyFormatType = 0x00000012
	// Deprecated: deprecated as of kmip 1.3.
	KeyFormatTypeTransparentECMQVPublicKey KeyFormatType = 0x00000013

	// KMIP 1.3.
	KeyFormatTypeTransparentECPrivateKey KeyFormatType = 0x00000014
	KeyFormatTypeTransparentECPublicKey  KeyFormatType = 0x00000015

	// KMIP 1.4.
	KeyFormatTypePKCS_12 KeyFormatType = 0x00000016
)

func (KeyFormatType) MarshalText added in v0.2.2

func (enum KeyFormatType) MarshalText() ([]byte, error)

type KeyMaterial

type KeyMaterial struct {
	Bytes                      *[]byte
	TransparentSymmetricKey    *TransparentSymmetricKey
	TransparentRSAPrivateKey   *TransparentRSAPrivateKey
	TransparentRSAPublicKey    *TransparentRSAPublicKey
	TransparentECDSAPrivateKey *TransparentECDSAPrivateKey
	TransparentECDSAPublicKey  *TransparentECDSAPublicKey
	TransparentECPrivateKey    *TransparentECPrivateKey
	TransparentECPublicKey     *TransparentECPublicKey
}

func (*KeyMaterial) TagEncodeTTLV

func (km *KeyMaterial) TagEncodeTTLV(e *ttlv.Encoder, tag int)

type KeyRoleType

type KeyRoleType uint32
const (
	KeyRoleTypeBDK      KeyRoleType = 0x00000001
	KeyRoleTypeCVK      KeyRoleType = 0x00000002
	KeyRoleTypeDEK      KeyRoleType = 0x00000003
	KeyRoleTypeMKAC     KeyRoleType = 0x00000004
	KeyRoleTypeMKSMC    KeyRoleType = 0x00000005
	KeyRoleTypeMKSMI    KeyRoleType = 0x00000006
	KeyRoleTypeMKDAC    KeyRoleType = 0x00000007
	KeyRoleTypeMKDN     KeyRoleType = 0x00000008
	KeyRoleTypeMKCP     KeyRoleType = 0x00000009
	KeyRoleTypeMKOTH    KeyRoleType = 0x0000000A
	KeyRoleTypeKEK      KeyRoleType = 0x0000000B
	KeyRoleTypeMAC16609 KeyRoleType = 0x0000000C
	KeyRoleTypeMAC97971 KeyRoleType = 0x0000000D
	KeyRoleTypeMAC97972 KeyRoleType = 0x0000000E
	KeyRoleTypeMAC97973 KeyRoleType = 0x0000000F
	KeyRoleTypeMAC97974 KeyRoleType = 0x00000010
	KeyRoleTypeMAC97975 KeyRoleType = 0x00000011
	KeyRoleTypeZPK      KeyRoleType = 0x00000012
	KeyRoleTypePVKIBM   KeyRoleType = 0x00000013
	KeyRoleTypePVKPVV   KeyRoleType = 0x00000014
	KeyRoleTypePVKOTH   KeyRoleType = 0x00000015

	// KMIP 1.4.
	KeyRoleTypeDUKPT KeyRoleType = 0x00000016
	KeyRoleTypeIV    KeyRoleType = 0x00000017
	KeyRoleTypeTRKBK KeyRoleType = 0x00000018
)

func (KeyRoleType) MarshalText added in v0.2.2

func (enum KeyRoleType) MarshalText() ([]byte, error)

type KeyValue

type KeyValue struct {
	Wrapped *[]byte
	Plain   *PlainKeyValue
}

func (*KeyValue) TagEncodeTTLV

func (kv *KeyValue) TagEncodeTTLV(e *ttlv.Encoder, tag int)

type KeyValueLocation

type KeyValueLocation struct {
	KeyValueLocationValue string               `ttlv:",omitempty"`
	KeyValueLocationType  KeyValueLocationType `ttlv:",omitempty"`
}

type KeyValueLocationType

type KeyValueLocationType uint32
const (
	KeyValueLocationTypeUninterpretedTextString KeyValueLocationType = 0x00000001
	KeyValueLocationTypeURI                     KeyValueLocationType = 0x00000002
)

func (KeyValueLocationType) MarshalText added in v0.2.2

func (enum KeyValueLocationType) MarshalText() ([]byte, error)

type KeyWrappingData

type KeyWrappingData struct {
	WrappingMethod             WrappingMethod
	EncryptionKeyInformation   *EncryptionKeyInformation
	MACSignatureKeyInformation *MACSignatureKeyInformation
	MACSignature               []byte         `ttlv:",omitempty"`
	IVCounterNonce             []byte         `ttlv:",omitempty"`
	EncodingOption             EncodingOption `ttlv:",omitempty,version=v1.1.."`
}

type KeyWrappingSpecification

type KeyWrappingSpecification struct {
	WrappingMethod             WrappingMethod
	EncryptionKeyInformation   *EncryptionKeyInformation
	MACSignatureKeyInformation *MACSignatureKeyInformation
	AttributeName              []AttributeName
	EncodingOption             EncodingOption `ttlv:",omitempty,version=v1.1.."`
}
type Link struct {
	LinkType               LinkType `ttlv:",omitempty"`
	LinkedObjectIdentifier string   `ttlv:",omitempty"`
}

type LinkType

type LinkType uint32
const (
	LinkTypeCertificateLink          LinkType = 0x00000101
	LinkTypePublicKeyLink            LinkType = 0x00000102
	LinkTypePrivateKeyLink           LinkType = 0x00000103
	LinkTypeDerivationBaseObjectLink LinkType = 0x00000104
	LinkTypeDerivedKeyLink           LinkType = 0x00000105
	LinkTypeReplacementObjectLink    LinkType = 0x00000106
	LinkTypeReplacedObjectLink       LinkType = 0x00000107

	// KMIP 1.2.
	LinkTypeParentLink   LinkType = 0x00000108
	LinkTypeChildLink    LinkType = 0x00000109
	LinkTypePreviousLink LinkType = 0x0000010A
	LinkTypeNextLink     LinkType = 0x0000010B

	// KMPI 1.4.
	LinkTypePKCS_12CertificateLink LinkType = 0x0000010C
	LinkTypePKCS_12PasswordLink    LinkType = 0x0000010D

	//FIXME: This is defined in KMIP 2.0+ only.
	LinkTypeWrappingKeyLink LinkType = 0x0000010E
)

func (LinkType) MarshalText added in v0.2.2

func (enum LinkType) MarshalText() ([]byte, error)

type MACSignatureKeyInformation

type MACSignatureKeyInformation struct {
	UniqueIdentifier        string
	CryptographicParameters *CryptographicParameters
}

type MaskGenerator

type MaskGenerator uint32
const (
	MaskGeneratorMGF1 MaskGenerator = 0x00000001
)

func (MaskGenerator) MarshalText added in v0.2.2

func (enum MaskGenerator) MarshalText() ([]byte, error)

type MessageExtension

type MessageExtension struct {
	VendorIdentification string
	CriticalityIndicator bool
	VendorExtension      ttlv.Struct
}

type Name

type Name struct {
	NameValue string   `ttlv:",omitempty"`
	NameType  NameType `ttlv:",omitempty"`
}

type NameType

type NameType uint32
const (
	NameTypeUninterpretedTextString NameType = 1
	NameTypeUri                     NameType = 2
)

func (NameType) MarshalText added in v0.2.2

func (enum NameType) MarshalText() ([]byte, error)

type Nonce

type Nonce struct {
	NonceID    []byte
	NonceValue []byte
}

type Object

type Object interface {
	ObjectType() ObjectType
}

func NewObjectForType

func NewObjectForType(objType ObjectType) (Object, error)

TODO: Make it private.

type ObjectGroupMember

type ObjectGroupMember uint32
const (
	ObjectGroupMemberFresh   ObjectGroupMember = 0x00000001
	ObjectGroupMemberDefault ObjectGroupMember = 0x00000002
)

func (ObjectGroupMember) MarshalText added in v0.2.2

func (enum ObjectGroupMember) MarshalText() ([]byte, error)

type ObjectType

type ObjectType uint32
const (
	ObjectTypeCertificate  ObjectType = 0x00000001
	ObjectTypeSymmetricKey ObjectType = 0x00000002
	ObjectTypePublicKey    ObjectType = 0x00000003
	ObjectTypePrivateKey   ObjectType = 0x00000004
	ObjectTypeSplitKey     ObjectType = 0x00000005
	// Deprecated: deprecated as of kmip 1.3.
	ObjectTypeTemplate     ObjectType = 0x00000006
	ObjectTypeSecretData   ObjectType = 0x00000007
	ObjectTypeOpaqueObject ObjectType = 0x00000008
	// KMIP 1.2.
	ObjectTypePGPKey ObjectType = 0x00000009
)

func (ObjectType) MarshalText added in v0.2.2

func (enum ObjectType) MarshalText() ([]byte, error)

type OpaqueDataType

type OpaqueDataType uint32

func (OpaqueDataType) MarshalText added in v0.2.2

func (enum OpaqueDataType) MarshalText() ([]byte, error)

type OpaqueObject

type OpaqueObject struct {
	OpaqueDataType  OpaqueDataType
	OpaqueDataValue []byte
}

func (*OpaqueObject) ObjectType

func (sd *OpaqueObject) ObjectType() ObjectType

type Operation

type Operation uint32
const (
	OperationCreate             Operation = 0x00000001
	OperationCreateKeyPair      Operation = 0x00000002
	OperationRegister           Operation = 0x00000003
	OperationReKey              Operation = 0x00000004
	OperationDeriveKey          Operation = 0x00000005
	OperationCertify            Operation = 0x00000006
	OperationReCertify          Operation = 0x00000007
	OperationLocate             Operation = 0x00000008
	OperationCheck              Operation = 0x00000009
	OperationGet                Operation = 0x0000000A
	OperationGetAttributes      Operation = 0x0000000B
	OperationGetAttributeList   Operation = 0x0000000C
	OperationAddAttribute       Operation = 0x0000000D
	OperationModifyAttribute    Operation = 0x0000000E
	OperationDeleteAttribute    Operation = 0x0000000F
	OperationObtainLease        Operation = 0x00000010
	OperationGetUsageAllocation Operation = 0x00000011
	OperationActivate           Operation = 0x00000012
	OperationRevoke             Operation = 0x00000013
	OperationDestroy            Operation = 0x00000014
	OperationArchive            Operation = 0x00000015
	OperationRecover            Operation = 0x00000016
	OperationValidate           Operation = 0x00000017
	OperationQuery              Operation = 0x00000018
	OperationCancel             Operation = 0x00000019
	OperationPoll               Operation = 0x0000001A
	OperationNotify             Operation = 0x0000001B
	OperationPut                Operation = 0x0000001C

	// KMIP 1.1.
	OperationReKeyKeyPair     Operation = 0x0000001D
	OperationDiscoverVersions Operation = 0x0000001E

	// KMIP 1.2.
	OperationEncrypt         Operation = 0x0000001F
	OperationDecrypt         Operation = 0x00000020
	OperationSign            Operation = 0x00000021
	OperationSignatureVerify Operation = 0x00000022
	OperationMAC             Operation = 0x00000023
	OperationMACVerify       Operation = 0x00000024
	OperationRNGRetrieve     Operation = 0x00000025
	OperationRNGSeed         Operation = 0x00000026
	OperationHash            Operation = 0x00000027
	OperationCreateSplitKey  Operation = 0x00000028
	OperationJoinSplitKey    Operation = 0x00000029

	// KMIP 1.4.
	OperationImport Operation = 0x0000002A
	OperationExport Operation = 0x0000002B
)

func (Operation) MarshalText added in v0.2.2

func (enum Operation) MarshalText() ([]byte, error)

type OperationPayload

type OperationPayload interface {
	Operation() Operation
}

type PGPKey

type PGPKey struct {
	PGPKeyVersion int32
	KeyBlock      KeyBlock
}

func (*PGPKey) ObjectType

func (sd *PGPKey) ObjectType() ObjectType

type PaddingMethod

type PaddingMethod uint32
const (
	PaddingMethodNone      PaddingMethod = 0x00000001
	PaddingMethodOAEP      PaddingMethod = 0x00000002
	PaddingMethodPKCS5     PaddingMethod = 0x00000003
	PaddingMethodSSL3      PaddingMethod = 0x00000004
	PaddingMethodZeros     PaddingMethod = 0x00000005
	PaddingMethodANSIX9_23 PaddingMethod = 0x00000006
	PaddingMethodISO10126  PaddingMethod = 0x00000007
	PaddingMethodPKCS1V1_5 PaddingMethod = 0x00000008
	PaddingMethodX9_31     PaddingMethod = 0x00000009
	PaddingMethodPSS       PaddingMethod = 0x0000000A
)

func (PaddingMethod) MarshalText added in v0.2.2

func (enum PaddingMethod) MarshalText() ([]byte, error)

type PlainKeyValue

type PlainKeyValue struct {
	KeyMaterial KeyMaterial
	Attribute   []Attribute
}

type PrivateKey

type PrivateKey struct {
	KeyBlock KeyBlock
}

func (*PrivateKey) CryptoPrivateKey added in v0.2.0

func (key *PrivateKey) CryptoPrivateKey() (crypto.PrivateKey, error)

CryptoPrivateKey parses and return the private key object into a go crypto.PrivateKey object.

func (*PrivateKey) ECDSA

func (key *PrivateKey) ECDSA() (*ecdsa.PrivateKey, error)

func (*PrivateKey) ObjectType

func (sd *PrivateKey) ObjectType() ObjectType

func (*PrivateKey) Pkcs8Pem added in v0.2.0

func (key *PrivateKey) Pkcs8Pem() (string, error)

Pkcs8Pem format the private key into the PEM encoding of its PKCS #8, ASN.1 DER form.

func (*PrivateKey) RSA

func (key *PrivateKey) RSA() (*rsa.PrivateKey, error)

type ProfileInformation

type ProfileInformation struct {
	ProfileName ProfileName
	ServerURI   string `ttlv:",omitempty"`
	ServerPort  int32  `ttlv:",omitempty"`
}

type ProfileName

type ProfileName uint32
const (
	ProfileNameBaselineServerBasicKMIPV1_2                       ProfileName = 0x00000001
	ProfileNameBaselineServerTLSV1_2KMIPV1_2                     ProfileName = 0x00000002
	ProfileNameBaselineClientBasicKMIPV1_2                       ProfileName = 0x00000003
	ProfileNameBaselineClientTLSV1_2KMIPV1_2                     ProfileName = 0x00000004
	ProfileNameCompleteServerBasicKMIPV1_2                       ProfileName = 0x00000005
	ProfileNameCompleteServerTLSV1_2KMIPV1_2                     ProfileName = 0x00000006
	ProfileNameTapeLibraryClientKMIPV1_0                         ProfileName = 0x00000007
	ProfileNameTapeLibraryClientKMIPV1_1                         ProfileName = 0x00000008
	ProfileNameTapeLibraryClientKMIPV1_2                         ProfileName = 0x00000009
	ProfileNameTapeLibraryServerKMIPV1_0                         ProfileName = 0x0000000A
	ProfileNameTapeLibraryServerKMIPV1_1                         ProfileName = 0x0000000B
	ProfileNameTapeLibraryServerKMIPV1_2                         ProfileName = 0x0000000C
	ProfileNameSymmetricKeyLifecycleClientKMIPV1_0               ProfileName = 0x0000000D
	ProfileNameSymmetricKeyLifecycleClientKMIPV1_1               ProfileName = 0x0000000E
	ProfileNameSymmetricKeyLifecycleClientKMIPV1_2               ProfileName = 0x0000000F
	ProfileNameSymmetricKeyLifecycleServerKMIPV1_0               ProfileName = 0x00000010
	ProfileNameSymmetricKeyLifecycleServerKMIPV1_1               ProfileName = 0x00000011
	ProfileNameSymmetricKeyLifecycleServerKMIPV1_2               ProfileName = 0x00000012
	ProfileNameAsymmetricKeyLifecycleClientKMIPV1_0              ProfileName = 0x00000013
	ProfileNameAsymmetricKeyLifecycleClientKMIPV1_1              ProfileName = 0x00000014
	ProfileNameAsymmetricKeyLifecycleClientKMIPV1_2              ProfileName = 0x00000015
	ProfileNameAsymmetricKeyLifecycleServerKMIPV1_0              ProfileName = 0x00000016
	ProfileNameAsymmetricKeyLifecycleServerKMIPV1_1              ProfileName = 0x00000017
	ProfileNameAsymmetricKeyLifecycleServerKMIPV1_2              ProfileName = 0x00000018
	ProfileNameBasicCryptographicClientKMIPV1_2                  ProfileName = 0x00000019
	ProfileNameBasicCryptographicServerKMIPV1_2                  ProfileName = 0x0000001A
	ProfileNameAdvancedCryptographicClientKMIPV1_2               ProfileName = 0x0000001B
	ProfileNameAdvancedCryptographicServerKMIPV1_2               ProfileName = 0x0000001C
	ProfileNameRNGCryptographicClientKMIPV1_2                    ProfileName = 0x0000001D
	ProfileNameRNGCryptographicServerKMIPV1_2                    ProfileName = 0x0000001E
	ProfileNameBasicSymmetricKeyFoundryClientKMIPV1_0            ProfileName = 0x0000001F
	ProfileNameIntermediateSymmetricKeyFoundryClientKMIPV1_0     ProfileName = 0x00000020
	ProfileNameAdvancedSymmetricKeyFoundryClientKMIPV1_0         ProfileName = 0x00000021
	ProfileNameBasicSymmetricKeyFoundryClientKMIPV1_1            ProfileName = 0x00000022
	ProfileNameIntermediateSymmetricKeyFoundryClientKMIPV1_1     ProfileName = 0x00000023
	ProfileNameAdvancedSymmetricKeyFoundryClientKMIPV1_1         ProfileName = 0x00000024
	ProfileNameBasicSymmetricKeyFoundryClientKMIPV1_2            ProfileName = 0x00000025
	ProfileNameIntermediateSymmetricKeyFoundryClientKMIPV1_2     ProfileName = 0x00000026
	ProfileNameAdvancedSymmetricKeyFoundryClientKMIPV1_2         ProfileName = 0x00000027
	ProfileNameSymmetricKeyFoundryServerKMIPV1_0                 ProfileName = 0x00000028
	ProfileNameSymmetricKeyFoundryServerKMIPV1_1                 ProfileName = 0x00000029
	ProfileNameSymmetricKeyFoundryServerKMIPV1_2                 ProfileName = 0x0000002A
	ProfileNameOpaqueManagedObjectStoreClientKMIPV1_0            ProfileName = 0x0000002B
	ProfileNameOpaqueManagedObjectStoreClientKMIPV1_1            ProfileName = 0x0000002C
	ProfileNameOpaqueManagedObjectStoreClientKMIPV1_2            ProfileName = 0x0000002D
	ProfileNameOpaqueManagedObjectStoreServerKMIPV1_0            ProfileName = 0x0000002E
	ProfileNameOpaqueManagedObjectStoreServerKMIPV1_1            ProfileName = 0x0000002F
	ProfileNameOpaqueManagedObjectStoreServerKMIPV1_2            ProfileName = 0x00000030
	ProfileNameSuiteBMinLOS_128ClientKMIPV1_0                    ProfileName = 0x00000031
	ProfileNameSuiteBMinLOS_128ClientKMIPV1_1                    ProfileName = 0x00000032
	ProfileNameSuiteBMinLOS_128ClientKMIPV1_2                    ProfileName = 0x00000033
	ProfileNameSuiteBMinLOS_128ServerKMIPV1_0                    ProfileName = 0x00000034
	ProfileNameSuiteBMinLOS_128ServerKMIPV1_1                    ProfileName = 0x00000035
	ProfileNameSuiteBMinLOS_128ServerKMIPV1_2                    ProfileName = 0x00000036
	ProfileNameSuiteBMinLOS_192ClientKMIPV1_0                    ProfileName = 0x00000037
	ProfileNameSuiteBMinLOS_192ClientKMIPV1_1                    ProfileName = 0x00000038
	ProfileNameSuiteBMinLOS_192ClientKMIPV1_2                    ProfileName = 0x00000039
	ProfileNameSuiteBMinLOS_192ServerKMIPV1_0                    ProfileName = 0x0000003A
	ProfileNameSuiteBMinLOS_192ServerKMIPV1_1                    ProfileName = 0x0000003B
	ProfileNameSuiteBMinLOS_192ServerKMIPV1_2                    ProfileName = 0x0000003C
	ProfileNameStorageArrayWithSelfEncryptingDriveClientKMIPV1_0 ProfileName = 0x0000003D
	ProfileNameStorageArrayWithSelfEncryptingDriveClientKMIPV1_1 ProfileName = 0x0000003E
	ProfileNameStorageArrayWithSelfEncryptingDriveClientKMIPV1_2 ProfileName = 0x0000003F
	ProfileNameStorageArrayWithSelfEncryptingDriveServerKMIPV1_0 ProfileName = 0x00000040
	ProfileNameStorageArrayWithSelfEncryptingDriveServerKMIPV1_1 ProfileName = 0x00000041
	ProfileNameStorageArrayWithSelfEncryptingDriveServerKMIPV1_2 ProfileName = 0x00000042
	ProfileNameHTTPSClientKMIPV1_0                               ProfileName = 0x00000043
	ProfileNameHTTPSClientKMIPV1_1                               ProfileName = 0x00000044
	ProfileNameHTTPSClientKMIPV1_2                               ProfileName = 0x00000045
	ProfileNameHTTPSServerKMIPV1_0                               ProfileName = 0x00000046
	ProfileNameHTTPSServerKMIPV1_1                               ProfileName = 0x00000047
	ProfileNameHTTPSServerKMIPV1_2                               ProfileName = 0x00000048
	ProfileNameJSONClientKMIPV1_0                                ProfileName = 0x00000049
	ProfileNameJSONClientKMIPV1_1                                ProfileName = 0x0000004A
	ProfileNameJSONClientKMIPV1_2                                ProfileName = 0x0000004B
	ProfileNameJSONServerKMIPV1_0                                ProfileName = 0x0000004C
	ProfileNameJSONServerKMIPV1_1                                ProfileName = 0x0000004D
	ProfileNameJSONServerKMIPV1_2                                ProfileName = 0x0000004E
	ProfileNameXMLClientKMIPV1_0                                 ProfileName = 0x0000004F
	ProfileNameXMLClientKMIPV1_1                                 ProfileName = 0x00000050
	ProfileNameXMLClientKMIPV1_2                                 ProfileName = 0x00000051
	ProfileNameXMLServerKMIPV1_0                                 ProfileName = 0x00000052
	ProfileNameXMLServerKMIPV1_1                                 ProfileName = 0x00000053
	ProfileNameXMLServerKMIPV1_2                                 ProfileName = 0x00000054
	ProfileNameBaselineServerBasicKMIPV1_3                       ProfileName = 0x00000055
	ProfileNameBaselineServerTLSV1_2KMIPV1_3                     ProfileName = 0x00000056
	ProfileNameBaselineClientBasicKMIPV1_3                       ProfileName = 0x00000057
	ProfileNameBaselineClientTLSV1_2KMIPV1_3                     ProfileName = 0x00000058
	ProfileNameCompleteServerBasicKMIPV1_3                       ProfileName = 0x00000059
	ProfileNameCompleteServerTLSV1_2KMIPV1_3                     ProfileName = 0x0000005A
	ProfileNameTapeLibraryClientKMIPV1_3                         ProfileName = 0x0000005B
	ProfileNameTapeLibraryServerKMIPV1_3                         ProfileName = 0x0000005C
	ProfileNameSymmetricKeyLifecycleClientKMIPV1_3               ProfileName = 0x0000005D
	ProfileNameSymmetricKeyLifecycleServerKMIPV1_3               ProfileName = 0x0000005E
	ProfileNameAsymmetricKeyLifecycleClientKMIPV1_3              ProfileName = 0x0000005F
	ProfileNameAsymmetricKeyLifecycleServerKMIPV1_3              ProfileName = 0x00000060
	ProfileNameBasicCryptographicClientKMIPV1_3                  ProfileName = 0x00000061
	ProfileNameBasicCryptographicServerKMIPV1_3                  ProfileName = 0x00000062
	ProfileNameAdvancedCryptographicClientKMIPV1_3               ProfileName = 0x00000063
	ProfileNameAdvancedCryptographicServerKMIPV1_3               ProfileName = 0x00000064
	ProfileNameRNGCryptographicClientKMIPV1_3                    ProfileName = 0x00000065
	ProfileNameRNGCryptographicServerKMIPV1_3                    ProfileName = 0x00000066
	ProfileNameBasicSymmetricKeyFoundryClientKMIPV1_3            ProfileName = 0x00000067
	ProfileNameIntermediateSymmetricKeyFoundryClientKMIPV1_3     ProfileName = 0x00000068
	ProfileNameAdvancedSymmetricKeyFoundryClientKMIPV1_3         ProfileName = 0x00000069
	ProfileNameSymmetricKeyFoundryServerKMIPV1_3                 ProfileName = 0x0000006A
	ProfileNameOpaqueManagedObjectStoreClientKMIPV1_3            ProfileName = 0x0000006B
	ProfileNameOpaqueManagedObjectStoreServerKMIPV1_3            ProfileName = 0x0000006C
	ProfileNameSuiteBMinLOS_128ClientKMIPV1_3                    ProfileName = 0x0000006D
	ProfileNameSuiteBMinLOS_128ServerKMIPV1_3                    ProfileName = 0x0000006E
	ProfileNameSuiteBMinLOS_192ClientKMIPV1_3                    ProfileName = 0x0000006F
	ProfileNameSuiteBMinLOS_192ServerKMIPV1_3                    ProfileName = 0x00000070
	ProfileNameStorageArrayWithSelfEncryptingDriveClientKMIPV1_3 ProfileName = 0x00000071
	ProfileNameStorageArrayWithSelfEncryptingDriveServerKMIPV1_3 ProfileName = 0x00000072
	ProfileNameHTTPSClientKMIPV1_3                               ProfileName = 0x00000073
	ProfileNameHTTPSServerKMIPV1_3                               ProfileName = 0x00000074
	ProfileNameJSONClientKMIPV1_3                                ProfileName = 0x00000075
	ProfileNameJSONServerKMIPV1_3                                ProfileName = 0x00000076
	ProfileNameXMLClientKMIPV1_3                                 ProfileName = 0x00000077
	ProfileNameXMLServerKMIPV1_3                                 ProfileName = 0x00000078

	// KMIP 1.4.
	ProfileNameBaselineServerBasicKMIPV1_4                       ProfileName = 0x00000079
	ProfileNameBaselineServerTLSV1_2KMIPV1_4                     ProfileName = 0x0000007A
	ProfileNameBaselineClientBasicKMIPV1_4                       ProfileName = 0x0000007B
	ProfileNameBaselineClientTLSV1_2KMIPV1_4                     ProfileName = 0x0000007C
	ProfileNameCompleteServerBasicKMIPV1_4                       ProfileName = 0x0000007D
	ProfileNameCompleteServerTLSV1_2KMIPV1_4                     ProfileName = 0x0000007E
	ProfileNameTapeLibraryClientKMIPV1_4                         ProfileName = 0x0000007F
	ProfileNameTapeLibraryServerKMIPV1_4                         ProfileName = 0x00000080
	ProfileNameSymmetricKeyLifecycleClientKMIPV1_4               ProfileName = 0x00000081
	ProfileNameSymmetricKeyLifecycleServerKMIPV1_4               ProfileName = 0x00000082
	ProfileNameAsymmetricKeyLifecycleClientKMIPV1_4              ProfileName = 0x00000083
	ProfileNameAsymmetricKeyLifecycleServerKMIPV1_4              ProfileName = 0x00000084
	ProfileNameBasicCryptographicClientKMIPV1_4                  ProfileName = 0x00000085
	ProfileNameBasicCryptographicServerKMIPV1_4                  ProfileName = 0x00000086
	ProfileNameAdvancedCryptographicClientKMIPV1_4               ProfileName = 0x00000087
	ProfileNameAdvancedCryptographicServerKMIPV1_4               ProfileName = 0x00000088
	ProfileNameRNGCryptographicClientKMIPV1_4                    ProfileName = 0x00000089
	ProfileNameRNGCryptographicServerKMIPV1_4                    ProfileName = 0x0000008A
	ProfileNameBasicSymmetricKeyFoundryClientKMIPV1_4            ProfileName = 0x0000008B
	ProfileNameIntermediateSymmetricKeyFoundryClientKMIPV1_4     ProfileName = 0x0000008C
	ProfileNameAdvancedSymmetricKeyFoundryClientKMIPV1_4         ProfileName = 0x0000008D
	ProfileNameSymmetricKeyFoundryServerKMIPV1_4                 ProfileName = 0x0000008E
	ProfileNameOpaqueManagedObjectStoreClientKMIPV1_4            ProfileName = 0x0000008F
	ProfileNameOpaqueManagedObjectStoreServerKMIPV1_4            ProfileName = 0x00000090
	ProfileNameSuiteBMinLOS_128ClientKMIPV1_4                    ProfileName = 0x00000091
	ProfileNameSuiteBMinLOS_128ServerKMIPV1_4                    ProfileName = 0x00000092
	ProfileNameSuiteBMinLOS_192ClientKMIPV1_4                    ProfileName = 0x00000093
	ProfileNameSuiteBMinLOS_192ServerKMIPV1_4                    ProfileName = 0x00000094
	ProfileNameStorageArrayWithSelfEncryptingDriveClientKMIPV1_4 ProfileName = 0x00000095
	ProfileNameStorageArrayWithSelfEncryptingDriveServerKMIPV1_4 ProfileName = 0x00000096
	ProfileNameHTTPSClientKMIPV1_4                               ProfileName = 0x00000097
	ProfileNameHTTPSServerKMIPV1_4                               ProfileName = 0x00000098
	ProfileNameJSONClientKMIPV1_4                                ProfileName = 0x00000099
	ProfileNameJSONServerKMIPV1_4                                ProfileName = 0x0000009A
	ProfileNameXMLClientKMIPV1_4                                 ProfileName = 0x0000009B
	ProfileNameXMLServerKMIPV1_4                                 ProfileName = 0x0000009C
)

func (ProfileName) MarshalText added in v0.2.2

func (enum ProfileName) MarshalText() ([]byte, error)

type ProtocolVersion

type ProtocolVersion struct {
	ProtocolVersionMajor int32
	ProtocolVersionMinor int32
}

func (ProtocolVersion) Major

func (v ProtocolVersion) Major() int

func (ProtocolVersion) Minor

func (v ProtocolVersion) Minor() int

func (ProtocolVersion) String

func (pv ProtocolVersion) String() string

type PublicKey

type PublicKey struct {
	KeyBlock KeyBlock
}

func (*PublicKey) CryptoPublicKey added in v0.2.0

func (key *PublicKey) CryptoPublicKey() (crypto.PublicKey, error)

CryptoPublicKey parses and return the public key object into a go crypto.PublicKey object.

func (*PublicKey) ECDSA

func (key *PublicKey) ECDSA() (*ecdsa.PublicKey, error)

func (*PublicKey) ObjectType

func (sd *PublicKey) ObjectType() ObjectType

func (*PublicKey) PkixPem added in v0.2.0

func (key *PublicKey) PkixPem() (string, error)

PkixPem format the public key value into a PEM encoding of its PKIX, ASN.1 DER form. The encoded public key is a SubjectPublicKeyInfo structure (see RFC 5280, Section 4.1).

func (*PublicKey) RSA

func (key *PublicKey) RSA() (*rsa.PublicKey, error)

type PutFunction

type PutFunction uint32
const (
	PutFunctionNew     PutFunction = 0x00000001
	PutFunctionReplace PutFunction = 0x00000002
)

func (PutFunction) MarshalText added in v0.2.2

func (enum PutFunction) MarshalText() ([]byte, error)

type QueryFunction

type QueryFunction uint32
const (
	QueryFunctionOperations            QueryFunction = 0x00000001
	QueryFunctionObjects               QueryFunction = 0x00000002
	QueryFunctionServerInformation     QueryFunction = 0x00000003
	QueryFunctionApplicationNamespaces QueryFunction = 0x00000004
	// KMIP 1.1.
	QueryFunctionExtensionList QueryFunction = 0x00000005
	QueryFunctionExtensionMap  QueryFunction = 0x00000006
	// KMIP 1.2.
	QueryFunctionAttestationTypes QueryFunction = 0x00000007

	// KMIP 1.3.
	QueryFunctionRNGs                      QueryFunction = 0x00000008
	QueryFunctionValidations               QueryFunction = 0x00000009
	QueryFunctionProfiles                  QueryFunction = 0x0000000A
	QueryFunctionCapabilities              QueryFunction = 0x0000000B
	QueryFunctionClientRegistrationMethods QueryFunction = 0x0000000C
)

func (QueryFunction) MarshalText added in v0.2.2

func (enum QueryFunction) MarshalText() ([]byte, error)

type RNGAlgorithm

type RNGAlgorithm uint32
const (
	RNGAlgorithmUnspecified RNGAlgorithm = 0x00000001
	RNGAlgorithmFIPS186_2   RNGAlgorithm = 0x00000002
	RNGAlgorithmDRBG        RNGAlgorithm = 0x00000003
	RNGAlgorithmNRBG        RNGAlgorithm = 0x00000004
	RNGAlgorithmANSIX9_31   RNGAlgorithm = 0x00000005
	RNGAlgorithmANSIX9_62   RNGAlgorithm = 0x00000006
)

func (RNGAlgorithm) MarshalText added in v0.2.2

func (enum RNGAlgorithm) MarshalText() ([]byte, error)

type RNGMode

type RNGMode uint32
const (
	RNGModeUnspecified            RNGMode = 0x00000001
	RNGModeSharedInstantiation    RNGMode = 0x00000002
	RNGModeNonSharedInstantiation RNGMode = 0x00000003
)

func (RNGMode) MarshalText added in v0.2.2

func (enum RNGMode) MarshalText() ([]byte, error)

type RNGParameters

type RNGParameters struct {
	RNGAlgorithm           RNGAlgorithm           `ttlv:",omitempty"`
	CryptographicAlgorithm CryptographicAlgorithm `ttlv:",omitempty"`
	CryptographicLength    int32                  `ttlv:",omitempty"`
	HashingAlgorithm       HashingAlgorithm       `ttlv:",omitempty"`
	DRBGAlgorithm          DRBGAlgorithm          `ttlv:",omitempty"`
	RecommendedCurve       RecommendedCurve       `ttlv:",omitempty"`
	FIPS186Variation       FIPS186Variation       `ttlv:",omitempty"`
	PredictionResistance   *bool
}

type RecommendedCurve

type RecommendedCurve uint32
const (
	RecommendedCurveP_192 RecommendedCurve = 0x00000001
	RecommendedCurveK_163 RecommendedCurve = 0x00000002
	RecommendedCurveB_163 RecommendedCurve = 0x00000003
	RecommendedCurveP_224 RecommendedCurve = 0x00000004
	RecommendedCurveK_233 RecommendedCurve = 0x00000005
	RecommendedCurveB_233 RecommendedCurve = 0x00000006
	RecommendedCurveP_256 RecommendedCurve = 0x00000007
	RecommendedCurveK_283 RecommendedCurve = 0x00000008
	RecommendedCurveB_283 RecommendedCurve = 0x00000009
	RecommendedCurveP_384 RecommendedCurve = 0x0000000A
	RecommendedCurveK_409 RecommendedCurve = 0x0000000B
	RecommendedCurveB_409 RecommendedCurve = 0x0000000C
	RecommendedCurveP_521 RecommendedCurve = 0x0000000D
	RecommendedCurveK_571 RecommendedCurve = 0x0000000E
	RecommendedCurveB_571 RecommendedCurve = 0x0000000F

	// KMIP 1.2.
	RecommendedCurveSECP112R1        RecommendedCurve = 0x00000010
	RecommendedCurveSECP112R2        RecommendedCurve = 0x00000011
	RecommendedCurveSECP128R1        RecommendedCurve = 0x00000012
	RecommendedCurveSECP128R2        RecommendedCurve = 0x00000013
	RecommendedCurveSECP160K1        RecommendedCurve = 0x00000014
	RecommendedCurveSECP160R1        RecommendedCurve = 0x00000015
	RecommendedCurveSECP160R2        RecommendedCurve = 0x00000016
	RecommendedCurveSECP192K1        RecommendedCurve = 0x00000017
	RecommendedCurveSECP224K1        RecommendedCurve = 0x00000018
	RecommendedCurveSECP256K1        RecommendedCurve = 0x00000019
	RecommendedCurveSECT113R1        RecommendedCurve = 0x0000001A
	RecommendedCurveSECT113R2        RecommendedCurve = 0x0000001B
	RecommendedCurveSECT131R1        RecommendedCurve = 0x0000001C
	RecommendedCurveSECT131R2        RecommendedCurve = 0x0000001D
	RecommendedCurveSECT163R1        RecommendedCurve = 0x0000001E
	RecommendedCurveSECT193R1        RecommendedCurve = 0x0000001F
	RecommendedCurveSECT193R2        RecommendedCurve = 0x00000020
	RecommendedCurveSECT239K1        RecommendedCurve = 0x00000021
	RecommendedCurveANSIX9P192V2     RecommendedCurve = 0x00000022
	RecommendedCurveANSIX9P192V3     RecommendedCurve = 0x00000023
	RecommendedCurveANSIX9P239V1     RecommendedCurve = 0x00000024
	RecommendedCurveANSIX9P239V2     RecommendedCurve = 0x00000025
	RecommendedCurveANSIX9P239V3     RecommendedCurve = 0x00000026
	RecommendedCurveANSIX9C2PNB163V1 RecommendedCurve = 0x00000027
	RecommendedCurveANSIX9C2PNB163V2 RecommendedCurve = 0x00000028
	RecommendedCurveANSIX9C2PNB163V3 RecommendedCurve = 0x00000029
	RecommendedCurveANSIX9C2PNB176V1 RecommendedCurve = 0x0000002A
	RecommendedCurveANSIX9C2TNB191V1 RecommendedCurve = 0x0000002B
	RecommendedCurveANSIX9C2TNB191V2 RecommendedCurve = 0x0000002C
	RecommendedCurveANSIX9C2TNB191V3 RecommendedCurve = 0x0000002D
	RecommendedCurveANSIX9C2PNB208W1 RecommendedCurve = 0x0000002E
	RecommendedCurveANSIX9C2TNB239V1 RecommendedCurve = 0x0000002F
	RecommendedCurveANSIX9C2TNB239V2 RecommendedCurve = 0x00000030
	RecommendedCurveANSIX9C2TNB239V3 RecommendedCurve = 0x00000031
	RecommendedCurveANSIX9C2PNB272W1 RecommendedCurve = 0x00000032
	RecommendedCurveANSIX9C2PNB304W1 RecommendedCurve = 0x00000033
	RecommendedCurveANSIX9C2TNB359V1 RecommendedCurve = 0x00000034
	RecommendedCurveANSIX9C2PNB368W1 RecommendedCurve = 0x00000035
	RecommendedCurveANSIX9C2TNB431R1 RecommendedCurve = 0x00000036
	RecommendedCurveBRAINPOOLP160R1  RecommendedCurve = 0x00000037
	RecommendedCurveBRAINPOOLP160T1  RecommendedCurve = 0x00000038
	RecommendedCurveBRAINPOOLP192R1  RecommendedCurve = 0x00000039
	RecommendedCurveBRAINPOOLP192T1  RecommendedCurve = 0x0000003A
	RecommendedCurveBRAINPOOLP224R1  RecommendedCurve = 0x0000003B
	RecommendedCurveBRAINPOOLP224T1  RecommendedCurve = 0x0000003C
	RecommendedCurveBRAINPOOLP256R1  RecommendedCurve = 0x0000003D
	RecommendedCurveBRAINPOOLP256T1  RecommendedCurve = 0x0000003E
	RecommendedCurveBRAINPOOLP320R1  RecommendedCurve = 0x0000003F
	RecommendedCurveBRAINPOOLP320T1  RecommendedCurve = 0x00000040
	RecommendedCurveBRAINPOOLP384R1  RecommendedCurve = 0x00000041
	RecommendedCurveBRAINPOOLP384T1  RecommendedCurve = 0x00000042
	RecommendedCurveBRAINPOOLP512R1  RecommendedCurve = 0x00000043
	RecommendedCurveBRAINPOOLP512T1  RecommendedCurve = 0x00000044
)

func (RecommendedCurve) Bitlen

func (crv RecommendedCurve) Bitlen() int32

Bitlen returns the bit length for the key using the curve.

func (RecommendedCurve) MarshalText added in v0.2.2

func (enum RecommendedCurve) MarshalText() ([]byte, error)

type RequestBatchItem

type RequestBatchItem struct {
	Operation         Operation
	UniqueBatchItemID []byte `ttlv:",omitempty"`
	RequestPayload    OperationPayload
	MessageExtension  *MessageExtension
}

func (*RequestBatchItem) TagDecodeTTLV

func (pv *RequestBatchItem) TagDecodeTTLV(d *ttlv.Decoder, tag int) error

func (*RequestBatchItem) TagEncodeTTLV

func (pv *RequestBatchItem) TagEncodeTTLV(e *ttlv.Encoder, tag int)

type RequestHeader

type RequestHeader struct {
	ProtocolVersion     ProtocolVersion `ttlv:",set-version"`
	MaximumResponseSize int32           `ttlv:",omitempty"`

	ClientCorrelationValue       string `ttlv:",omitempty,version=v1.4.."`
	ServerCorrelationValue       string `ttlv:",omitempty,version=v1.4.."`
	AsynchronousIndicator        *bool
	AttestationCapableIndicator  *bool             `ttlv:",version=v1.2.."`
	AttestationType              []AttestationType `ttlv:",version=v1.2.."`
	Authentication               *Authentication
	BatchErrorContinuationOption BatchErrorContinuationOption `ttlv:",omitempty"`
	BatchOrderOption             *bool
	TimeStamp                    *time.Time
	BatchCount                   int32
}

type RequestMessage

type RequestMessage struct {
	Header    RequestHeader
	BatchItem []RequestBatchItem
}

func NewRequestMessage

func NewRequestMessage(version ProtocolVersion, payloads ...OperationPayload) RequestMessage

type ResponseBatchItem

type ResponseBatchItem struct {
	Operation                    Operation `ttlv:",omitempty"`
	UniqueBatchItemID            []byte    `ttlv:",omitempty"`
	ResultStatus                 ResultStatus
	ResultReason                 ResultReason `ttlv:",omitempty"`
	ResultMessage                string       `ttlv:",omitempty"`
	AsynchronousCorrelationValue []byte       `ttlv:",omitempty"`
	ResponsePayload              OperationPayload
	MessageExtension             *MessageExtension
}

func (*ResponseBatchItem) Err

func (bi *ResponseBatchItem) Err() error

func (*ResponseBatchItem) TagDecodeTTLV

func (pv *ResponseBatchItem) TagDecodeTTLV(d *ttlv.Decoder, tag int) error

func (*ResponseBatchItem) TagEncodeTTLV

func (pv *ResponseBatchItem) TagEncodeTTLV(e *ttlv.Encoder, tag int)

type ResponseHeader

type ResponseHeader struct {
	ProtocolVersion        ProtocolVersion `ttlv:",set-version"`
	TimeStamp              time.Time
	Nonce                  *Nonce            `ttlv:",version=v1.2.."`
	AttestationType        []AttestationType `ttlv:",version=v1.2.."`
	ClientCorrelationValue string            `ttlv:",omitempty,version=v1.4.."`
	ServerCorrelationValue string            `ttlv:",omitempty,version=v1.4.."`
	BatchCount             int32
}

type ResponseMessage

type ResponseMessage struct {
	Header    ResponseHeader
	BatchItem []ResponseBatchItem
}

type ResultReason

type ResultReason uint32
const (
	ResultReasonItemNotFound                     ResultReason = 0x00000001
	ResultReasonResponseTooLarge                 ResultReason = 0x00000002
	ResultReasonAuthenticationNotSuccessful      ResultReason = 0x00000003
	ResultReasonInvalidMessage                   ResultReason = 0x00000004
	ResultReasonOperationNotSupported            ResultReason = 0x00000005
	ResultReasonMissingData                      ResultReason = 0x00000006
	ResultReasonInvalidField                     ResultReason = 0x00000007
	ResultReasonFeatureNotSupported              ResultReason = 0x00000008
	ResultReasonOperationCanceledByRequester     ResultReason = 0x00000009
	ResultReasonCryptographicFailure             ResultReason = 0x0000000A
	ResultReasonIllegalOperation                 ResultReason = 0x0000000B
	ResultReasonPermissionDenied                 ResultReason = 0x0000000C
	ResultReasonObjectarchived                   ResultReason = 0x0000000D
	ResultReasonIndexOutofBounds                 ResultReason = 0x0000000E
	ResultReasonApplicationNamespaceNotSupported ResultReason = 0x0000000F
	ResultReasonKeyFormatTypeNotSupported        ResultReason = 0x00000010
	ResultReasonKeyCompressionTypeNotSupported   ResultReason = 0x00000011
	// KMIP 1.1.
	ResultReasonEncodingOptionError ResultReason = 0x00000012
	// KMIP 1.2.
	ResultReasonKeyValueNotPresent  ResultReason = 0x00000013
	ResultReasonAttestationRequired ResultReason = 0x00000014
	ResultReasonAttestationFailed   ResultReason = 0x00000015

	// KMIP 1.4.
	ResultReasonSensitive           ResultReason = 0x00000016
	ResultReasonNotExtractable      ResultReason = 0x00000017
	ResultReasonObjectAlreadyExists ResultReason = 0x00000018

	ResultReasonGeneralFailure ResultReason = 0x00000100
)

See https://docs.oasis-open.org/kmip/spec/v1.4/errata01/os/kmip-spec-v1.4-errata01-os-redlined.html#_Toc490660949

func (ResultReason) MarshalText added in v0.2.2

func (enum ResultReason) MarshalText() ([]byte, error)

type ResultStatus

type ResultStatus uint32
const (
	ResultStatusSuccess          ResultStatus = 0x00000000
	ResultStatusOperationFailed  ResultStatus = 0x00000001
	ResultStatusOperationPending ResultStatus = 0x00000002
	ResultStatusOperationUndone  ResultStatus = 0x00000003
)

func (ResultStatus) MarshalText added in v0.2.2

func (enum ResultStatus) MarshalText() ([]byte, error)

type RevocationReason

type RevocationReason struct {
	RevocationReasonCode RevocationReasonCode `ttlv:",omitempty"`
	RevocationMessage    string               `ttlv:",omitempty"`
}

type RevocationReasonCode

type RevocationReasonCode uint32
const (
	RevocationReasonCodeUnspecified          RevocationReasonCode = 0x00000001
	RevocationReasonCodeKeyCompromise        RevocationReasonCode = 0x00000002
	RevocationReasonCodeCACompromise         RevocationReasonCode = 0x00000003
	RevocationReasonCodeAffiliationChanged   RevocationReasonCode = 0x00000004
	RevocationReasonCodeSuperseded           RevocationReasonCode = 0x00000005
	RevocationReasonCodeCessationOfOperation RevocationReasonCode = 0x00000006
	RevocationReasonCodePrivilegeWithdrawn   RevocationReasonCode = 0x00000007
)

func (RevocationReasonCode) MarshalText added in v0.2.2

func (enum RevocationReasonCode) MarshalText() ([]byte, error)

type SecretData

type SecretData struct {
	SecretDataType SecretDataType
	KeyBlock       KeyBlock
}

func (*SecretData) Data

func (sd *SecretData) Data() ([]byte, error)

func (*SecretData) ObjectType

func (sd *SecretData) ObjectType() ObjectType

type SecretDataType

type SecretDataType uint32
const (
	SecretDataTypePassword SecretDataType = 0x00000001
	SecretDataTypeSeed     SecretDataType = 0x00000002
)

func (SecretDataType) MarshalText added in v0.2.2

func (enum SecretDataType) MarshalText() ([]byte, error)

type ShreddingAlgorithm

type ShreddingAlgorithm uint32
const (
	ShreddingAlgorithmUnspecified   ShreddingAlgorithm = 0x00000001
	ShreddingAlgorithmCryptographic ShreddingAlgorithm = 0x00000002
	ShreddingAlgorithmUnsupported   ShreddingAlgorithm = 0x00000003
)

func (ShreddingAlgorithm) MarshalText added in v0.2.2

func (enum ShreddingAlgorithm) MarshalText() ([]byte, error)

type SplitKey

type SplitKey struct {
	SplitKeyParts     int32
	KeyPartIdentifier int32
	SplitKeyThreshold int32
	SplitKeyMethod    SplitKeyMethod
	PrimeFieldSize    *big.Int
	KeyBlock          KeyBlock
}

func (*SplitKey) ObjectType

func (sd *SplitKey) ObjectType() ObjectType

type SplitKeyMethod

type SplitKeyMethod uint32
const (
	SplitKeyMethodXOR                         SplitKeyMethod = 0x00000001
	SplitKeyMethodPolynomialSharingGF216      SplitKeyMethod = 0x00000002
	SplitKeyMethodPolynomialSharingPrimeField SplitKeyMethod = 0x00000003

	// KMIP 1.2.
	SplitKeyMethodPolynomialSharingGF28 SplitKeyMethod = 0x00000004
)

func (SplitKeyMethod) MarshalText added in v0.2.2

func (enum SplitKeyMethod) MarshalText() ([]byte, error)

type State

type State uint32
const (
	StatePreActive            State = 0x00000001
	StateActive               State = 0x00000002
	StateDeactivated          State = 0x00000003
	StateCompromised          State = 0x00000004
	StateDestroyed            State = 0x00000005
	StateDestroyedCompromised State = 0x00000006
)

func (State) MarshalText added in v0.2.2

func (enum State) MarshalText() ([]byte, error)

type StorageStatusMask

type StorageStatusMask int32
const (
	StorageStatusOnlineStorage StorageStatusMask = 1 << iota
	StorageStatusArchivalStorage
)

func (StorageStatusMask) MarshalText added in v0.2.2

func (mask StorageStatusMask) MarshalText() ([]byte, error)

type SymmetricKey

type SymmetricKey struct {
	KeyBlock KeyBlock
}

func (*SymmetricKey) KeyMaterial

func (sd *SymmetricKey) KeyMaterial() ([]byte, error)

func (*SymmetricKey) ObjectType

func (sd *SymmetricKey) ObjectType() ObjectType

type Template deprecated

type Template struct {
	Attribute []Attribute
}

Deprecated: deprecated as of KMIP 1.3.

func (*Template) ObjectType

func (sd *Template) ObjectType() ObjectType

type TemplateAttribute

type TemplateAttribute struct {
	// Deprecated: deprecated as of kmip 1.3
	Name      []Name
	Attribute []Attribute
}

type TransparentECDSAPrivateKey deprecated

type TransparentECDSAPrivateKey TransparentECPrivateKey

Deprecated: deprecated in KMIP v1.3.

type TransparentECDSAPublicKey deprecated

type TransparentECDSAPublicKey TransparentECPublicKey

Deprecated: deprecated in KMIP v1.3.

type TransparentECPrivateKey

type TransparentECPrivateKey struct {
	RecommendedCurve RecommendedCurve
	D                big.Int
}

type TransparentECPublicKey

type TransparentECPublicKey struct {
	RecommendedCurve RecommendedCurve
	QString          []byte
}

type TransparentRSAPrivateKey

type TransparentRSAPrivateKey struct {
	Modulus         big.Int
	PrivateExponent *big.Int
	PublicExponent  *big.Int
	P               *big.Int
	Q               *big.Int
	PrimeExponentP  *big.Int
	PrimeExponentQ  *big.Int
	CRTCoefficient  *big.Int
}

type TransparentRSAPublicKey

type TransparentRSAPublicKey struct {
	Modulus        big.Int
	PublicExponent big.Int
}

type TransparentSymmetricKey

type TransparentSymmetricKey struct {
	Key []byte
}

type UnknownPayload

type UnknownPayload struct {
	Fields ttlv.Struct
	// contains filtered or unexported fields
}

func NewUnknownPayload

func NewUnknownPayload(op Operation, fields ...ttlv.Value) *UnknownPayload

func (*UnknownPayload) Operation

func (pl *UnknownPayload) Operation() Operation

func (*UnknownPayload) TagDecodeTTLV

func (v *UnknownPayload) TagDecodeTTLV(d *ttlv.Decoder, tag int) error

func (*UnknownPayload) TagEncodeTTLV

func (v *UnknownPayload) TagEncodeTTLV(e *ttlv.Encoder, tag int)

type UnwrapMode

type UnwrapMode uint32
const (
	UnwrapModeUnspecified  UnwrapMode = 0x00000001
	UnwrapModeProcessed    UnwrapMode = 0x00000002
	UnwrapModeNotProcessed UnwrapMode = 0x00000003
)

func (UnwrapMode) MarshalText added in v0.2.2

func (enum UnwrapMode) MarshalText() ([]byte, error)

type UsageLimits

type UsageLimits struct {
	UsageLimitsTotal int64
	UsageLimitsCount *int64
	UsageLimitsUnit  UsageLimitsUnit `ttlv:",omitempty"`
}

func (UsageLimits) Equals

func (ul UsageLimits) Equals(other *UsageLimits) bool

type UsageLimitsUnit

type UsageLimitsUnit uint32
const (
	UsageLimitsUnitByte   UsageLimitsUnit = 0x00000001
	UsageLimitsUnitObject UsageLimitsUnit = 0x00000002
)

func (UsageLimitsUnit) MarshalText added in v0.2.2

func (enum UsageLimitsUnit) MarshalText() ([]byte, error)

type ValidationAuthorityType

type ValidationAuthorityType uint32
const (
	ValidationAuthorityTypeUnspecified    ValidationAuthorityType = 0x00000001
	ValidationAuthorityTypeNISTCMVP       ValidationAuthorityType = 0x00000002
	ValidationAuthorityTypeCommonCriteria ValidationAuthorityType = 0x00000003
)

func (ValidationAuthorityType) MarshalText added in v0.2.2

func (enum ValidationAuthorityType) MarshalText() ([]byte, error)

type ValidationInformation

type ValidationInformation struct {
	ValidationAuthorityType         ValidationAuthorityType
	ValidationAuthorityCountry      string `ttlv:",omitempty"`
	ValidationAuthorityURI          string `ttlv:",omitempty"`
	ValidationVersionMajor          int32
	ValidationVersionMinor          *int32
	ValidationType                  ValidationType
	ValidationLevel                 int32
	ValidationCertificateIdentifier string `ttlv:",omitempty"`
	ValidationCertificateURI        string `ttlv:",omitempty"`
	ValidationVendorURI             string `ttlv:",omitempty"`
	ValidationProfile               []string
}

type ValidationType

type ValidationType uint32
const (
	ValidationTypeUnspecified ValidationType = 0x00000001
	ValidationTypeHardware    ValidationType = 0x00000002
	ValidationTypeSoftware    ValidationType = 0x00000003
	ValidationTypeFirmware    ValidationType = 0x00000004
	ValidationTypeHybrid      ValidationType = 0x00000005
)

func (ValidationType) MarshalText added in v0.2.2

func (enum ValidationType) MarshalText() ([]byte, error)

type ValidityIndicator added in v0.2.4

type ValidityIndicator uint32
const (
	ValidityIndicatorValid   ValidityIndicator = 0x00000001
	ValidityIndicatorInvalid ValidityIndicator = 0x00000002
	ValidityIndicatorUnknown ValidityIndicator = 0x00000003
)

func (ValidityIndicator) MarshalText added in v0.2.4

func (enum ValidityIndicator) MarshalText() ([]byte, error)

type WrappingMethod

type WrappingMethod uint32
const (
	WrappingMethodEncrypt            WrappingMethod = 0x00000001
	WrappingMethodMACSign            WrappingMethod = 0x00000002
	WrappingMethodEncryptThenMACSign WrappingMethod = 0x00000003
	WrappingMethodMACSignThenEncrypt WrappingMethod = 0x00000004
	WrappingMethodTR_31              WrappingMethod = 0x00000005
)

func (WrappingMethod) MarshalText added in v0.2.2

func (enum WrappingMethod) MarshalText() ([]byte, error)

type X_509CertificateIdentifier

type X_509CertificateIdentifier struct {
	IssuerDistinguishedName []byte `ttlv:",omitempty"`
	CertificateSerialNumber []byte `ttlv:",omitempty"`
}

type X_509CertificateIssuer

type X_509CertificateIssuer struct {
	IssuerDistinguishedName []byte `ttlv:",omitempty"`
	IssuerAlternativeName   [][]byte
}

type X_509CertificateSubject

type X_509CertificateSubject struct {
	SubjectDistinguishedName []byte `ttlv:",omitempty"`
	SubjectAlternativeName   [][]byte
}

Directories

Path Synopsis
Package ttlv implements the TTLV serialization and deserialization as defined in the Oasis [KMIP 1.4 specification, section 9.1].
Package ttlv implements the TTLV serialization and deserialization as defined in the Oasis [KMIP 1.4 specification, section 9.1].

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL