package interfaces

import "github.com/theupdateframework/notary/tuf/testutils/interfaces"

Index

Functions

func AddGetKeyCryptoServiceInterfaceBehaviorTests

func AddGetKeyCryptoServiceInterfaceBehaviorTests(t *testing.T, cs signed.CryptoService, algo string)

AddGetKeyCryptoServiceInterfaceBehaviorTests tests expected behavior for adding keys in a signed.CryptoService and other read operations on the crypto service after keys are present 1. Adding a key succeeds 2. Getting the key should return the same key, without error 3. Removing the key succeeds

func AddListKeyCryptoServiceInterfaceBehaviorTests

func AddListKeyCryptoServiceInterfaceBehaviorTests(t *testing.T, cs signed.CryptoService, algo string)

AddListKeyCryptoServiceInterfaceBehaviorTests tests expected behavior for adding keys in a signed.CryptoService and other read operations on the crypto service after keys are present 1. Adding a key succeeds 2. Listing returns the correct number of keys and right roles

func CreateGetKeyCryptoServiceInterfaceBehaviorTests

func CreateGetKeyCryptoServiceInterfaceBehaviorTests(t *testing.T, cs signed.CryptoService, algo string,
	checkRole bool)

CreateGetKeyCryptoServiceInterfaceBehaviorTests tests expected behavior for creating keys in a signed.CryptoService and other read operations on the crypto service after keys are present 1. Creating a key succeeds and returns a non-nil public key 2. Getting the key should return the same key, without error 3. Removing the key succeeds

func CreateListKeyCryptoServiceInterfaceBehaviorTests

func CreateListKeyCryptoServiceInterfaceBehaviorTests(t *testing.T, cs signed.CryptoService, algo string)

CreateListKeyCryptoServiceInterfaceBehaviorTests tests expected behavior for creating keys in a signed.CryptoService and other read operations on the crypto service after keys are present 1. Creating a key succeeds and returns a non-nil public key 2. Listing returns the correct number of keys and right roles We allow skipping some tests because for now, signer does not support role checking or listing keys.

func EmptyCryptoServiceInterfaceBehaviorTests

func EmptyCryptoServiceInterfaceBehaviorTests(t *testing.T, empty signed.CryptoService)

EmptyCryptoServiceInterfaceBehaviorTests tests expected behavior for an empty signed.CryptoService: 1. Getting the public key of a key that doesn't exist should fail 2. Listing an empty cryptoservice returns no keys 3. Removing a non-existent key succeeds (no-op)

Source Files

cryptoservice.go

Version
v0.3.0
Published
May 10, 2016
Platform
js/wasm
Imports
6 packages
Last checked
1 day ago

Tools for package owners.