internalregistry

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package internalregistry provides a container for functionality that is required across Tink similar to the `registry` but isn't part of the public API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowKeyDerivation

func AllowKeyDerivation(typeURL string) error

AllowKeyDerivation adds the type URL to derivableKeyManagers if the corresponding key manager is in the registry and implements key derivation.

func CanDeriveKeys

func CanDeriveKeys(typeURL string) bool

CanDeriveKeys returns true if typeURL is in derivableKeyManagers.

func ClearMonitoringClient

func ClearMonitoringClient()

ClearMonitoringClient removes the registered monitoring client.

func DeriveKey

func DeriveKey(keyTemplate *tinkpb.KeyTemplate, pseudorandomness io.Reader) (*tinkpb.KeyData, error)

DeriveKey derives a new key from template and pseudorandomness.

func GetMonitoringClient

func GetMonitoringClient() monitoring.Client

GetMonitoringClient returns the registered monitoring client.

func RegisterMonitoringClient

func RegisterMonitoringClient(client monitoring.Client) error

RegisterMonitoringClient registers a client that can create loggers.

Types

type DerivableKeyManager

type DerivableKeyManager interface {
	registry.KeyManager

	// KeyMaterialType returns the key material type of the key manager.
	KeyMaterialType() tinkpb.KeyData_KeyMaterialType

	// DeriveKey derives a new key from serializedKeyFormat and pseudorandomness.
	//
	// Note: The given parameter pseudorandomness may only produce a finite amount
	// of randomness. Implementions must obtain the pseudorandom bytes needed
	// before producing the key.
	DeriveKey(serializedKeyFormat []byte, pseudorandomness io.Reader) (proto.Message, error)
}

DerivableKeyManager is a special type of KeyManager that can derive new keys.

Jump to

Keyboard shortcuts

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