Documentation ¶
Index ¶
- type CheckCWTProofRequest
- type EmbeddedVMProofChecker
- type Opt
- func WithCWTAlg(proofDescs ...proofdesc.JWTProofDescriptor) Opt
- func WithJWTAlg(proofDescs ...proofdesc.JWTProofDescriptor) Opt
- func WithLDProofTypeEx(proofDesc proofdesc.LDProofDescriptor, ...) Opt
- func WithLDProofTypes(proofDescs ...proofdesc.LDProofDescriptor) Opt
- func WithSignatureVerifiers(verifiers ...signatureVerifier) Opt
- type ProofChecker
- func (c *ProofChecker) CheckCWTProof(checkCWTRequest CheckCWTProofRequest, expectedProofIssuer string, msg []byte, ...) error
- func (c *ProofChecker) CheckJWTProof(headers jose.Headers, expectedProofIssuer string, msg, signature []byte) error
- func (c *ProofChecker) CheckLDProof(proof *proof.Proof, expectedProofIssuer string, msg, signature []byte) error
- func (c *ProofChecker) FindIssuer(payload []byte) string
- type ProofCheckerBase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CheckCWTProofRequest ¶
type CheckCWTProofRequest struct { KeyID string KeyMaterial string // hex encoded key material 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 ¶
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 ¶
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 ¶
GetLDPDigest returns document digest.