Documentation ¶
Index ¶
- Constants
- Variables
- func Contains(field string, required []string) bool
- func GetFormat(field interface{}) string
- func JSONBytesEqual(a, b []byte) (bool, error)
- func Type(field interface{}) string
- func Validate(t interface{}) error
- type Accreditations
- type AuthNFactorCredential
- type Background
- type Claim
- type Constraints
- type CredentialDerivationRequest
- type CredentialEvidence
- type CredentialFormat
- type CredentialIssueRequest
- type CredentialRequest
- type CredentialSchema
- type CredentialStatus
- type CredentialStatusUpdateRequest
- type CredentialVerificationRequest
- type DIDDocument
- func (d *DIDDocument) GetContext() *SSIContext
- func (d *DIDDocument) GetKeyFromId(id string) *PublicKey
- func (d *DIDDocument) GetProofChain() *[]Proof
- func (d *DIDDocument) GetProofs() *SSIProof
- func (d *DIDDocument) GetVerificationMethods() []*PublicKey
- func (d *DIDDocument) SetContexts(context *SSIContext)
- func (d *DIDDocument) SetProofChain(proof *[]Proof)
- func (d *DIDDocument) SetProofs(proof *SSIProof)
- type DIDDocumentMetadata
- type DIFPresentationDefinition
- type DataAgreement
- func (da *DataAgreement) GetContext() *SSIContext
- func (da *DataAgreement) GetProofChain() *[]Proof
- func (da *DataAgreement) GetProofs() *SSIProof
- func (da *DataAgreement) SetContexts(context *SSIContext)
- func (da *DataAgreement) SetProofChain(proof *[]Proof)
- func (da *DataAgreement) SetProofs(proof *SSIProof)
- type DataAgreementRef
- type DataPolicy
- type DataReceiver
- type DerivationOptions
- type Descriptor
- type Dpia
- type EidasCertificate
- type Event
- type Evidence
- type EvidenceDocument
- type ExchangeRequest
- type ExchangeResponse
- type Field
- type Filter
- type Format
- type FromOption
- type InputDescriptor
- func (i *InputDescriptor) AddSchema(s Schema) error
- func (i *InputDescriptor) SetConstraints(fields ...Field) error
- func (i *InputDescriptor) SetConstraintsLimitDisclosure(limitDisclosure bool)
- func (i *InputDescriptor) SetSubjectIsHolder(preference Preference) error
- func (i *InputDescriptor) SetSubjectIsIssuer(preference Preference) error
- type IssueOptions
- type JSONObject
- type JSONSchema
- type JSONSchemaMap
- type JWK
- type JWTFormat
- type JWTType
- type LDPFormat
- type LDPType
- type LdContext
- type LdVerifiable
- type MechanismId
- type OrganizationInfo
- type PExchange
- type PersonalDatum
- type Preference
- type PreferredDisplay
- type PresentationDefinition
- func (p *PresentationDefinition) GetProofChain() *[]Proof
- func (p *PresentationDefinition) GetProofs() *SSIProof
- func (p *PresentationDefinition) IsRequest() bool
- func (p *PresentationDefinition) SetProofChain(proof *[]Proof)
- func (p *PresentationDefinition) SetProofs(proof *SSIProof)
- func (p *PresentationDefinition) ToPresentationDefinition() *PresentationDefinition
- type PresentationDefinitionBuilder
- func (p *PresentationDefinitionBuilder) AddInputDescriptor(i InputDescriptor) error
- func (p *PresentationDefinitionBuilder) AddSubmissionRequirements(srs ...SubmissionRequirement) error
- func (p *PresentationDefinitionBuilder) Build() (*PresentationDefinitionHolder, error)
- func (p *PresentationDefinitionBuilder) SetID(id string)
- func (p *PresentationDefinitionBuilder) SetJWTFormat(format JWTFormat, algs []string) error
- func (p *PresentationDefinitionBuilder) SetLDPFormat(format LDPFormat, proofTypes []string) error
- func (p *PresentationDefinitionBuilder) SetLocale(locale string)
- func (p *PresentationDefinitionBuilder) SetName(name string)
- func (p *PresentationDefinitionBuilder) SetPurpose(purpose string)
- type PresentationDefinitionHolder
- type PresentationProveRequest
- type PresentationSubmission
- type PresentationSubmissionBuilder
- func (p *PresentationSubmissionBuilder) AddDescriptor(d Descriptor) error
- func (p *PresentationSubmissionBuilder) Build() (*PresentationSubmissionHolder, error)
- func (p *PresentationSubmissionBuilder) SetDefinitionID(definitionID string)
- func (p *PresentationSubmissionBuilder) SetID(id string)
- func (p *PresentationSubmissionBuilder) SetLocale(locale string)
- type PresentationSubmissionHolder
- type PresentationVerificationRequest
- type Proof
- type Properties
- type PublicKey
- type Purpose
- type ResponseMessage
- type SSIContext
- type SSIProof
- type SSIService
- type Schema
- type SecMechanism
- type Selection
- type Service
- type ServiceEndpoint
- type StringOrInteger
- type Style
- type SubmissionRequirement
- type TenantConfig
- type TimeWithFormat
- type TrustedIssuer
- type TrustedIssuerList
- type Verifiable
- type VerifiableCredential
- func (v *VerifiableCredential) GetContext() *SSIContext
- func (v *VerifiableCredential) GetProofChain() *[]Proof
- func (v *VerifiableCredential) GetProofs() *SSIProof
- func (v *VerifiableCredential) GetSchema() string
- func (v *VerifiableCredential) GetSchemaRef() string
- func (v *VerifiableCredential) IsRef() bool
- func (v *VerifiableCredential) SetContexts(context *SSIContext)
- func (v *VerifiableCredential) SetProofChain(proof *[]Proof)
- func (v *VerifiableCredential) SetProofs(proof *SSIProof)
- type VerifiableCredentialStatus
- type VerifiablePresentation
- func (v *VerifiablePresentation) GetContext() *SSIContext
- func (v *VerifiablePresentation) GetProofChain() *[]Proof
- func (v *VerifiablePresentation) GetProofs() *SSIProof
- func (v *VerifiablePresentation) IsResponse() bool
- func (v *VerifiablePresentation) SetContexts(context *SSIContext)
- func (v *VerifiablePresentation) SetProofChain(proof *[]Proof)
- func (v *VerifiablePresentation) SetProofs(proof *SSIProof)
- func (v *VerifiablePresentation) ToPresentation() *VerifiablePresentation
- type VerifiableStatus
- type VerificationMethod
- type VerificationResult
Constants ¶
const ( TypeEd25519 = "Ed25519VerificationKey2018" // Uses LD-Context for Serialization TypeRSA = "RsaVerificationKey2018" TypeEC = "EcdsaSecp256k1VerificationKey2019" TypeEC2 = "EcdsaSecp256k1RecoveryMethod2020" TypeJWS = "JwsVerificationKey2020" TypeGPG = "GpgVerificationKey2020" TypeJCS_Ed = "JcsEd25519Signature2020" // Thats the one we should be using and supporting up until know TypeBBS1 = "Bls12381G1Key2020" TypeBBS2 = "Bls12381G2Key2020" TypeX25519Agreement = "X25519KeyAgreementKey2019" TypeECSchnorr = "SchnorrSecp256k1VerificationKey2019" //Listed but undefined )
Public Key types following https://w3c-ccg.github.io/ld-cryptosuite-registry/#signature-suites and https://w3c.github.io/did-spec-registries/#verification-method-types
const ( JWT JWTFormat = "jwt" JWTVC JWTFormat = "jwt_vc" JWTVP JWTFormat = "jwt_vp" LDP LDPFormat = "ldp" LDPVC LDPFormat = "ldp_vc" LDPVP LDPFormat = "ldp_vp" All Selection = "all" Pick Selection = "pick" Required Preference = "required" Preferred Preference = "preferred" )
const RequestToken = "REQUEST_TOKEN"
Request token key to save/get the request token from the context
Variables ¶
var ( //Common or admin ErrBadParamInput = errors.New("request is not valid") ErrNotFound = errors.New("your requested item is not found") ErrNotInitialized = errors.New("application not initialized") ErrAlreadyInitialized = errors.New("application already initialized") ErrNotConfigured = errors.New("configuration available but not applied") ErrInternalServerError = errors.New("internal Server Error") ErrConflict = errors.New("your item already exists") //Connect ErrEmptySession = errors.New("your session is empty") ErrInvalidSession = errors.New("your session is invalid or cannot be queried") // DID ErrDIDNotAvailable = errors.New("DID is not available") ErrCatalogNotAvailable = errors.New("catalog is not available") ErrMissingKey = errors.New("verification method not present in did") ErrInvalidDIDMethod = errors.New("cannot register DIDs with non GATC method") //Validations ErrNotMatch = errors.New("presentation response does not match") ErrRepeatedClaim = errors.New("required claim is found repeated") ErrInvalidFormat = errors.New("document is not valid json") ErrUnwantedClaim = errors.New("found unrequested claim") ErrMissingClaim = errors.New("required claim is missing") ErrMissingConstraint = errors.New("required constraint couldn't be satisfied") ErrMissingRequirement = errors.New("submission requirement couldn't be satisfied") ErrMissingSecondFactor = errors.New("required second factor is missing") ErrMissingSFProof = errors.New("second factor proof is missing") ErrSFValidation = errors.New("second factor could not be validated") ErrInvalidContext = errors.New("document linked data context couldn't be validated") ErrMissingVerifiable = errors.New("missing object to verify") ErrSessionRequested = errors.New("your session is already in use") ErrConsentValidation = errors.New("claim consent validation fail") ErrCredentialsNotMatch = errors.New("credentials requested are not avaliable in tenant") ErrRenewDisallowed = errors.New("renew service is not activated") //Status ErrStatusNotValid = errors.New("credential status not valid") )
Functions ¶
func JSONBytesEqual ¶
JSONBytesEqual compares the JSON in two byte slices for deep equality, ignoring whitespace and other non-semantically meaningful formatting differences.
Types ¶
type Accreditations ¶
type Accreditations struct { Accreditor string `json:"accreditor,omitempty"` CreatedAt *TimeWithFormat `json:"createdAt,omitempty"` CredentialSchema string `json:"credentialSchema,omitempty"` Evidence *CredentialEvidence `json:"evidence,omitempty"` ExpirationDate *TimeWithFormat `json:"expirationDate,omitempty"` LevelOfTrust int `json:"levelOfTrust,omitempty"` Proof *Proof `json:"proof,omitempty"` ValidFrom *TimeWithFormat `json:"validFrom,omitempty"` }
type AuthNFactorCredential ¶
type AuthNFactorCredential int
const ( Silent AuthNFactorCredential = iota + 1 Biometric Email SMS FaceSDK RemoteFaceID )
func ToAuthNFactorCredential ¶
func ToAuthNFactorCredential(code string) AuthNFactorCredential
func (AuthNFactorCredential) MarshalJSON ¶
func (s AuthNFactorCredential) MarshalJSON() ([]byte, error)
MarshalJSON marshals the enum as a quoted json string
func (AuthNFactorCredential) String ¶
func (d AuthNFactorCredential) String() string
func (*AuthNFactorCredential) UnmarshalJSON ¶
func (s *AuthNFactorCredential) UnmarshalJSON(b []byte) error
UnmarshalJSON unmashals a quoted json string to the enum value
type Background ¶
type Constraints ¶
type Constraints struct { LimitDisclosure bool `json:"limit_disclosure,omitempty"` Fields []Field `json:"fields,omitempty"` SubjectIsIssuer *Preference `json:"subject_is_issuer,omitempty"` SubjectIsHolder *Preference `json:"subject_is_holder,omitempty"` }
type CredentialDerivationRequest ¶
type CredentialDerivationRequest struct { VerifiableCredential *VerifiableCredential `json:"verifiableCredential" description:"Original credential to be derived" ` Frame interface{} `json:"frame" description:"JSON-LD frame used for selective disclosure."` Options *DerivationOptions `json:"options" description:"Configuration options to include in the derived proof"` }
type CredentialEvidence ¶
type CredentialFormat ¶
type CredentialFormat string
type CredentialIssueRequest ¶
type CredentialIssueRequest struct { VerifiableCredential *VerifiableCredential `json:"verifiableCredential" description:"Original credential to be Issued" ` Options *IssueOptions `json:"options" description:"Configuration options to include in the issuance proof"` }
type CredentialRequest ¶
type CredentialRequest struct { Mandatory bool `json:"mandatory" example:"true" description:"Mark if this credential must be present on the Presentation Response."` Purpose string `` /* 126-byte string literal not displayed */ TrustLevel int `json:"trustLevel" example:"1" description:"Minimal level of trust required by this credential"` Type string `` /* 134-byte string literal not displayed */ }
type CredentialSchema ¶
type CredentialSchema = CredentialStatus
type CredentialStatus ¶
type CredentialStatusUpdateRequest ¶
type CredentialStatusUpdateRequest struct { CredentialID *string `json:"credentialId" description:"Credential unique ID" example:"cred:gatc:exampleABC123" ` CredentialStatus *CredentialStatus `json:"credentialStatus" description:"Configuration of the credential status RL"` }
type CredentialVerificationRequest ¶
type CredentialVerificationRequest struct { VerifiableCredential *VerifiableCredential `json:"verifiableCredential" description:"Original credential to be verified" ` Options *Proof `json:"options" description:"Configuration options to verify the proof"` }
type DIDDocument ¶
type DIDDocument struct { Context *SSIContext `json:"@context,omitempty" description:"Context for JSON-LD"` Assertion []VerificationMethod `` /* 219-byte string literal not displayed */ Authentication []VerificationMethod `` /* 219-byte string literal not displayed */ Delegation []VerificationMethod `` /* 279-byte string literal not displayed */ EbsiToken string `` /* 146-byte string literal not displayed */ Id string `json:"id,omitempty" example:"did:example:xxxxxxxxxxxxx" description:"DID unique Identifier for resolution"` Invocation []VerificationMethod `` /* 270-byte string literal not displayed */ KeyAgreement []VerificationMethod `` /* 211-byte string literal not displayed */ Ledger string `json:"ledger,omitempty" example:"ETH" description:"DLT storing the DID Document"` Proof *SSIProof `json:"proof,omitempty" description:"Proof validating DID Document and identifying the source and control of the document."` PublicKey []*PublicKey `json:"publicKey,omitempty" description:"Description of the public keys associated to this DID - Deprecated"` Service *SSIService `json:"service,omitempty" swaggerignore:"true"` VerificationMethod []*PublicKey `` /* 126-byte string literal not displayed */ }
DIDDocument represent the a client which is using Gataca Ledger is not a standard variable. We need to know where store the new DID when user create. See @https://www.w3.org/TR/did-core/#verification-methods See @https://w3c.github.io/did-spec-registries TODO: Switch PublicKey to Verification Method because of deprecation
func (*DIDDocument) GetContext ¶
func (d *DIDDocument) GetContext() *SSIContext
func (*DIDDocument) GetKeyFromId ¶
func (d *DIDDocument) GetKeyFromId(id string) *PublicKey
func (*DIDDocument) GetProofChain ¶
func (d *DIDDocument) GetProofChain() *[]Proof
func (*DIDDocument) GetProofs ¶
func (d *DIDDocument) GetProofs() *SSIProof
func (*DIDDocument) GetVerificationMethods ¶
func (d *DIDDocument) GetVerificationMethods() []*PublicKey
For retrocompatibility with old dids
func (*DIDDocument) SetContexts ¶
func (d *DIDDocument) SetContexts(context *SSIContext)
func (*DIDDocument) SetProofChain ¶
func (d *DIDDocument) SetProofChain(proof *[]Proof)
func (*DIDDocument) SetProofs ¶
func (d *DIDDocument) SetProofs(proof *SSIProof)
type DIDDocumentMetadata ¶
type DIFPresentationDefinition ¶
type DIFPresentationDefinition struct { Name string `json:"name,omitempty"` ID string `json:"id" validate:"required"` Purpose string `json:"purpose,omitempty"` Locale string `json:"locale,omitempty"` Format *Format `json:"format,omitempty"` SubmissionRequirements []SubmissionRequirement `json:"submission_requirements,omitempty"` InputDescriptors []InputDescriptor `json:"input_descriptors" validate:"required"` }
type DataAgreement ¶
type DataAgreement struct { Context *SSIContext `json:"@context,omitempty"` DataHolder string `json:"data_holder,omitempty"` DataReceiver DataReceiver `json:"data_receiver,omitempty"` DataSubject string `json:"data_subject,omitempty"` Dpia *Dpia `json:"dpia,omitempty"` Event []Event `json:"event,omitempty"` ID string `json:"id"` PersonalData []PersonalDatum `json:"personal_data"` Purposes []Purpose `json:"purposes"` TemplateID string `json:"template_id,omitempty"` TemplateVersion string `json:"template_version,omitempty"` TerminationTimestamp int64 `json:"termination_timestamp,omitempty"` Version string `json:"version,omitempty"` }
func (*DataAgreement) GetContext ¶
func (da *DataAgreement) GetContext() *SSIContext
func (*DataAgreement) GetProofChain ¶
func (da *DataAgreement) GetProofChain() *[]Proof
func (*DataAgreement) GetProofs ¶
func (da *DataAgreement) GetProofs() *SSIProof
func (*DataAgreement) SetContexts ¶
func (da *DataAgreement) SetContexts(context *SSIContext)
func (*DataAgreement) SetProofChain ¶
func (da *DataAgreement) SetProofChain(proof *[]Proof)
func (*DataAgreement) SetProofs ¶
func (da *DataAgreement) SetProofs(proof *SSIProof)
type DataAgreementRef ¶
type DataAgreementRef struct { Ref string DataAgreement *DataAgreement }
func (DataAgreementRef) MarshalJSON ¶
func (dar DataAgreementRef) MarshalJSON() ([]byte, error)
func (*DataAgreementRef) UnmarshalJSON ¶
func (dar *DataAgreementRef) UnmarshalJSON(jsonData []byte) error
type DataPolicy ¶
type DataPolicy struct { DataRetentionPeriod int `json:"data_retention_period,omitempty"` GeographicRestriction string `json:"geographic_restriction,omitempty"` IndustryScope string `json:"industry_scope,omitempty"` Jurisdictions []string `json:"jurisdictions,omitempty"` PolicyURL string `json:"policy_URL,omitempty"` StorageLocation string `json:"storage_location,omitempty"` }
type DataReceiver ¶
type DerivationOptions ¶
type DerivationOptions struct {
Nonce string `json:"nonce" description:"Nonce to be included in the proof"`
}
type Descriptor ¶
type Descriptor struct { ID string `json:"id" validate:"required"` Path string `json:"path" validate:"required"` Format CredentialFormat `json:"format" validate:"required"` }
type EidasCertificate ¶
type Evidence ¶
type Evidence struct { DocumentPresence string `json:"documentPresence,omitempty" example:"Physical"` EvidenceDocument *EvidenceDocument `json:"evidenceDocument,omitempty"` Id string `json:"id,omitempty" example:"https://base-uri/evidence/f2ae...5678"` SubjectPresence string `json:"subjectPresence,omitempty" example:"Physical"` Type []string `json:"type,omitempty" example:"DocumentVerification,PassportVerification"` Verifier string `json:"verifier,omitempty" example:"did:ebsi:xxxxxxx"` }
type EvidenceDocument ¶
type EvidenceDocument struct { DocumentCode string `json:"documentCode,omitempty" example:"P"` DocumentExpirationDate *TimeWithFormat `json:"documentExpirationDate,omitempty"` //Check if its RFC3339 DocumentIssuingState string `json:"documentIssuingState,omitempty" example:"NLD"` DocumentNumber string `json:"documentNumber,omitempty" example:"SPECI2014"` Type string `json:"type,omitempty" example:"Passport"` }
type ExchangeRequest ¶
type ExchangeRequest interface { IsRequest() bool ToPresentationDefinition() *PresentationDefinition }
type ExchangeResponse ¶
type ExchangeResponse interface { IsResponse() bool ToPresentation() *VerifiablePresentation }
type Field ¶
type Field struct { Path []string `json:"path,omitempty" validate:"required"` Purpose string `json:"purpose,omitempty"` Filter *Filter `json:"filter,omitempty"` Predicate *Preference `json:"predicate,omitempty"` }
func NewConstraintsField ¶
func (*Field) SetPurpose ¶
type Filter ¶
type Filter struct { Type string `json:"type" validate:"required"` Format string `json:"format,omitempty"` Pattern string `json:"pattern,omitempty"` Minimum StringOrInteger `json:"minimum,omitempty"` Maximum StringOrInteger `json:"maximum,omitempty"` MinLength int `json:"minLength,omitempty"` MaxLength int `json:"maxLength,omitempty"` ExclusiveMinimum StringOrInteger `json:"exclusiveMinimum,omitempty"` ExclusiveMaximum StringOrInteger `json:"exclusiveMaximum,omitempty"` Const StringOrInteger `json:"const,omitempty"` Enum []StringOrInteger `json:"enum,omitempty"` Not *Filter `json:"not,omitempty"` }
type FromOption ¶
type FromOption struct { From string `json:"from,omitempty"` FromNested []SubmissionRequirement `json:"from_nested,omitempty"` }
type InputDescriptor ¶
type InputDescriptor struct { ID string `json:"id,omitempty" validate:"required"` Name string `json:"name,omitempty"` Purpose string `json:"purpose,omitempty"` Metadata string `json:"metadata,omitempty"` Group []string `json:"group,omitempty"` Schema []Schema `json:"schema,omitempty" validate:"required,min=1"` Constraints *Constraints `json:"constraints,omitempty"` }
func NewInputDescriptor ¶
func NewInputDescriptor(id, name, purpose, metadata string) *InputDescriptor
func (*InputDescriptor) AddSchema ¶
func (i *InputDescriptor) AddSchema(s Schema) error
func (*InputDescriptor) SetConstraints ¶
func (i *InputDescriptor) SetConstraints(fields ...Field) error
func (*InputDescriptor) SetConstraintsLimitDisclosure ¶
func (i *InputDescriptor) SetConstraintsLimitDisclosure(limitDisclosure bool)
func (*InputDescriptor) SetSubjectIsHolder ¶
func (i *InputDescriptor) SetSubjectIsHolder(preference Preference) error
func (*InputDescriptor) SetSubjectIsIssuer ¶
func (i *InputDescriptor) SetSubjectIsIssuer(preference Preference) error
type IssueOptions ¶
type IssueOptions struct { Proof CredentialStatus *CredentialStatus `json:"credentialStatus" description:"Configuration of the credential status RL"` }
type JSONObject ¶
type JSONObject interface{}
type JSONSchema ¶
type JSONSchemaMap ¶
type JSONSchemaMap map[string]interface{}
go representation of json schema document
func (JSONSchemaMap) AllowsAdditionalProperties ¶
func (j JSONSchemaMap) AllowsAdditionalProperties() bool
func (JSONSchemaMap) Description ¶
func (j JSONSchemaMap) Description() string
Assumes the json schema has a description field
func (JSONSchemaMap) Properties ¶
func (j JSONSchemaMap) Properties() Properties
Assumes the json schema has a properties field
func (JSONSchemaMap) RequiredFields ¶
func (j JSONSchemaMap) RequiredFields() []string
func (JSONSchemaMap) ToJSON ¶
func (j JSONSchemaMap) ToJSON() string
type JWK ¶
type JWK struct { Alg string `json:"alg,omitempty" example:"jwa values: https://www.rfc-editor.org/rfc/rfc7518.html#page-6"` Curve string `json:"crv,omitempty"` D string `json:"d,omitempty" description:"value of d (ECC private key, RSA private key)"` DP string `json:"dp,omitempty" description:"value of first factor crt exponent (RSA private)"` DQ string `json:"dq,omitempty" description:"value of second factor crt exponent (RSA private)"` E string `json:"e,omitempty" description:"value of exponent (RSA public key)"` K string `json:"k,omitempty" description:"value of the symmetric key (Symmetric, OCT keys)"` KeyId string `json:"kid,omitempty"` KeyType string `json:"kty,omitempty"` Q string `json:"q,omitempty" description:"value of second prime number (RSA private key)"` QI string `json:"qi,omitempty" description:"value of first CRT coefficient (RSA private key)"` N string `json:"n,omitempty" description:"value of moduluss (RSA public key)"` P string `json:"p,omitempty" description:"value of first prime number (RSA Private key)"` Use string `json:"use,omitempty" example:"sig,enc"` X string `json:"x,omitempty" description:"value of x coordinate (ECC, OKP public key)"` Y string `json:"y,omitempty" description:"value of y coordinate (ECC public key)"` }
type JWTFormat ¶
type JWTFormat CredentialFormat
type LDPFormat ¶
type LDPFormat CredentialFormat
type LDPType ¶
type LDPType struct {
ProofType []string `json:"proof_type,omitempty" validate:"required"`
}
type LdContext ¶
type LdContext interface { GetContext() *SSIContext SetContexts(context *SSIContext) }
type LdVerifiable ¶
type LdVerifiable interface { LdContext Verifiable }
type MechanismId ¶
type MechanismId int
const ( AuthNFactor MechanismId = iota + 1 AppAuth Credential )
func (MechanismId) MarshalJSON ¶
func (s MechanismId) MarshalJSON() ([]byte, error)
MarshalJSON marshals the enum as a quoted json string
func (MechanismId) String ¶
func (d MechanismId) String() string
func (*MechanismId) UnmarshalJSON ¶
func (s *MechanismId) UnmarshalJSON(b []byte) error
UnmarshalJSON unmashals a quoted json string to the enum value
type OrganizationInfo ¶
type OrganizationInfo struct { AreaGroup string `json:"areaGroup,omitempty"` EORI string `json:"EORI,omitempty"` DiscoveryURL string `json:"discoveryURL,omitempty"` DomainName string `json:"domainName,omitempty"` IdentifierBag string `json:"identifierBag,omitempty"` LegalAddress string `json:"legalAddress,omitempty"` LegalName string `json:"legalName,omitempty"` LegalPersonalIdentifier string `json:"legalPersonalIdentifier,omitempty"` LEI string `json:"LEI,omitempty"` PrefDisplay *PreferredDisplay `json:"preferredDisplay,omitempty"` SEED string `json:"SEED,omitempty"` SIC string `json:"SIC,omitempty"` TaxReference string `json:"taxReference,omitempty"` VATRegistration string `json:"VATRegistration,omitempty"` }
type PExchange ¶
type PExchange struct { Id string PresentationSubmission *VerifiablePresentation Validations *VerificationResult PresentationDefinition *PresentationDefinition RequestedAt *time.Time CreatedAt *time.Time UpdatedAt *time.Time ExpiredAt *time.Time DeletedAt *pq.NullTime }
type PersonalDatum ¶
type Preference ¶
type Preference string
type PreferredDisplay ¶
type PreferredDisplay struct { Background *Background `json:"background,omitempty"` Logo string `json:"logo,omitempty"` PreferredName string `json:"preferredName,omitempty"` Style *Style `json:"style,omitempty"` }
type PresentationDefinition ¶
type PresentationDefinition struct { DataAgreement *DataAgreementRef `json:"dataAgreement,omitempty"` DIFPresentationDefinition Proof *SSIProof `json:"proof,omitempty"` }
func (*PresentationDefinition) GetProofChain ¶
func (p *PresentationDefinition) GetProofChain() *[]Proof
func (*PresentationDefinition) GetProofs ¶
func (p *PresentationDefinition) GetProofs() *SSIProof
func (*PresentationDefinition) IsRequest ¶
func (p *PresentationDefinition) IsRequest() bool
func (*PresentationDefinition) SetProofChain ¶
func (p *PresentationDefinition) SetProofChain(proof *[]Proof)
func (*PresentationDefinition) SetProofs ¶
func (p *PresentationDefinition) SetProofs(proof *SSIProof)
func (*PresentationDefinition) ToPresentationDefinition ¶
func (p *PresentationDefinition) ToPresentationDefinition() *PresentationDefinition
type PresentationDefinitionBuilder ¶
type PresentationDefinitionBuilder struct {
Definition PresentationDefinition
}
func NewPresentationDefinitionBuilder ¶
func NewPresentationDefinitionBuilder() *PresentationDefinitionBuilder
func (*PresentationDefinitionBuilder) AddInputDescriptor ¶
func (p *PresentationDefinitionBuilder) AddInputDescriptor(i InputDescriptor) error
func (*PresentationDefinitionBuilder) AddSubmissionRequirements ¶
func (p *PresentationDefinitionBuilder) AddSubmissionRequirements(srs ...SubmissionRequirement) error
func (*PresentationDefinitionBuilder) Build ¶
func (p *PresentationDefinitionBuilder) Build() (*PresentationDefinitionHolder, error)
func (*PresentationDefinitionBuilder) SetID ¶
func (p *PresentationDefinitionBuilder) SetID(id string)
func (*PresentationDefinitionBuilder) SetJWTFormat ¶
func (p *PresentationDefinitionBuilder) SetJWTFormat(format JWTFormat, algs []string) error
func (*PresentationDefinitionBuilder) SetLDPFormat ¶
func (p *PresentationDefinitionBuilder) SetLDPFormat(format LDPFormat, proofTypes []string) error
func (*PresentationDefinitionBuilder) SetLocale ¶
func (p *PresentationDefinitionBuilder) SetLocale(locale string)
func (*PresentationDefinitionBuilder) SetName ¶
func (p *PresentationDefinitionBuilder) SetName(name string)
func (*PresentationDefinitionBuilder) SetPurpose ¶
func (p *PresentationDefinitionBuilder) SetPurpose(purpose string)
type PresentationDefinitionHolder ¶
type PresentationDefinitionHolder struct {
PresentationDefinition `json:"presentation_definition" validate:"required"`
}
type PresentationProveRequest ¶
type PresentationProveRequest struct { VPresentation *VerifiablePresentation `json:"presentation" description:"Presentation to be proved" ` Options *Proof `json:"options" description:"Configuration options to include in the proof"` }
type PresentationSubmission ¶
type PresentationSubmission struct { ID string `json:"id" validate:"required"` DefinitionID string `json:"definition_id" validate:"required"` Locale string `json:"locale,omitempty"` DescriptorMap []Descriptor `json:"descriptor_map" validate:"required"` }
type PresentationSubmissionBuilder ¶
type PresentationSubmissionBuilder struct {
Submission PresentationSubmission
}
func NewPresentationSubmissionBuilder ¶
func NewPresentationSubmissionBuilder(definitionID string) *PresentationSubmissionBuilder
func (*PresentationSubmissionBuilder) AddDescriptor ¶
func (p *PresentationSubmissionBuilder) AddDescriptor(d Descriptor) error
func (*PresentationSubmissionBuilder) Build ¶
func (p *PresentationSubmissionBuilder) Build() (*PresentationSubmissionHolder, error)
func (*PresentationSubmissionBuilder) SetDefinitionID ¶
func (p *PresentationSubmissionBuilder) SetDefinitionID(definitionID string)
func (*PresentationSubmissionBuilder) SetID ¶
func (p *PresentationSubmissionBuilder) SetID(id string)
func (*PresentationSubmissionBuilder) SetLocale ¶
func (p *PresentationSubmissionBuilder) SetLocale(locale string)
type PresentationSubmissionHolder ¶
type PresentationSubmissionHolder struct {
PresentationSubmission `json:"presentation_submission" validate:"required"`
}
type PresentationVerificationRequest ¶
type PresentationVerificationRequest struct { Presentation *VerifiablePresentation `json:"presentation" description:"Proofless Presentation to be verified" ` //either only a non-verifiable presentation (proofless VPresentation *VerifiablePresentation `json:"verifiablePresentation" description:"Verifiable Presentation to be validated" ` //or a verifiable presentation (with options) Options *Proof `json:"options" description:"Configuration options to verify the proof"` }
type Proof ¶
type Proof struct { CaDES string `` /* 131-byte string literal not displayed */ Challenge string `` /* 141-byte string literal not displayed */ Context *SSIContext `json:"@context,omitempty" description:"Context for JSON-LD"` Created *TimeWithFormat `` /* 130-byte string literal not displayed */ Creator string `json:"creator,omitempty" example:"did:gatc:yyyyyyyyyyyy#keys-1" description:"URI of the key used to sign the proof."` Domain string `json:"domain,omitempty" description:""` Jws string `` /* 3448-byte string literal not displayed */ Nonce string `` /* 137-byte string literal not displayed */ ProofPurpose string `json:"proofPurpose,omitempty" example:"Authentication" description:"Stated usage of the proof"` ProofValue string `json:"proofValue,omitempty" example:"bQ5AimlvOv6p5wa9pVlmjWgPMr7j9rKw_yjUL6yHlQNwnKk7HL8VQzIT0Xx" description:"Proof value."` SignatureValue string `` /* 128-byte string literal not displayed */ Type string `json:"type,omitempty" example:"Ed25519Signature2018" description:"Cryptographic suite used for signature"` VerificationMethod string `` /* 131-byte string literal not displayed */ }
func GetProofForVerificationMethod ¶
func GetProofForVerificationMethod(v Verifiable, vmethod string) *Proof
func (*Proof) GetContext ¶
func (p *Proof) GetContext() *SSIContext
func (*Proof) GetCreator ¶
func (*Proof) SetContexts ¶
func (p *Proof) SetContexts(context *SSIContext)
type Properties ¶
type Properties map[string]interface{}
type PublicKey ¶
type PublicKey struct { Context *SSIContext `json:"@context,omitempty" description:"Context for JSON-LD"` Controller string `json:"controller,omitempty" example:"did:example:xxxxxxxxxxxxx" description:"DID key owner"` Id string `json:"id,omitempty" example:"did:example:xxxxxxxxxxxxx#keys-1" description:"Key Identifier as a URI"` EthAddress string `json:"ethereumAddress,omitempty" example:"0x89a932207c485f85226d86f7cd486a89a24fcc12"` KeyB58 string `` /* 129-byte string literal not displayed */ KeyGPG string `` /* 284-byte string literal not displayed */ KeyHex string `json:"publicKeyHex,omitempty"` //Unsupported on DID-Core but widely used KeyJwk *JWK `json:"publicKeyJwk,omitempty"` KeyPem string `json:"publicKeyPem,omitempty"` KeyMultibase string `json:"publicKeyMultibase,omitempty"` Type string `json:"type,omitempty" example:"Ed25519VerificationKey2018" description:"Cryptographic suite definition"` //Ed25519VerificationKey2018 Usage string `json:"usage,omitempty" example:"signing,recovery"` }
PublicKeys are yet usually only Ed25519 Keys -> publicKeyBase58
func (*PublicKey) GetContext ¶
func (p *PublicKey) GetContext() *SSIContext
func (*PublicKey) SetContexts ¶
func (p *PublicKey) SetContexts(context *SSIContext)
type Purpose ¶
type Purpose struct { DataPolicy DataPolicy `json:"data_policy,omitempty"` ID string `json:"id,omitempty"` LegalBasis string `json:"legal_basis,omitempty"` MethodOfUse string `json:"method_of_use,omitempty"` PurposeCategory string `json:"purpose_category,omitempty"` PurposeDescription string `json:"purpose_description,omitempty"` }
type ResponseMessage ¶
type ResponseMessage struct {
Message string `json:"message" example:"Some description message" description:"Operation result message description"`
}
ResponseMessage represent the response error struct
type SSIContext ¶
func (*SSIContext) GetContext ¶
func (sc *SSIContext) GetContext() []string
func (SSIContext) MarshalJSON ¶
func (sc SSIContext) MarshalJSON() ([]byte, error)
func (*SSIContext) UnmarshalJSON ¶
func (sc *SSIContext) UnmarshalJSON(jsonData []byte) error
type SSIProof ¶
func (*SSIProof) GetCreators ¶
func (SSIProof) MarshalJSON ¶
MarshalJSON TODO -When not breaking code in wallet-> Marshal as single object if only one Proof
func (*SSIProof) UnmarshalJSON ¶
type SSIService ¶
func (*SSIService) GetServices ¶
func (ss *SSIService) GetServices() *[]Service
func (*SSIService) MarshalJSON ¶
func (ss *SSIService) MarshalJSON() ([]byte, error)
func (*SSIService) UnmarshalJSON ¶
func (ss *SSIService) UnmarshalJSON(jsonData []byte) error
type SecMechanism ¶
type SecMechanism struct { Accepted []string `json:"accepted,omitempty"` Type MechanismId `json:"type,omitempty"` }
type Service ¶
type Service struct { Id string `json:"id,omitempty"` Type string `json:"type,omitempty"` ServiceEndpoint string `json:"serviceEndpoint,omitempty"` }
Service represent the a client which is using Gataca
type ServiceEndpoint ¶
type StringOrInteger ¶
type StringOrInteger interface{}
type SubmissionRequirement ¶
type SubmissionRequirement struct { Name string `json:"name,omitempty"` Purpose string `json:"purpose,omitempty"` Rule Selection `json:"rule" validate:"required"` Count *int `json:"count,omitempty" validate:"min=1"` Minimum *int `json:"min,omitempty"` //Can be zero Maximum *int `json:"max,omitempty"` // Either an array of SubmissionRequirement or a string value FromOption `validate:"required"` }
type TenantConfig ¶
type TenantConfig struct { //Tenant TenantId string `json:"tenantid" example:"my-tenant" description:"Tenant unique identifier"` DID string `json:"did" example:"did:example:xxxxxxxxxxxx" description:"Verifier DID used by the tenant"` Domain string `json:"domain" example:"https://host.domain.com" description:"Verifier domain to receive the presentation Response"` Credentials []CredentialRequest `json:"credentials" description:"Credentials and constraint to be specified on the tenant's Presentation Requests"` Security []SecMechanism `json:"security" description:"List of security mechanisms to be enforced by the Presentation Response"` Callback string `json:"callback" description:"Endpoint from the relying party used to notify when the user makes changes on the data"` DataAgreementTemplate *DataAgreement `json:"dataAgreementTemplate" description:"Template of the Data Agreement associated with this service"` ServicePurpose string `json:"service" description:"Description of the service that is being provided with this QR"` AdvancedDefinition *PresentationDefinition `json:"advancedDefinition" description:"Presentation exchange definition at an advanced level for expert admin users"` }
type TimeWithFormat ¶
type TimeWithFormat struct { time.Time `swaggertype:"string" json:"tenants" example:"2019-10-01T12:12:05.999Z" description:"Time in RFC 3339 Format"` // embedded time value Format string `swaggerignore:"true"` // format }
func (TimeWithFormat) MarshalJSON ¶
func (ct TimeWithFormat) MarshalJSON() ([]byte, error)
type TrustedIssuer ¶
type TrustedIssuer struct { Context string `json:"@context,omitempty"` Accreditations *Accreditations `json:"accreditations,omitempty"` EidasCert *EidasCertificate `json:"eidasCertificate,omitempty"` Dids []string `json:"dids,omitempty"` Domain string `json:"domain,omitempty"` Id string `json:"id,omitempty"` OrgInfo *OrganizationInfo `json:"organizationInfo,omitempty"` Proof *Proof `json:"proof,omitempty"` ServiceEndpoints string `json:"serviceEndpoints,omitempty"` }
type TrustedIssuerList ¶
type TrustedIssuerList struct { Proof *Proof `json:"proof,omitempty"` TrustedIssuers []TrustedIssuer `json:"trustedIssuers,omitempty"` }
type Verifiable ¶
type VerifiableCredential ¶
type VerifiableCredential struct { Context *SSIContext `json:"@context,omitempty" description:"Context for JSON-LD"` CredentialSchema *CredentialSchema `` //Reusing the CredentialStatusType coz its the same struct here /* 127-byte string literal not displayed */ CredentialStatus *CredentialStatus `` /* 135-byte string literal not displayed */ CredentialSubject *map[string]interface{} `` //swagger ignore because of unexpected problems with current library /* 210-byte string literal not displayed */ Evidence *Evidence `json:"evidence,omitempty" swaggertype:"object,string" description:"Definition of the evidence. Required by eIDas"` ExpirationDate *TimeWithFormat `` /* 143-byte string literal not displayed */ Id string `json:"id" example:"cred:example:zzzzzzzzzzzz" description:"Unique identifier of the Verifiable Credential"` Iss string `json:"iss,omitempty" description:"jwt fields needed for VA"` IssuanceDate *TimeWithFormat `` /* 140-byte string literal not displayed */ Issuer string `json:"issuer,omitempty" example:"did:example:yyyyyyyyyyyyyyyy" description:"Issuer of the credential"` Proof *SSIProof `json:"proof,omitempty" description:"Proofs to verify the presentation"` Type []string `` /* 143-byte string literal not displayed */ ValidFrom *TimeWithFormat `` /* 142-byte string literal not displayed */ }
func (*VerifiableCredential) GetContext ¶
func (v *VerifiableCredential) GetContext() *SSIContext
func (*VerifiableCredential) GetProofChain ¶
func (v *VerifiableCredential) GetProofChain() *[]Proof
func (*VerifiableCredential) GetProofs ¶
func (v *VerifiableCredential) GetProofs() *SSIProof
func (*VerifiableCredential) GetSchema ¶
func (v *VerifiableCredential) GetSchema() string
func (*VerifiableCredential) GetSchemaRef ¶
func (v *VerifiableCredential) GetSchemaRef() string
func (*VerifiableCredential) IsRef ¶
func (v *VerifiableCredential) IsRef() bool
func (*VerifiableCredential) SetContexts ¶
func (v *VerifiableCredential) SetContexts(context *SSIContext)
func (*VerifiableCredential) SetProofChain ¶
func (v *VerifiableCredential) SetProofChain(proof *[]Proof)
func (*VerifiableCredential) SetProofs ¶
func (v *VerifiableCredential) SetProofs(proof *SSIProof)
type VerifiablePresentation ¶
type VerifiablePresentation struct { Context *SSIContext `json:"@context,omitempty" description:"Context for JSON-LD"` DataAgreementId string `` /* 142-byte string literal not displayed */ Holder *string `json:"holder,omitempty" example:"did:gatc:example1234567" description:"DID of the Holder of the credentials"` PresentationSubmission *PresentationSubmission `json:"presentation_submission,omitempty" description:"Presentation submission according to DIF PE"` Proof *SSIProof `json:"proof,omitempty" description:"Proofs to verify the presentation"` Type []string `json:"type,omitempty" example:"VerifiablePresentation" description:"Definition of the format of the presentation"` VerifiableCredential []VerifiableCredential `json:"verifiableCredential,omitempty" description:"List of Verifiable Credentials included in the presentation"` }
func (*VerifiablePresentation) GetContext ¶
func (v *VerifiablePresentation) GetContext() *SSIContext
func (*VerifiablePresentation) GetProofChain ¶
func (v *VerifiablePresentation) GetProofChain() *[]Proof
func (*VerifiablePresentation) GetProofs ¶
func (v *VerifiablePresentation) GetProofs() *SSIProof
func (*VerifiablePresentation) IsResponse ¶
func (v *VerifiablePresentation) IsResponse() bool
func (*VerifiablePresentation) SetContexts ¶
func (v *VerifiablePresentation) SetContexts(context *SSIContext)
func (*VerifiablePresentation) SetProofChain ¶
func (v *VerifiablePresentation) SetProofChain(proof *[]Proof)
func (*VerifiablePresentation) SetProofs ¶
func (v *VerifiablePresentation) SetProofs(proof *SSIProof)
func (*VerifiablePresentation) ToPresentation ¶
func (v *VerifiablePresentation) ToPresentation() *VerifiablePresentation
type VerifiableStatus ¶
type VerifiableStatus struct { Description string `json:"description,omitempty"` Id string `json:"id"` Proof string `json:"issued,omitempty"` VerifiableCredential []VerifiableCredentialStatus `json:"verifiableCredential"` }
type VerificationMethod ¶
func (*VerificationMethod) GetId ¶
func (vm *VerificationMethod) GetId() string
func (*VerificationMethod) GetKeys ¶
func (vm *VerificationMethod) GetKeys(parentKeys []*PublicKey) *PublicKey
func (*VerificationMethod) MarshalJSON ¶
func (vm *VerificationMethod) MarshalJSON() ([]byte, error)
func (*VerificationMethod) UnmarshalJSON ¶
func (vm *VerificationMethod) UnmarshalJSON(jsonData []byte) error
type VerificationResult ¶
type VerificationResult struct { Checks []string `json:"checks" description:"Security checks performed" example:"['proof']"` Warnings []string `json:"warnings" description:"Warning messages to include about the validation" example:"['Context not verified']"` Errors []string `json:"errors" description:"Resulting errors on the validation. Should be empty if the validation is successful." example:"[]"` }
func (*VerificationResult) Valid ¶
func (v *VerificationResult) Valid() bool