UNPKG

@blockcerts/schemas

Version:
156 lines (155 loc) 5.56 kB
{ "$schema": "http://json-schema.org/draft-04/schema#", "title": "Certificate Document Version 1.2 Schema", "id": "https://w3id.org/blockcerts/schema/1.2/certificate-document-1.2.json", "description": "The complete certificate document, including the assertion, certificate, and issuer. Doesn't include the blockchain receipt. This part is hashed and placed on the blockchain", "type": "object", "definitions": { "JsonLdContext": { "description": "A link to a valid JSON-LD context file, that maps term names to contexts. Blockchain Certificate contexts may also define JSON-schema to validate Blockchain Certificates against. In a Blockchain Certificate Object, this will almost always be a string:uri to a single context file, but might rarely be an array of links or context objects instead. This schema also allows direct mapping of terms to IRIs by using an object as an option within an array.", "oneOf": [ { "type": "string" }, { "type": "array", "items": { "oneOf": [ { "type": "string" }, { "type": "object" }, { "type": "array" } ] } } ] }, "JsonLdType": { "description": "A type or an array of types that the Blockchain Certificate object represents. The first or only item should be 'CertificateDocument', and any others should each be an IRI (usually a URL) corresponding to a definition of the type itself. In almost all cases, there will be only one type: 'CertificateDocument'", "oneOf": [ { "type": "string" }, { "type": "array", "items": { "type": "string" } } ] }, "Certificate": { "$ref": "https://w3id.org/blockcerts/schema/1.2/certificate-1.2.json" }, "Assertion": { "$ref": "https://w3id.org/blockcerts/schema/1.2/assertion-1.2.json" }, "VerificationObject": { "type": "object", "description": "V1.2 notice: the Blockchain Certificates VerificationObject will change in the next schema version to be consistent with OBI VerificationObjects. This work is in progress.", "properties": { "attribute-signed": { "type": "string", "description": "Name of the attribute in the json that is signed by the issuer's private key. Default is 'uid', referring to the uid attribute." }, "type": { "type": "string", "enum": [ "hosted", "signed", "ECDSA(secp256k1)" ], "description": "Name of the signing method. Default is 'ECDSA(secp256k1)', referring to the Blockchain Certificates method of signing messages with the issuer's private key." }, "signer": { "type": "string", "format": "uri", "description": "URI where issuer's public key is presented. Default is https://[domain]/keys/[org-abbr]-certs-public-key.asc. V1.2 change: this field is optional" } }, "required": [ "attribute-signed", "type" ] }, "Recipient": { "type": "object", "properties": { "familyName": { "type": "string", "description": "Family name of the recipient. http://schema.org/Person#familyName" }, "identity": { "type": "string", "description": "String that represents a recipient's identity. By default, it is an email address." }, "type": { "type": "string", "description": "Type of value in the identity field. Default is 'email'." }, "hashed": { "type": "boolean", "description": "Describes if the value in the identity field is hashed or not. We strongly recommend that the issuer hash the identy to protect the recipient." }, "salt": { "type": "string", "description": "per the OBI standard, if the recipient identity is hashed, then this should contain the string used to salt the hash" }, "publicKey": { "type": "string", "description": "Bitcoin address (compressed public key, usually 24 characters) of the recipient. V1.2 change: renamed from pubkey" }, "revocationKey": { "type": "string", "description": "Issuer revocation key for the recipient, optional. Bitcoin address (compressed public key, usually 24 characters) of the recipient." }, "givenName": { "type": "string", "description": "Given name of the recipient. http://schema.org/Person#givenName" } }, "required": [ "type", "familyName", "identity", "hashed", "publicKey", "givenName" ], "additionalProperties": true } }, "properties": { "@context": { "$ref": "#/definitions/JsonLdContext" }, "type": { "$ref": "#/definitions/JsonLdType" }, "certificate": { "$ref": "#/definitions/Certificate" }, "assertion": { "$ref": "#/definitions/Assertion" }, "verify": { "$ref": "#/definitions/VerificationObject" }, "recipient": { "$ref": "#/definitions/Recipient" } }, "required": [ "type", "certificate", "assertion", "verify", "recipient" ], "additionalProperties": true }