testsupport

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 37 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// AnyPubKeyID indicated that proof checker should ignore pub key id when looking for verification method.
	AnyPubKeyID = "anyID"
)

Variables

This section is empty.

Functions

func NewEd25519Pair

func NewEd25519Pair(pubKey ed25519.PublicKey, privKey ed25519.PrivateKey,
	publicKeyID string) (*creator.ProofCreator, *checker.ProofChecker)

NewEd25519Pair returns a pair of proof creator and checker.

func NewEd25519Pairs

func NewEd25519Pairs(sigKeys []Ed25519SignKey) (
	[]*creator.ProofCreator, *checker.ProofChecker)

NewEd25519Pairs returns a pair of proof creator and checker.

func NewEd25519Verifier

func NewEd25519Verifier(pubKey ed25519.PublicKey) *checker.EmbeddedVMProofChecker

NewEd25519Verifier returns ed25519 verifier.

func NewKMSSigVerPair

func NewKMSSigVerPair(t *testing.T, keyType kmsapi.KeyType, verificationKeyID string) (
	*creator.ProofCreator, *checker.ProofChecker)

NewKMSSigVerPair returns a pair of proof creator and checker.

func NewKMSSignersAndVerifier

func NewKMSSignersAndVerifier(t *testing.T, signingKeys []SigningKey) (
	[]*creator.ProofCreator, *checker.ProofChecker)

NewKMSSignersAndVerifier returns a pair of proof creator and checker.

func NewKMSSignersAndVerifierErr

func NewKMSSignersAndVerifierErr(signingKeys []SigningKey) (
	[]*creator.ProofCreator, *checker.ProofChecker, error)

NewKMSSignersAndVerifierErr returns a pair of proof creator and checker.

func NewProofCreator

func NewProofCreator(signer cryptographicSigner) *creator.ProofCreator

NewProofCreator creates new proof creator with all supported proof types.

func NewRS256Verifier

func NewRS256Verifier(pubKey *rsa.PublicKey) *checker.EmbeddedVMProofChecker

NewRS256Verifier returns rsa rs verifier.

func NewRSA256Pair

func NewRSA256Pair(privKey *rsa.PrivateKey, publicKeyID string) (*creator.ProofCreator, *checker.ProofChecker)

NewRSA256Pair returns a pair of proof creator and checker.

Types

type Ed25519SignKey

type Ed25519SignKey struct {
	PubKey      ed25519.PublicKey
	PrivKey     ed25519.PrivateKey
	PublicKeyID string
}

Ed25519SignKey describe ed25519 sig verify key.

type SigningKey

type SigningKey struct {
	Type        kmsapi.KeyType
	PublicKeyID string
	VMType      string
}

SigningKey server key for creating proof creator and proof checker.

type VMResolver

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

VMResolver mock verification method resolver.

func NewSingleJWKResolver

func NewSingleJWKResolver(lookupID string, j *jwk.JWK, keyType string, expectedProofIssuer string) *VMResolver

NewSingleJWKResolver creates vm resolver with single jwk embedded.

func NewSingleKeyResolver

func NewSingleKeyResolver(lookupID string, keyBytes []byte, keyType string, expectedProofIssuer string) *VMResolver

NewSingleKeyResolver creates vm resolver with single key embedded.

func (*VMResolver) ResolveVerificationMethod

func (r *VMResolver) ResolveVerificationMethod(
	verificationMethod string,
	expectedKeyController string,
) (*vermethod.VerificationMethod, error)

ResolveVerificationMethod resolves verification method.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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