google

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: 18 Imported by: 0

Documentation

Overview

Package google provides functions for key and signer generation in Google KMS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsymKey

func AsymKey(ctx context.Context, parent, id string) (*cloudkms.Key, error)

AsymKey creates a new asymmetric signing key in Google KMS and returns a cloudkms.Key (the "raw" result isn't needed)

func Generate

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

Generate creates a new asymmetric signing & verification key in Google KMS and returns the required data to use the key with the Flow blockchain

func Signer

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

Signer creates a crypto.Signer for the given private key (KMS key resource name)

Types

type GoogleKMSCrypter added in v0.8.0

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

func NewGoogleKMSCrypter added in v0.8.0

func NewGoogleKMSCrypter(key []byte) *GoogleKMSCrypter

NewGoogleKMSCrypter creates a new GoogleKMSCrypter with the specified key (KMS key resource name)

func (*GoogleKMSCrypter) Decrypt added in v0.8.0

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

Decrypt decryptes the given encrypted data with the symmetric encryption key specified in the crypter

func (*GoogleKMSCrypter) Encrypt added in v0.8.0

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

Encrypt encrypts the given data with the symmetric encryption key specified in the crypter

Jump to

Keyboard shortcuts

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