Categorygithub.com/ovh/okms-sdk-go
modulepackage
0.4.2
Repository: https://github.com/ovh/okms-sdk-go.git
Documentation: pkg.go.dev

# README

okms-sdk-go

Go Reference license test Go Report Card

The Golang SDK to interact with your OVHcloud KMS services.

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

How to use

Add it to your project by running

go get github.com/ovh/okms-sdk-go@latest

Then you can connect to your KMS service

cert, err := tls.LoadX509KeyPair(os.Getenv("KMS_CLIENT_CERT_FILE"), os.Getenv("KMS_CLIENT_KEY_FILE"))
if err != nil {
    panic(err)
}
httpClient := http.Client{
    Transport: &http.Transport{TLSClientConfig: &tls.Config{
        Certificates: []tls.Certificate{cert},
        MinVersion:   tls.VersionTLS12,
    }},
}
kmsClient, err := okms.NewRestAPIClientWithHttp("https://eu-west-rbx.okms.ovh.net", &httpClient)
if err != nil {
    panic(err)
}

// Then start using the kmsClient

See examples for more.

If you don't have any KMS service yet, you can follow the OVHcloud KMS quick start guide.

Features

Current SDK allows you to manipulate and consume keys through the KMS REST API. Implemented operations are

  • Keys and Key Pairs lifecycle:
    • Create keys and key pairs
    • Import keys and key pairs
    • Activate and Deactivate keys and key pairs
    • Update keys and key pairs
    • Destroy keys and key pairs
    • Update keys and key pairs metadata
    • List keys and key pairs
    • Export key pair's public keys
    • Read keys and key pairs metadata
  • Symmetric Key operations
    • Encrypt / Decrypt data
    • Generate data keys
    • Decrypt data keys
  • Assymetric Key Pair operations
    • Sign / Verify data

# Packages

No description provided by the author
No description provided by the author
Package types provides primitives to interact with the openapi HTTP API.

# Functions

No description provided by the author
DebugTransport creates an http client middleware that will dump all the HTTP resquests and responses to the giver io.Writer.
ErrStatusCode returns the status code of the HTTP response that caused this error, if any.
No description provided by the author
NewRestAPIClient creates and initializes a new HTTP connection to the KMS at url `endpoint` using the provided client configuration.
NewRestAPIClientWithHttp is a lower level constructor to create and initialize a new HTTP connection to the KMS at url `endpoint` using the provided [http.Client].
WithContextHeader adds some custom headers to the request's context.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
ClientConfig is used to configure Rest clients created using NewRestAPIClient().
DataKeyProvider is a helper provider that wraps an API client and provides helpers functions to repeatedly generate or decrypt datakeys protected by the same service key.
KeyIter is an iterator for service keys.
No description provided by the author
No description provided by the author

# Interfaces

API is the interface abstracting the KMS clients methods.
DataKeyApi is the client interface used to create and retrieve KMS data keys using a remote symmetric key.
EncryptionApi is the client interface used to encrypt and decrypt data using a remote symmetric key.
ServiceKeyApi is the client interface used to query and manipulate the remote service keys lifecycle.
SignatureApi is the client interface used to sign data and verify signatures using a remote asymmetric key-pair.

# Type aliases

BlockSize enumerates recommended size of blocks for streaming encryption.
No description provided by the author
No description provided by the author
InternalHttpClient is the low level, internal http client generated by oapi-codegen.
LeveledLogger represents loggers that can be used inside the client.
No description provided by the author
No description provided by the author