Documentation
¶
Index ¶
- func CreateLEARCredentialJWTtoken(learCred LEARCredentialEmployee, sigMethod jwt.SigningMethod, privateKey any) (string, error)
- func LEARCredentialFromMap(s map[string]any) (err error)
- func VerifyLEARCredential(r any) (*yaml.YAML, error)
- type AuthenticatedUser
- type LEARCredentialEmployee
- type LEARCredentialEmployeeJWTClaims
- type Mandate
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 ¶
Types ¶
type AuthenticatedUser ¶
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"`
FirstName string `json:"firstName,omitempty"`
LastName string `json:"lastName,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:"type,omitempty"`
Tmf_domain []string `json:"domain,omitempty"`
Tmf_function string `json:"function,omitempty"`
Tmf_action []string `json:"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"`
}
Click to show internal directories.
Click to hide internal directories.