signing

package
v0.0.0-...-920a7e7 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VCJWTProperty string = "vc"
	VPJWTProperty string = "vp"
	NonceProperty string = "nonce"
)
View Source
const (
	VCMediaType = "application/credential+ld+json"
)

Variables

This section is empty.

Functions

func ParseVerifiableCredentialFromJWS

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

ParseVerifiableCredentialFromJWS parses a JWS. Depending on the `cty` header value, it parses as a JWT or simply decodes the payload. This is currently an experimental. It's unstable and subject to change. Use at your own peril.

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 SignVerifiableCredentialJWS

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

SignVerifiableCredentialJWS is prepared according to https://transmute-industries.github.io/vc-jws/. This is currently an experimental. It's unstable and subject to change. Use at your own peril.

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/authnull0/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 VerifyVerifiableCredentialJWS

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

VerifyVerifiableCredentialJWS verifies the signature validity on the token and parses the token in a verifiable credential. This is currently an experimental. It's unstable and subject to change. Use at your own peril.

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