awssigner

package
v3.84.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidKeyAlgorithm = fmt.Errorf("invalid key algorithm")
	ErrInvalidKeyID        = fmt.Errorf("invalid key ID")
)

Functions

This section is empty.

Types

type KMS

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

KMS is a crypto.Signer that uses an AWS KMS key for signing.

func NewKMS

func NewKMS(client *kms.Client, kmsKeyID string) (*KMS, error)

The key ID is the unique identifier of the KMS key or key alias.

func (*KMS) Algorithm

func (sv *KMS) Algorithm() jwa.KeyAlgorithm

Algorithm returns the equivalent of the KMS key's signing algorithm as a JWA key algorithm.

func (*KMS) GetPublicKey

func (sv *KMS) GetPublicKey() (crypto.PublicKey, error)

GetPublicKey is an escape hatch for those cases where the user needs to debug what went wrong during the GetPublicKey operation.

func (*KMS) Public

func (sv *KMS) Public() crypto.PublicKey

Public returns the corresponding public key.

NOTE: Because the crypto.Signer API does not allow for an error to be returned, the return value from this function cannot describe what kind of error occurred.

func (*KMS) Sign

func (sv *KMS) Sign(_ io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error)

Sign generates a signature from the given digest.

Jump to

Keyboard shortcuts

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