signer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KMSSigner

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

KMSSigner implements the crypto/Signer interface that can be used for signing operations using an AWS KMS key. see https://golang.org/pkg/crypto/#Signer

func New

func New(client kmsiface.KMSAPI, keyID string) (*KMSSigner, error)

New returns a KMSSigner instance given and AWS client and a KMS key used for signing. TODO: explain what are the pre-requisits for the KMS key. TODO: implement PublicKey caching with periodical refresh

func (*KMSSigner) Public

func (s *KMSSigner) Public() crypto.PublicKey

Public returns the public key corresponding to the opaque, private key.

func (*KMSSigner) Sign

func (s *KMSSigner) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error)

Sign signs digest with the KMS key. TODO: currently use SigningAlgorithmSpecRsassaPkcs1V15Sha256. Is that ok? TODO: should use the opts provided.

Jump to

Keyboard shortcuts

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