signing

package
v0.0.2-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VCJWTProperty string = "vc"
	VPJWTProperty string = "vp"
	NonceProperty string = "nonce"
)

Variables

This section is empty.

Functions

func ParseVerifiableCredentialFromJWT

func ParseVerifiableCredentialFromJWT(token string) (*credential.VerifiableCredential, error)

ParseVerifiableCredentialFromJWT the JWT is decoded according to the specification. https://www.w3.org/TR/vc-data-model/#jwt-decoding If there are any issues during decoding, an error is returned. As a result, a successfully decoded VerifiableCredential object is returned.

func ParseVerifiablePresentationFromJWT

func ParseVerifiablePresentationFromJWT(token string) (*credential.VerifiablePresentation, error)

ParseVerifiablePresentationFromJWT the JWT is decoded according to the specification. https://www.w3.org/TR/vc-data-model/#jwt-decoding If there are any issues during decoding, an error is returned. As a result, a successfully decoded VerifiablePresentation object is returned.

func SignVerifiableCredentialJWT

func SignVerifiableCredentialJWT(signer crypto.JWTSigner, cred credential.VerifiableCredential) ([]byte, error)

SignVerifiableCredentialJWT is prepared according to https://www.w3.org/TR/vc-data-model/#jwt-encoding which will soon be deprecated by https://w3c.github.io/vc-jwt/ see: https://github.com/TBD54566975/ssi-sdk/issues/191

func SignVerifiablePresentationJWT

func SignVerifiablePresentationJWT(signer crypto.JWTSigner, pres credential.VerifiablePresentation) ([]byte, error)

SignVerifiablePresentationJWT is prepared according to https://www.w3.org/TR/vc-data-model/#jwt-encoding

func VerifyVerifiableCredentialJWT

func VerifyVerifiableCredentialJWT(verifier crypto.JWTVerifier, token string) (*credential.VerifiableCredential, error)

VerifyVerifiableCredentialJWT verifies the signature validity on the token and parses the token in a verifiable credential.

func VerifyVerifiablePresentationJWT

func VerifyVerifiablePresentationJWT(verifier crypto.JWTVerifier, token string) (*credential.VerifiablePresentation, error)

VerifyVerifiablePresentationJWT verifies the signature validity on the token. After signature validation, the JWT is decoded according to the specification. https://www.w3.org/TR/vc-data-model/#jwt-decoding If there are any issues during decoding, an error is returned. As a result, a successfully decoded VerifiablePresentation object is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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