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)

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 listing keys 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

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.6.0
Published
Feb 28, 2018
Platform
linux/amd64
Imports
7 packages
Last checked
26 minutes ago

Tools for package owners.