verifiable

package
v1.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: Apache-2.0 Imports: 4 Imported by: 7

Documentation

Index

Constants

View Source
const (
	JwtVCJsonLD = OIDCFormat("jwt_vc_json-ld")
	JwtVCJson   = OIDCFormat("jwt_vc_json")
	LdpVC       = OIDCFormat("ldp_vc")
)

Variables

View Source
var SDJWTSignatureTypes = []string{
	EdDSA.Name(),
	ES256K.Name(),
	ES256.Name(),
	ES384.Name(),
	PS256.Name(),
}

SDJWTSignatureTypes stores the list of SD-JWT supported SignatureType by VCS nolint: gochecknoglobals

Functions

func ValidateFormat

func ValidateFormat(data interface{}, formats []Format) ([]byte, error)

func ValidateSignatureKeyType

func ValidateSignatureKeyType(signatureType SignatureType, keyType string) (kms.KeyType, error)

Types

type Format

type Format string
const (
	Jwt Format = "jwt"
	Ldp Format = "ldp"
)

type OIDCFormat

type OIDCFormat string

type SignatureType

type SignatureType string

SignatureType type of signature used to sign vc.

const (
	EdDSA  SignatureType = "EdDSA"
	ES256K SignatureType = "ES256K"
	ES256  SignatureType = "ES256"
	ES384  SignatureType = "ES384"
	PS256  SignatureType = "PS256"

	Ed25519Signature2018        SignatureType = "Ed25519Signature2018"
	Ed25519Signature2020        SignatureType = "Ed25519Signature2020"
	EcdsaSecp256k1Signature2019 SignatureType = "EcdsaSecp256k1Signature2019"
	BbsBlsSignature2020         SignatureType = "BbsBlsSignature2020"
	JSONWebSignature2020        SignatureType = "JsonWebSignature2020"
)

func GetJWTSignatureTypeByKey

func GetJWTSignatureTypeByKey(keyType kms.KeyType) (SignatureType, error)

func GetSignatureTypeByName

func GetSignatureTypeByName(signatureType string) (SignatureType, error)

func SignatureTypesSupportedKeyType

func SignatureTypesSupportedKeyType(keyType kms.KeyType) []SignatureType

func ValidateSignatureAlgorithm

func ValidateSignatureAlgorithm(format Format, signatureType string, kmsKeyTypes []kms.KeyType) (SignatureType, error)

func (SignatureType) Name

func (st SignatureType) Name() string

Name of signature type.

Jump to

Keyboard shortcuts

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