aws

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package aws provides functions for key and signer generation in AWS KMS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(cfg *configs.Config, ctx context.Context, keyIndex, weight int) (*flow.AccountKey, *keys.Private, error)

Generates an asymmetric signing & verification key (ECC_SECG_P256K1 / ECDSA_SHA_256) in AWS KMS and returns data required for account creation; a flow.AccountKey and a private key. The private key has the KMS key ARN as the value.

func Signer

func Signer(ctx context.Context, key keys.Private) (crypto.Signer, error)

Signer creates a crypto.Signer for the given private key (AWS KMS key ARN)

Types

type AWSKMSCrypter

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

func NewAWSKMSCrypter

func NewAWSKMSCrypter(key []byte) *AWSKMSCrypter

func (*AWSKMSCrypter) Decrypt

func (c *AWSKMSCrypter) Decrypt(encrypted []byte) (message []byte, err error)

func (*AWSKMSCrypter) Encrypt

func (c *AWSKMSCrypter) Encrypt(message []byte) (encrypted []byte, err error)

type AWSSigner

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

Signer is a Google Cloud KMS implementation of crypto.Signer.

func SignerForKey

func SignerForKey(
	ctx context.Context,
	key keys.Private,
) (*AWSSigner, error)

SignerForKey returns a new AWSSigner for the given private key

func (*AWSSigner) PublicKey added in v0.11.0

func (s *AWSSigner) PublicKey() crypto.PublicKey

func (*AWSSigner) Sign

func (s *AWSSigner) Sign(message []byte) ([]byte, error)

Sign signs the given message using the KMS signing key for this signer.

Reference: https://docs.aws.amazon.com/kms/latest/APIReference/API_Sign.html

Jump to

Keyboard shortcuts

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