verifiable

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 5 Imported by: 7

Documentation

Index

Constants

This section is empty.

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"
)

For mapping between Format and OIDCFormat see oidc4ci.SelectProperOIDCFormat.

type OIDCFormat

type OIDCFormat string
const (
	JwtVCJsonLD OIDCFormat = "jwt_vc_json-ld"
	JwtVCJson   OIDCFormat = "jwt_vc_json"
	LdpVC       OIDCFormat = "ldp_vc"
)

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 GetSignatureTypeByName

func GetSignatureTypeByName(signatureType string) (SignatureType, error)

func GetSignatureTypesByKeyTypeFormat added in v1.1.0

func GetSignatureTypesByKeyTypeFormat(keyType kms.KeyType, vcFormat Format) []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