|
| 1 | +package payloads |
| 2 | + |
| 3 | +import "github.com/ovh/kmip-go" |
| 4 | + |
| 5 | +// init registers the Import and Export operation payloads with the KMIP package. |
| 6 | +func init() { |
| 7 | + kmip.RegisterOperationPayload[ImportRequestPayload, ImportResponsePayload](kmip.OperationImport) |
| 8 | + kmip.RegisterOperationPayload[ExportRequestPayload, ExportResponsePayload](kmip.OperationExport) |
| 9 | +} |
| 10 | + |
| 11 | +// ImportRequestPayload represents the payload for the Import operation request. |
| 12 | +type ImportRequestPayload struct { |
| 13 | + // UniqueIdentifier is an optional field that specifies the unique identifier of the object to be imported. |
| 14 | + UniqueIdentifier string |
| 15 | + // ReplaceExisting is an optional field that specifies whether to replace an existing object with the imported one. |
| 16 | + ReplaceExisting bool `ttlv:",omitempty,version=v1.4.."` |
| 17 | + // KeyWrapType is an optional field that specifies the key wrapping type used for the imported key material. |
| 18 | + KeyWrapType kmip.KeyWrapType `ttlv:",omitempty,version=v1.4.."` |
| 19 | + // Attribute is an optional field that specifies additional attributes for the imported object. |
| 20 | + Attribute kmip.Attribute `ttlv:",omitempty,version=v1.4.."` |
| 21 | + // AuthenticatedEncryptionAdditionalData is a required field that specifies additional data for authenticated encryption. |
| 22 | + AuthenticatedEncryptionAdditionalData []byte `ttlv:",version=v1.4.."` |
| 23 | +} |
| 24 | + |
| 25 | +// Operation returns the operation type for the ImportRequestPayload. |
| 26 | +func (a *ImportRequestPayload) Operation() kmip.Operation { |
| 27 | + return kmip.OperationImport |
| 28 | +} |
| 29 | + |
| 30 | +// ImportResponsePayload represents the payload for the Import operation response. |
| 31 | +type ImportResponsePayload struct { |
| 32 | + // UniqueIdentifier is a required field that specifies the unique identifier of the imported object. |
| 33 | + UniqueIdentifier string `ttlv:",version=v1.4.."` |
| 34 | +} |
| 35 | + |
| 36 | +// Operation returns the operation type for the ImportResponsePayload. |
| 37 | +func (a *ImportResponsePayload) Operation() kmip.Operation { |
| 38 | + return kmip.OperationImport |
| 39 | +} |
| 40 | + |
| 41 | +// ExportRequestPayload represents the payload for the Export operation request. |
| 42 | +type ExportRequestPayload struct { |
| 43 | + // UniqueIdentifier is an optional field that specifies the unique identifier of the object to be exported. |
| 44 | + UniqueIdentifier string `ttlv:",omitempty,version=v1.4.."` |
| 45 | + // KeyFormatType is an optional field that specifies the format type of the exported key material. |
| 46 | + KeyFormatType kmip.KeyFormatType `ttlv:",omitempty,version=v1.4.."` |
| 47 | + // KeyWrapType is an optional field that specifies the key wrapping type used for the exported key material. |
| 48 | + KeyWrapType kmip.KeyWrapType `ttlv:",omitempty,version=v1.4.."` |
| 49 | + // KeyCompressionType is an optional field that specifies the compression type used for the exported key material. |
| 50 | + KeyCompressionType kmip.KeyCompressionType `ttlv:",omitempty,version=v1.4.."` |
| 51 | + // KeyWrappingSpecification is an optional field that specifies the key wrapping specification for the exported key material. |
| 52 | + KeyWrappingSpecification kmip.KeyWrappingSpecification `ttlv:",omitempty,version=v1.4.."` |
| 53 | +} |
| 54 | + |
| 55 | +// Operation returns the operation type for the ExportRequestPayload. |
| 56 | +func (a *ExportRequestPayload) Operation() kmip.Operation { |
| 57 | + return kmip.OperationExport |
| 58 | +} |
| 59 | + |
| 60 | +// ExportResponsePayload represents the payload for the Export operation response. |
| 61 | +type ExportResponsePayload struct { |
| 62 | + // ObjectType is a required field that specifies the type of the exported object. |
| 63 | + ObjectType kmip.ObjectType `ttlv:",version=v1.4.."` |
| 64 | + // UniqueIdentifier is a required field that specifies the unique identifier of the exported object. |
| 65 | + UniqueIdentifier string `ttlv:",version=v1.4.."` |
| 66 | + // Attribute is a required field that specifies additional attributes for the exported object. |
| 67 | + Attribute kmip.Attribute `ttlv:",version=v1.4.."` |
| 68 | + // AuthenticatedEncryptionAdditionalData is a required field that specifies additional data for authenticated encryption. |
| 69 | + AuthenticatedEncryptionAdditionalData []byte `ttlv:",version=v1.4.."` |
| 70 | +} |
| 71 | + |
| 72 | +// Operation returns the operation type for the ExportResponsePayload. |
| 73 | +func (a *ExportResponsePayload) Operation() kmip.Operation { |
| 74 | + return kmip.OperationExport |
| 75 | +} |
0 commit comments