awssigner

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package awssigner contains a new signer that uses aws-kms as an hsm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKmsSigner

func NewKmsSigner(ctx context.Context, awsRegion, awsAccessKey, awsSecretAccessKey, keyID string) (_ signer.Signer, err error)

NewKmsSigner creates a kms handler.

Types

type PubKeyData

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

PubKeyData is the public key data.

type Signer

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

Signer is an aws signer.

func (*Signer) Address

func (signingHandler *Signer) Address() common.Address

Address gets the address of the signing group.

func (*Signer) Equals added in v0.2.0

func (signingHandler *Signer) Equals(o libp2p.Key) bool

Equals assumes we're using *libp2p.Secp256k1PublicKey type for o.

func (*Signer) GetPublic added in v0.2.0

func (signingHandler *Signer) GetPublic() libp2p.PubKey

GetPublic gets the libp2p public key.

func (*Signer) GetTransactor

func (signingHandler *Signer) GetTransactor(ctx context.Context, chainID *big.Int) (*bind.TransactOpts, error)

GetTransactor creates a kms transactor.

func (*Signer) PrivKey added in v0.2.0

func (signingHandler *Signer) PrivKey() libp2p.PrivKey

PrivKey returns the private key bytes.

func (*Signer) Raw added in v0.2.0

func (signingHandler *Signer) Raw() ([]byte, error)

Raw returns the raw bytes of the public key.

func (*Signer) Sign added in v0.2.0

func (signingHandler *Signer) Sign(bytes []byte) ([]byte, error)

Sign signs the bytes.

func (*Signer) SignMessage

func (signingHandler *Signer) SignMessage(ctx context.Context, message []byte, hash bool) (signer.Signature, error)

SignMessage signs a hashed message.

func (*Signer) Type added in v0.2.0

func (signingHandler *Signer) Type() pb.KeyType

Type returns the key type.

func (*Signer) UnsafeMakePublicKeyData added in v0.2.0

func (signingHandler *Signer) UnsafeMakePublicKeyData(ctx context.Context) (*PubKeyData, error)

UnsafeMakePublicKeyData creates the public key data.

func (*Signer) UnsafeSetKeyID added in v0.2.0

func (signingHandler *Signer) UnsafeSetKeyID(keyID string)

UnsafeSetKeyID sets the key id.

func (*Signer) UnsafeSetPubKeyData added in v0.2.0

func (signingHandler *Signer) UnsafeSetPubKeyData(pubKeyData *PubKeyData)

UnsafeSetPubKeyData sets the public key data.

type UnsafeSigner added in v0.2.0

type UnsafeSigner interface {
	signer.Signer
	// UnsafeSetKeyID sets the key id.
	UnsafeSetKeyID(keyID string)
	// UnsafeSetPubKeyData sets the public key data.
	UnsafeSetPubKeyData(pubKeyData *PubKeyData)
	// UnsafeMakePublicKeyData creates the public key data.
	UnsafeMakePublicKeyData(ctx context.Context) (*PubKeyData, error)
}

UnsafeSigner is an unsafe signer.

func MakeUnsafeSigner added in v0.2.0

func MakeUnsafeSigner(client *kms.Client) UnsafeSigner

MakeUnsafeSigner creates a new unsafe signer.

/ this is only to be used for testing. It should not be used in production code under any circumstances.

Directories

Path Synopsis
Package kmsmock sets up a mock kms server that is used for testing our kms driver TODO: we should consider moving this to a common testutils/mocking folder or something internal to avoid exporting
Package kmsmock sets up a mock kms server that is used for testing our kms driver TODO: we should consider moving this to a common testutils/mocking folder or something internal to avoid exporting
internal
Package internal contains modules exported from local-kms in order to avoid rewriting code
Package internal contains modules exported from local-kms in order to avoid rewriting code

Jump to

Keyboard shortcuts

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