issuance

package
v0.0.0-...-f93f300 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claim

type Claim struct {
	Mandatory *bool
	ValueType *string

	Display       map[language.Tag]Display
	OtherDisplays []Display
}

func (Claim) MarshalJSON

func (c Claim) MarshalJSON() ([]byte, error)

func (*Claim) UnmarshalJSON

func (c *Claim) UnmarshalJSON(data []byte) error

type CredentialDisplay

type CredentialDisplay struct {
	Display

	Description     *string `json:"description,omitempty"`
	BackgroundColor *string `json:"background_color,omitempty"`
	TextColor       *string `json:"text_color,omitempty"`
}

type CredentialSupported

type CredentialSupported struct {
	Format Format `json:"format" validate:"required"`

	ID *string `json:"id,omitempty"`

	CryptographicBindingMethodsSupported []CryptographicBindingMethodSupported `json:"cryptographic_binding_methods_supported,omitempty"`

	CryptographicSuitesSupported []string `json:"cryptographic_suites_supported,omitempty"`

	Display []CredentialDisplay `json:"display,omitempty"`

	// Present when format == jwt_vc_json
	*JWTVCJSONCredentialMetadata
}

func (CredentialSupported) BindingDIDMethods

func (s CredentialSupported) BindingDIDMethods() []did.Method

BindingDIDMethods returns a list of all the did methods supported from the list of CryptographicBindingMethodsSupported.

type CryptographicBindingMethodSupported

type CryptographicBindingMethodSupported string
const (
	JWKFormat CryptographicBindingMethodSupported = "jwk"
	COSEKey   CryptographicBindingMethodSupported = "cose_key"

	// AllDIDMethods is the value used to indicates support for all DID methods in the DID registry.
	AllDIDMethods CryptographicBindingMethodSupported = "did"
)

The possible values coming from https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html#section-10.2.3.1-2.3.1

func (CryptographicBindingMethodSupported) DIDBinding

func (s CryptographicBindingMethodSupported) DIDBinding() (method did.Method, isDIDBinding bool)

DIDBinding returns the did.Method for this binding, and whether this is actually a DID binding method.

type Display

type Display struct {
	Name *string `json:"name,omitempty"`

	Locale *language.Tag `json:"locale,omitempty"`
}

type Format

type Format string
const (
	JWTVCJSON   Format = "jwt_vc_json"
	JWTVCJSONLD Format = "jwt_vc_json-ld"
	LDPVC       Format = "ldp_vc"
)

type IssuerMetadata

type IssuerMetadata struct {
	CredentialIssuer util.URL `json:"credential_issuer" validate:"required"`

	// Points to a URL that resolves to authorization server metdata as defined in
	// https://www.rfc-editor.org/rfc/rfc8414.html#section-2
	AuthorizationServer *util.URL `json:"authorization_server,omitempty"`

	// Must use the `https` scheme.
	CredentialEndpoint util.URL `json:"credential_endpoint" validate:"required"`

	// Must use the `https` scheme.
	BatchCredentialEndpoint *util.URL `json:"batch_credential_endpoint,omitempty"`

	// Credentials supported indexes by the ID field.
	CredentialsSupported map[string]CredentialSupported

	// Credentials supported that did not have an ID field.
	OtherCredentialsSupported []CredentialSupported

	Display []Display `json:"display,omitempty"`
}

https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html#name-credential-issuer-metadata-p

func (IssuerMetadata) IsValid

func (m IssuerMetadata) IsValid() error

func (IssuerMetadata) MarshalJSON

func (m IssuerMetadata) MarshalJSON() ([]byte, error)

func (*IssuerMetadata) UnmarshalJSON

func (m *IssuerMetadata) UnmarshalJSON(data []byte) error

type JWTVCJSONCredentialMetadata

type JWTVCJSONCredentialMetadata struct {
	Types             []string         `json:"types" validate:"required"`
	CredentialSubject map[string]Claim `json:"credentialSubject,omitempty"`
	Order             []string         `json:"order,omitempty"`
}
type Logo struct {
	URL     *util.URL `json:"url,omitempty"`
	AltText *string   `json:"alt_text,omitempty"`
}

Jump to

Keyboard shortcuts

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