types

package
v0.0.0-...-fb95fdf Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLEARCredentialJWTtoken

func CreateLEARCredentialJWTtoken(learCred LEARCredentialEmployee, sigMethod jwt.SigningMethod, privateKey any) (string, error)

CreateLEARCredentialJWTtoken creates a JWT token from the given claims, signed with the first private key associated to the issuer DID

func LEARCredentialFromMap

func LEARCredentialFromMap(s map[string]any) (err error)

func VerifyLEARCredential

func VerifyLEARCredential(r any) (*yaml.YAML, error)

Types

type AuthenticatedUser

type AuthenticatedUser struct {
	Type                   string
	Email                  string
	OrganizationIdentifier string
	Organization           string
	Country                string
	Name                   string
	SerialNumber           string
}

type LEARCredentialEmployee

type LEARCredentialEmployee struct {
	Context        []string `json:"@context,omitempty"`
	Id             string   `json:"id,omitempty"`
	TypeCredential []string `json:"type,omitempty"`
	Issuer         struct {
		Id string `json:"id,omitempty"`
	} `json:"issuer,omitempty"`
	IssuanceDate      string `json:"issuanceDate,omitempty"`
	ValidFrom         string `json:"validFrom,omitempty"`
	ExpirationDate    string `json:"expirationDate,omitempty"`
	CredentialSubject struct {
		Mandate Mandate `json:"mandate,omitempty"`
	} `json:"credentialSubject,omitempty"`
}

type LEARCredentialEmployeeJWTClaims

type LEARCredentialEmployeeJWTClaims struct {
	LEARCredentialEmployee
	jwt.RegisteredClaims
}

type Mandate

type Mandate struct {
	Id       string `json:"id,omitempty"`
	Mandator struct {
		OrganizationIdentifier string `json:"organizationIdentifier,omitempty"` // OID 2.5.4.97
		CommonName             string `json:"commonName,omitempty"`             // OID 2.5.4.3
		GivenName              string `json:"givenName,omitempty"`
		Surname                string `json:"surname,omitempty"`
		EmailAddress           string `json:"emailAddress,omitempty"`
		SerialNumber           string `json:"serialNumber,omitempty"`
		Organization           string `json:"organization,omitempty"`
		Country                string `json:"country,omitempty"`
	} `json:"mandator,omitempty"`
	Mandatee struct {
		Id           string `json:"id,omitempty"`
		First_name   string `json:"first_name,omitempty"`
		Last_name    string `json:"last_name,omitempty"`
		Gender       string `json:"gender,omitempty"`
		Email        string `json:"email,omitempty"`
		Mobile_phone string `json:"mobile_phone,omitempty"`
	} `json:"mandatee,omitempty"`
	Power []struct {
		Id           string   `json:"id,omitempty"`
		Tmf_type     string   `json:"tmf_type,omitempty"`
		Tmf_domain   []string `json:"tmf_domain,omitempty"`
		Tmf_function string   `json:"tmf_function,omitempty"`
		Tmf_action   []string `json:"tmf_action,omitempty"`
	} `json:"power,omitempty"`
	LifeSpan struct {
		StartDateTime string `json:"start_date_time,omitempty"`
		EndDateTime   string `json:"end_date_time,omitempty"`
	} `json:"life_span,omitempty"`
}

Jump to

Keyboard shortcuts

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