stubkeymanager

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

Documentation

Overview

Package stubkeymanager defines key managers for testing primitives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StubDerivableKeyManager

type StubDerivableKeyManager struct {
	StubKeyManager
	KeyMatType tinkpb.KeyData_KeyMaterialType
	DerKey     proto.Message
	DerErr     error
}

StubDerivableKeyManager is a derivable key manager for testing.

func (*StubDerivableKeyManager) DeriveKey

func (dkm *StubDerivableKeyManager) DeriveKey(serializedKeyFormat []byte, pseudorandomness io.Reader) (proto.Message, error)

DeriveKey returns the stub derived key and error.

func (*StubDerivableKeyManager) KeyMaterialType

KeyMaterialType returns the stub key material type.

type StubKeyManager

type StubKeyManager struct {
	URL     string
	Prim    any
	Key     proto.Message
	KeyData *tinkpb.KeyData
}

StubKeyManager is a key manager for testing.

func (*StubKeyManager) DoesSupport

func (km *StubKeyManager) DoesSupport(typeURL string) bool

DoesSupport returns true if this KeyManager supports key type identified by typeURL.

func (*StubKeyManager) NewKey

func (km *StubKeyManager) NewKey(serializedKeyFormat []byte) (proto.Message, error)

NewKey returns the stub Key.

func (*StubKeyManager) NewKeyData

func (km *StubKeyManager) NewKeyData(serializedKeyFormat []byte) (*tinkpb.KeyData, error)

NewKeyData returns the stub KeyData.

func (*StubKeyManager) Primitive

func (km *StubKeyManager) Primitive(serializedKey []byte) (any, error)

Primitive returns the stub primitive.

func (*StubKeyManager) TypeURL

func (km *StubKeyManager) TypeURL() string

TypeURL returns the stub type url.

type StubPrivateKeyManager

type StubPrivateKeyManager struct {
	StubKeyManager
	PubKeyData *tinkpb.KeyData
}

StubPrivateKeyManager is a private key manager for testing.

func (*StubPrivateKeyManager) PublicKeyData

func (skm *StubPrivateKeyManager) PublicKeyData(serializedKey []byte) (*tinkpb.KeyData, error)

PublicKeyData returns the stub public key data.

Jump to

Keyboard shortcuts

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