UNPKG

995 BJavaScriptView Raw
1/*!
2 * Copyright (c) 2012-2018 Digital Bazaar, Inc. All rights reserved.
3 */
4const bedrock = require('bedrock');
5
6const jsonldType = require('./jsonldType');
7const w3cDateTime = require('./w3cDateTime');
8const identifier = require('./identifier');
9
10const schema = {
11 title: 'GraphSignature',
12 description: 'A digital signature on a graph.',
13 type: 'object',
14 properties: {
15 id: identifier(),
16 type: jsonldType('GraphSignature2012'),
17 creator: identifier(),
18 created: w3cDateTime(),
19 signatureValue: {
20 title: 'Digital Signature Value',
21 description: 'A base-64 encoded byte string containing the result of ' +
22 'the GraphSignature2012 algorithm.',
23 type: 'string'
24 },
25 // NOTE: id is not required
26 required: ['type', 'creator', 'created', 'signatureValue']
27 },
28 additionalProperties: false
29};
30
31module.exports = function(extend) {
32 if(extend) {
33 return bedrock.util.extend(true, bedrock.util.clone(schema), extend);
34 }
35 return schema;
36};