{"$schema":"http://json-schema.org/draft-07/schema#","schemaId":"b1d0a8c3-4e5f-6789-0abc-def012345678","title":"Binding Document","domain":"identity","type":"object","properties":{"subject":{"type":"string","description":"eName of the subject (pre-fixed with @)"},"type":{"type":"string","enum":["id_document","photograph","social_connection","self","personal_parameters","security_question","deployment_key","software_version"],"description":"The type of binding document"},"data":{"type":"object","description":"Format dependent payload for the binding document"},"signatures":{"type":"array","description":"Array of signatures from the user and counterparties","items":{"$ref":"#/definitions/Signature"}}},"allOf":[{"if":{"properties":{"type":{"const":"id_document"}},"required":["type"]},"then":{"properties":{"data":{"$ref":"#/definitions/IdDocumentData"}}}},{"if":{"properties":{"type":{"const":"photograph"}},"required":["type"]},"then":{"properties":{"data":{"$ref":"#/definitions/PhotographData"}}}},{"if":{"properties":{"type":{"const":"social_connection"}},"required":["type"]},"then":{"properties":{"data":{"$ref":"#/definitions/SocialConnectionData"}}}},{"if":{"properties":{"type":{"const":"self"}},"required":["type"]},"then":{"properties":{"data":{"$ref":"#/definitions/SelfData"}}}},{"if":{"properties":{"type":{"const":"deployment_key"}},"required":["type"]},"then":{"properties":{"data":{"$ref":"#/definitions/DeploymentKeyData"}}}},{"if":{"properties":{"type":{"const":"software_version"}},"required":["type"]},"then":{"properties":{"data":{"$ref":"#/definitions/SoftwareVersionData"}}}}],"definitions":{"IdDocumentData":{"type":"object","properties":{"vendor":{"type":"string","description":"Vendor name for the ID document verification"},"reference":{"type":"string","description":"Reference ID from the vendor"},"name":{"type":"string","description":"Name verified against the ID document"}},"required":["vendor","reference","name"],"additionalProperties":false},"PhotographData":{"type":"object","properties":{"photoBlob":{"type":"string","description":"Base64 encoded photo blob"}},"required":["photoBlob"],"additionalProperties":false},"SocialConnectionData":{"type":"object","properties":{"kind":{"type":"string","const":"social_connection","description":"Discriminant for social connection data"},"name":{"type":"string","description":"Name of the social connection"},"parties":{"type":"array","items":{"type":"string","pattern":"^@[^\\s]+$"},"minItems":2,"maxItems":2,"description":"eNames of both participants"},"relation_description":{"type":"string","description":"Arbitrary text describing the relationship"}},"required":["kind","name","parties","relation_description"],"additionalProperties":false},"SelfData":{"type":"object","properties":{"kind":{"type":"string","const":"self","description":"Discriminant for self data"},"name":{"type":"string","description":"Self-declared name"}},"required":["kind","name"],"additionalProperties":false},"DeploymentKeyData":{"type":"object","properties":{"kind":{"const":"deployment_key"},"deploymentName":{"type":"string","minLength":1},"environment":{"type":"string","minLength":1},"deployerEname":{"type":"string","pattern":"^@[^\\s]+$"},"platformEname":{"type":"string","pattern":"^@[^\\s]+$"},"publicKey":{"type":"string","pattern":"^z.+$"},"algorithm":{"const":"ECDSA_P256"}},"required":["kind","deploymentName","environment","deployerEname","platformEname","publicKey","algorithm"],"additionalProperties":false},"SoftwareVersionData":{"type":"object","properties":{"kind":{"const":"software_version"},"platformEname":{"type":"string","pattern":"^@[^\\s]+$"},"versionEname":{"type":"string","pattern":"^@[^\\s]+$"},"version":{"type":"string","pattern":"^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$"},"releaseTag":{"type":"string","minLength":1},"commitSha":{"type":"string","pattern":"^[0-9a-fA-F]{40,64}$"}},"required":["kind","platformEname","versionEname","version","releaseTag","commitSha"],"additionalProperties":false},"Signature":{"type":"object","properties":{"signer":{"type":"string","description":"eName or keyID of who signed it"},"signature":{"type":"string","description":"Cryptographic signature"},"timestamp":{"type":"string","format":"date-time","description":"When the signature was created"},"scope":{"type":"string","enum":["document","bundle"]},"signedPayload":{"type":"string","description":"Canonical signed payload for a bundle-scoped signature"}},"required":["signer","signature","timestamp"],"additionalProperties":false}},"required":["subject","type","data","signatures"],"additionalProperties":false}