IBM Key Protect helps you provision encrypted keys for apps across IBM Cloud. As you manage the lifecycle of your keys, you can benefit from knowing that your keys are secured by cloud-based FIPS 140-2 Level 3 hardware security modules (HSMs) that protect against theft of information. You can use the Key Protect API to store, generate, and retrieve your key material. Keys within the service can protect any type of data in your symmetric key based encryption solution.
This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.
- API version: 2.0.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://cloud.ibm.com/docs/services/key-protect/
Install the following dependencies:
go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
go get github.com/antihax/optional
Put the package under your project folder and add the following in import:
import "./keyprotect"
All URIs are relative to https://%7Bregion%7D.kms.cloud.ibm.com
Class | Method | HTTP request | Description |
---|---|---|---|
ImportTokensApi | GetImportToken | Get /api/v2/import_token | Retrieve an import token |
ImportTokensApi | PostImportToken | Post /api/v2/import_token | Create an import token |
KeysApi | ActionOnKey | Post /api/v2/keys/{id} | Invoke an action on a key |
KeysApi | CreateKey | Post /api/v2/keys | Create a new key |
KeysApi | DeleteKey | Delete /api/v2/keys/{id} | Delete a key by ID |
KeysApi | GetKey | Get /api/v2/keys/{id} | Retrieve a key by ID |
KeysApi | GetKeyCollectionMetadata | Head /api/v2/keys | Retrieve the number of keys |
KeysApi | GetKeys | Get /api/v2/keys | Retrieve a list of keys |
PoliciesApi | GetPolicy | Get /api/v2/keys/{id}/policies | Retrieve a list of policies |
PoliciesApi | PutPolicy | Put /api/v2/keys/{id}/policies | Replace an existing policy |
- CollectionMetadata
- CreateKey
- CreatePolicy
- DeleteKey
- Error
- ErrorCollection
- GetImportToken
- GetImportTokenAllOf
- GetKey
- ImportKey
- ImportKeyWithImportToken
- ImportToken
- Key
- KeyMetadata
- KeyMetadataAlgorithmMetadata
- ListKeys
- Policy
- PolicyRotation
- RotateKey
- SecureImport
- UnwrapKey
- WrapKey
- Type: API key
Example
auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
Key: "APIKEY",
Prefix: "Bearer", // Omit if not necessary.
})
r, err := client.Service.Operation(auth, args)