cwt

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckProof

func CheckProof(
	message *cose.Sign1Message,
	proofChecker ProofChecker,
	expectedProofIssuer *string,
	msg []byte,
	signature []byte,
) error

CheckProof checks that jwt have correct signature.

func Parse

func Parse(cwtSerialized []byte) (*cose.Sign1Message, error)

Parse parses input CWT in serialized form into JSON Web Token.

func ParseAndCheckProof

func ParseAndCheckProof(
	cwtSerialized []byte,
	proofChecker ProofChecker,
	checkIssuer bool,
) (*cose.Sign1Message, []byte, error)

ParseAndCheckProof parses input JWT in serialized form into JSON Web Token and check signature proof. if checkIssuer set to true, will check if issuer set by "iss" own key set by "kid" header.

Types

type ProofChecker

type ProofChecker interface {
	CheckCWTProof(
		checkCWTRequest checker.CheckCWTProofRequest,
		expectedProofIssuer string,
		msg []byte,
		signature []byte,
	) error
}

ProofChecker used to check proof of jwt vc.

type SignParameters

type SignParameters struct {
	KeyID  string
	CWTAlg cose.Algorithm
}

SignParameters contains parameters of signing for cwt vc.

type Verifier

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

Verifier verifies CWT proof.

func (*Verifier) Verify

func (v *Verifier) Verify(
	keyID string,
	algo cose.Algorithm,
	msg []byte,
	sign []byte,
) error

Verify verifies CWT proof.

Jump to

Keyboard shortcuts

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