checker

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: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckCWTProofRequest added in v1.1.1

type CheckCWTProofRequest struct {
	KeyID string
	Algo  cose.Algorithm
}

CheckCWTProofRequest is the request for checking a CWT proof.

type EmbeddedVMProofChecker

type EmbeddedVMProofChecker struct {
	ProofCheckerBase
	// contains filtered or unexported fields
}

EmbeddedVMProofChecker is a proof checker with embedded verification method.

func NewEmbeddedJWKProofChecker

func NewEmbeddedJWKProofChecker(jwk *jwk.JWK, opts ...Opt) *EmbeddedVMProofChecker

NewEmbeddedJWKProofChecker return new EmbeddedVMProofChecker with embedded jwk.

func NewEmbeddedVMProofChecker

func NewEmbeddedVMProofChecker(vm *vermethod.VerificationMethod, opts ...Opt) *EmbeddedVMProofChecker

NewEmbeddedVMProofChecker return new EmbeddedVMProofChecker.

func (*EmbeddedVMProofChecker) CheckJWTProof

func (c *EmbeddedVMProofChecker) CheckJWTProof(headers jose.Headers, _ string, msg, signature []byte) error

CheckJWTProof check jwt proof.

type Opt

type Opt func(c *ProofCheckerBase)

Opt represent checker creation options.

func WithCWTAlg added in v1.1.1

func WithCWTAlg(proofDescs ...proofdesc.JWTProofDescriptor) Opt

WithCWTAlg option to set supported jwt algs.

func WithJWTAlg

func WithJWTAlg(proofDescs ...proofdesc.JWTProofDescriptor) Opt

WithJWTAlg option to set supported jwt algs.

func WithLDProofTypeEx

func WithLDProofTypeEx(proofDesc proofdesc.LDProofDescriptor, proofSignatureVerifier signatureVerifierEx) Opt

WithLDProofTypeEx option to set supported ld proofs.

func WithLDProofTypes

func WithLDProofTypes(proofDescs ...proofdesc.LDProofDescriptor) Opt

WithLDProofTypes option to set supported ld proofs.

func WithSignatureVerifiers

func WithSignatureVerifiers(verifiers ...signatureVerifier) Opt

WithSignatureVerifiers option to set signature verifiers.

type ProofChecker

type ProofChecker struct {
	ProofCheckerBase
	// contains filtered or unexported fields
}

ProofChecker checks proofs of jd and jwt documents.

func New

func New(verificationMethodResolver verificationMethodResolver, opts ...Opt) *ProofChecker

New creates new proof checker.

func (*ProofChecker) CheckCWTProof added in v1.1.1

func (c *ProofChecker) CheckCWTProof(
	checkCWTRequest CheckCWTProofRequest,
	expectedProofIssuer string,
	msg []byte,
	signature []byte,
) error

CheckCWTProof check cwt proof.

func (*ProofChecker) CheckJWTProof

func (c *ProofChecker) CheckJWTProof(headers jose.Headers, expectedProofIssuer string, msg, signature []byte) error

CheckJWTProof check jwt proof.

func (*ProofChecker) CheckLDProof

func (c *ProofChecker) CheckLDProof(proof *proof.Proof, expectedProofIssuer string, msg, signature []byte) error

CheckLDProof check ld proof.

func (*ProofChecker) FindIssuer

func (c *ProofChecker) FindIssuer(payload []byte) string

FindIssuer finds issuer in payload.

type ProofCheckerBase

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

ProofCheckerBase basic implementation of proof checker.

func (*ProofCheckerBase) GetLDPCanonicalDocument

func (c *ProofCheckerBase) GetLDPCanonicalDocument(proof *proof.Proof,
	doc map[string]interface{}, opts ...processor.Opts) ([]byte, error)

GetLDPCanonicalDocument will return normalized/canonical version of the document.

func (*ProofCheckerBase) GetLDPDigest

func (c *ProofCheckerBase) GetLDPDigest(proof *proof.Proof, doc []byte) ([]byte, error)

GetLDPDigest returns document digest.

Jump to

Keyboard shortcuts

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