Documentation
¶
Index ¶
- Constants
- func DefaultRetryPolicy(ctx context.Context, resp *http.Response, err error) (bool, error)
- func GenerateHash(sd []byte) string
- func VerifyCertChain(url string) (*x509.Certificate, error)
- type ComplianceCredentialSubject
- type Context
- type CredentialSubject
- type DocumentLoader
- type Proof
- type Proofs
- type RegistrationNumber2210Struct
- type Store
- func (s *Store) Create(vc *VerifiableCredential) error
- func (s *Store) Delete(id string)
- func (s *Store) GetAllIndex() []string
- func (s *Store) Read(id string) (*VerifiableCredential, error)
- func (s *Store) ToFile(path string, keyPhrase []byte) (err error)
- func (s *Store) Update(vc *VerifiableCredential) error
- type TermsAndConditions2210Struct
- type VCType
- type VerifiableCredential
- func (c *VerifiableCredential) CanonizeGo() ([]byte, error)
- func (c *VerifiableCredential) Hash() (string, error)
- func (c *VerifiableCredential) JSC() ([]byte, error)
- func (c *VerifiableCredential) String() string
- func (c *VerifiableCredential) ToBase64() (string, error)
- func (c *VerifiableCredential) ToJson() ([]byte, error)
- func (c *VerifiableCredential) ToMap() (map[string]interface{}, error)
- func (c *VerifiableCredential) Validate(validate *validator.Validate) error
- func (c *VerifiableCredential) Verify() error
- type VerifiablePresentation
Constants ¶
const SecuritySuitesJWS2020 = "https://w3id.org/security/suites/jws-2020/v1"
const W3Credentials = "https://www.w3.org/2018/credentials/v1"
Variables ¶
This section is empty.
Functions ¶
func DefaultRetryPolicy ¶
DefaultRetryPolicy fork from https://github.com/hashicorp/go-retryablehttp/blob/v0.7.4/client.go
func GenerateHash ¶
func VerifyCertChain ¶
func VerifyCertChain(url string) (*x509.Certificate, error)
Types ¶
type ComplianceCredentialSubject ¶
type ComplianceCredentialSubject struct { Type string `json:"type"` ID string `json:"id"` GxIntegrity string `json:"gx:integrity"` GxIntegrityNormalization string `json:"gx:integrityNormalization"` GxVersion string `json:"gx:version"` GxType string `json:"gx:type"` }
ComplianceCredentialSubject implements the shape as returned by the compliance service as compliance credentials
func NewComplianceCredentialSubjectFormMap ¶
func NewComplianceCredentialSubjectFormMap(c map[string]interface{}) (*ComplianceCredentialSubject, error)
NewComplianceCredentialSubjectFormMap marshals a map to ComplianceCredentialSubject or returns an error
type Context ¶
type Context struct { Context []string // contains filtered or unexported fields }
func (*Context) MarshalJSON ¶
func (*Context) UnmarshalJSON ¶
type CredentialSubject ¶
type CredentialSubject struct { CredentialSubject []map[string]interface{} // contains filtered or unexported fields }
func (*CredentialSubject) MarshalJSON ¶
func (cs *CredentialSubject) MarshalJSON() ([]byte, error)
func (*CredentialSubject) UnmarshalJSON ¶
func (cs *CredentialSubject) UnmarshalJSON(dat []byte) error
type DocumentLoader ¶
type DocumentLoader struct {
// contains filtered or unexported fields
}
DocumentLoader fork from ld.DefaultDocumentLoader https://github.com/piprate/json-gold/blob/master/ld/document_loader.go
func NewDocumentLoader ¶
func NewDocumentLoader(httpClient *http.Client) *DocumentLoader
NewDocumentLoader fork from ld.DefaultDocumentLoader https://github.com/piprate/json-gold/blob/master/ld/document_loader.go
func (*DocumentLoader) LoadDocument ¶
func (dl *DocumentLoader) LoadDocument(u string) (*ld.RemoteDocument, error)
LoadDocument returns a RemoteDocument containing the contents of the JSON resource from the given URL. fork from https://github.com/piprate/json-gold/blob/master/ld/document_loader.go
type RegistrationNumber2210Struct ¶
type RegistrationNumber2210Struct struct { Context Context `json:"@context"` Type string `json:"type"` ID string `json:"id"` GxVatID string `json:"gx:vatID,omitempty"` GXVATCountryCode string `json:"gx:vatID-countryCode,omitempty"` GxLeiCode string `json:"gx:leiCode,omitempty"` GxLeiCodeCountryCode string `json:"gx:leiCode-countryCode,omitempty"` GxLeiCodeSubdivisionCountryCode string `json:"gx:leiCode-subdivisionCountryCode,omitempty"` GXTaxID string `json:"gx:taxID,omitempty"` GXEUID string `json:"gx:EUID,omitempty"` GXEORI string `json:"gx:EORI,omitempty"` }
RegistrationNumber2210Struct implements the shape of the registry number see: https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#gx:legalRegistrationNumberShape
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) Create ¶
func (s *Store) Create(vc *VerifiableCredential) error
func (*Store) GetAllIndex ¶
func (*Store) Update ¶
func (s *Store) Update(vc *VerifiableCredential) error
type TermsAndConditions2210Struct ¶
type TermsAndConditions2210Struct struct { Context Context `json:"@context"` Type string `json:"type"` GxTermsAndConditions string `json:"gx:termsAndConditions"` ID string `json:"id"` }
TermsAndConditions2210Struct implements the shape of the terms and conditions see: https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#gx:GaiaXTermsAndConditionsShape
type VCType ¶
type VCType struct { Types []string // contains filtered or unexported fields }
func (*VCType) MarshalJSON ¶
func (*VCType) UnmarshalJSON ¶
type VerifiableCredential ¶
type VerifiableCredential struct { Context Context `json:"@context" validate:"required"` Type VCType `json:"type" validate:"required"` IssuanceDate string `json:"issuanceDate" validate:"required"` ExpirationDate string `json:"expirationDate,omitempty"` CredentialSubject CredentialSubject `json:"credentialSubject,omitempty"` Issuer string `json:"issuer" validate:"required"` ID string `json:"id" validate:"required"` Proof *Proofs `json:"proof,omitempty"` Evidence []struct { GxEvidenceURL string `json:"gx:evidenceURL,omitempty"` GxExecutionDate string `json:"gx:executionDate,omitempty"` GxEvidenceOf string `json:"gx:evidenceOf,omitempty"` } `json:"evidence,omitempty"` Options *ld.JsonLdOptions `json:"-"` // contains filtered or unexported fields }
VerifiableCredential implements the shape of a VC as defined in https://www.w3.org/TR/vc-data-model/#basic-concepts
func NewEmptyVerifiableCredential ¶
func NewEmptyVerifiableCredential() *VerifiableCredential
func (*VerifiableCredential) CanonizeGo ¶
func (c *VerifiableCredential) CanonizeGo() ([]byte, error)
func (*VerifiableCredential) Hash ¶
func (c *VerifiableCredential) Hash() (string, error)
func (*VerifiableCredential) JSC ¶
func (c *VerifiableCredential) JSC() ([]byte, error)
func (*VerifiableCredential) String ¶
func (c *VerifiableCredential) String() string
func (*VerifiableCredential) ToBase64 ¶
func (c *VerifiableCredential) ToBase64() (string, error)
func (*VerifiableCredential) ToJson ¶
func (c *VerifiableCredential) ToJson() ([]byte, error)
func (*VerifiableCredential) ToMap ¶
func (c *VerifiableCredential) ToMap() (map[string]interface{}, error)
func (*VerifiableCredential) Validate ¶
func (c *VerifiableCredential) Validate(validate *validator.Validate) error
func (*VerifiableCredential) Verify ¶
func (c *VerifiableCredential) Verify() error
type VerifiablePresentation ¶
type VerifiablePresentation struct { Context string `json:"@context" validate:"required"` Type string `json:"type" validate:"required"` VerifiableCredential []*VerifiableCredential `json:"verifiableCredential" validate:"required"` Proof *Proofs `json:"proof,omitempty"` }
VerifiablePresentation implements the shape of a verifiable presentation as defined in: https://www.w3.org/TR/vc-data-model/#presentations since Gaia-X has not defined a proof method yet, this is still open
func NewEmptyVerifiablePresentation ¶
func NewEmptyVerifiablePresentation() *VerifiablePresentation
func (*VerifiablePresentation) String ¶
func (vp *VerifiablePresentation) String() string
func (*VerifiablePresentation) ToBase64 ¶ added in v0.1.1
func (vp *VerifiablePresentation) ToBase64() (string, error)
func (*VerifiablePresentation) ToJson ¶ added in v0.1.1
func (vp *VerifiablePresentation) ToJson() ([]byte, error)
func (*VerifiablePresentation) ToMap ¶
func (vp *VerifiablePresentation) ToMap() (map[string]interface{}, error)
ToMap returns the map[string]interface{} representation of the VP, this a deep copy