gcp

package
v0.2.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ReferenceScheme = "gcpkms://"

schemes for various KMS services are copied from https://github.com/google/go-cloud/tree/master/secrets

Variables

View Source
var (
	ErrKMSReference = errors.New("kms specification should be in the format gcpkms://projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEY_RING]/cryptoKeys/[KEY]")
)

Functions

func ValidReference

func ValidReference(ref string) error

Types

type KMS

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

func NewGCP

func NewGCP(ctx context.Context, keyResourceID string) (*KMS, error)

func (*KMS) CreateKey

func (g *KMS) CreateKey(ctx context.Context) (*ecdsa.PublicKey, error)

func (*KMS) ECDSAPublicKey

func (g *KMS) ECDSAPublicKey(ctx context.Context) (*ecdsa.PublicKey, error)

func (*KMS) PublicKey

func (g *KMS) PublicKey(ctx context.Context) (crypto.PublicKey, error)

func (*KMS) Sign

func (g *KMS) Sign(ctx context.Context, payload []byte) (signature []byte, err error)

func (*KMS) Verify

func (g *KMS) Verify(ctx context.Context, payload, signature []byte) error

Jump to

Keyboard shortcuts

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