awskms

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package awskms implements Iceberg key wrapping with AWS Key Management Service. Import this package to register the "aws" KMS provider. The provider uses the AWS SDK credential chain and accepts client.region and kms.endpoint when loaded by the registry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps data keys with a symmetric AWS KMS key. Key IDs may be key IDs, key ARNs, alias names, or alias ARNs accepted by AWS KMS. A Client is safe for concurrent use.

func NewClient

func NewClient(cfg aws.Config, optFns ...func(*kms.Options)) *Client

NewClient constructs a KMS client using cfg's credentials, region, and transport. Options can configure service-specific settings such as a custom endpoint.

func (*Client) GenerateKey

func (c *Client) GenerateKey(ctx context.Context, keyID string, length int) (plaintext, wrapped []byte, err error)

GenerateKey creates a data key of length bytes. AWS KMS accepts 1 to 1024 bytes.

func (*Client) SupportsKeyGeneration

func (*Client) SupportsKeyGeneration() bool

SupportsKeyGeneration reports that KMS can generate and wrap data keys.

func (*Client) UnwrapKey

func (c *Client) UnwrapKey(ctx context.Context, keyID string, wrappedKey []byte) ([]byte, error)

UnwrapKey decrypts wrappedKey and requires it to have been encrypted by keyID.

func (*Client) WrapKey

func (c *Client) WrapKey(ctx context.Context, keyID string, plaintextKey []byte) ([]byte, error)

WrapKey encrypts plaintextKey with keyID using KMS SYMMETRIC_DEFAULT.

Jump to

Keyboard shortcuts

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