@veramo/credential-ld 4.3.1-next.7 → 4.3.1-unstable.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/action-handler.d.ts +3 -389
- package/build/action-handler.d.ts.map +1 -1
- package/build/action-handler.js +136 -118
- package/build/action-handler.js.map +1 -1
- package/build/index.d.ts +16 -8
- package/build/index.d.ts.map +1 -1
- package/build/index.js +36 -8
- package/build/index.js.map +1 -1
- package/build/ld-context-loader.d.ts +1 -1
- package/build/ld-context-loader.d.ts.map +1 -1
- package/build/ld-context-loader.js +20 -6
- package/build/ld-context-loader.js.map +1 -1
- package/build/ld-credential-module.d.ts +3 -3
- package/build/ld-credential-module.d.ts.map +1 -1
- package/build/ld-credential-module.js +85 -72
- package/build/ld-credential-module.js.map +1 -1
- package/build/ld-default-contexts.d.ts +1 -315
- package/build/ld-default-contexts.d.ts.map +1 -1
- package/build/ld-default-contexts.js +17 -28
- package/build/ld-default-contexts.js.map +1 -1
- package/build/ld-suite-loader.d.ts +1 -1
- package/build/ld-suite-loader.d.ts.map +1 -1
- package/build/ld-suite-loader.js +9 -4
- package/build/ld-suite-loader.js.map +1 -1
- package/build/ld-suites.js +7 -2
- package/build/ld-suites.js.map +1 -1
- package/build/suites/EcdsaSecp256k1RecoverySignature2020.d.ts +1 -1
- package/build/suites/EcdsaSecp256k1RecoverySignature2020.d.ts.map +1 -1
- package/build/suites/EcdsaSecp256k1RecoverySignature2020.js +52 -16
- package/build/suites/EcdsaSecp256k1RecoverySignature2020.js.map +1 -1
- package/build/suites/Ed25519Signature2018.d.ts +1 -1
- package/build/suites/Ed25519Signature2018.d.ts.map +1 -1
- package/build/suites/Ed25519Signature2018.js +48 -12
- package/build/suites/Ed25519Signature2018.js.map +1 -1
- package/build/suites/Ed25519Signature2020.d.ts +1 -1
- package/build/suites/Ed25519Signature2020.d.ts.map +1 -1
- package/build/suites/Ed25519Signature2020.js +52 -13
- package/build/suites/Ed25519Signature2020.js.map +1 -1
- package/build/suites/JsonWebSignature2020.d.ts +1 -1
- package/build/suites/JsonWebSignature2020.d.ts.map +1 -1
- package/build/suites/JsonWebSignature2020.js +82 -44
- package/build/suites/JsonWebSignature2020.js.map +1 -1
- package/build/tsdoc-metadata.json +1 -1
- package/build/types.js +2 -1
- package/package.json +8 -17
- package/src/__tests__/context.loader.test.ts +3 -3
- package/src/__tests__/issue-verify-flow.test.ts +5 -6
- package/src/action-handler.ts +7 -8
- package/src/index.ts +17 -8
- package/src/ld-context-loader.ts +1 -1
- package/src/ld-credential-module.ts +4 -5
- package/src/ld-default-contexts.ts +14 -27
- package/src/ld-suite-loader.ts +1 -1
- package/src/suites/EcdsaSecp256k1RecoverySignature2020.ts +4 -4
- package/src/suites/Ed25519Signature2018.ts +1 -1
- package/src/suites/Ed25519Signature2020.ts +1 -1
- package/src/suites/JsonWebSignature2020.ts +1 -1
- package/build/plugin.schema.json +0 -430
- /package/{src/plugin.schema.json → plugin.schema.json} +0 -0
package/build/ld-suite-loader.js
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LdSuiteLoader = void 0;
|
|
1
4
|
/**
|
|
2
5
|
* Initializes a list of Veramo-wrapped LD Signature suites and exposes those to the Agent Module
|
|
3
6
|
*/
|
|
4
|
-
|
|
7
|
+
class LdSuiteLoader {
|
|
5
8
|
constructor(options) {
|
|
9
|
+
this.signatureMap = {};
|
|
6
10
|
options.veramoLdSignatures.forEach((obj) => {
|
|
7
11
|
const keyType = obj.getSupportedVeramoKeyType();
|
|
8
12
|
const verificationType = obj.getSupportedVerificationType();
|
|
9
|
-
return this.signatureMap[keyType] = {
|
|
13
|
+
return this.signatureMap[keyType] = Object.assign(Object.assign({}, this.signatureMap[keyType]), { [verificationType]: obj });
|
|
10
14
|
});
|
|
11
15
|
}
|
|
12
|
-
signatureMap = {};
|
|
13
16
|
getSignatureSuiteForKeyType(type, verificationType) {
|
|
14
|
-
|
|
17
|
+
var _a;
|
|
18
|
+
const suite = (_a = this.signatureMap[type]) === null || _a === void 0 ? void 0 : _a[verificationType];
|
|
15
19
|
if (suite)
|
|
16
20
|
return suite;
|
|
17
21
|
throw new Error('No Veramo LD Signature Suite for ' + type);
|
|
@@ -23,4 +27,5 @@ export class LdSuiteLoader {
|
|
|
23
27
|
return Object.values(this.signatureMap).map((x) => Object.keys(x)).flat();
|
|
24
28
|
}
|
|
25
29
|
}
|
|
30
|
+
exports.LdSuiteLoader = LdSuiteLoader;
|
|
26
31
|
//# sourceMappingURL=ld-suite-loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ld-suite-loader.js","sourceRoot":"","sources":["../src/ld-suite-loader.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"ld-suite-loader.js","sourceRoot":"","sources":["../src/ld-suite-loader.ts"],"names":[],"mappings":";;;AAGA;;GAEG;AACH,MAAa,aAAa;IACxB,YAAY,OAAoD;QAOxD,iBAAY,GAAsD,EAAE,CAAA;QAN1E,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACzC,MAAM,OAAO,GAAG,GAAG,CAAC,yBAAyB,EAAE,CAAA;YAC/C,MAAM,gBAAgB,GAAG,GAAG,CAAC,4BAA4B,EAAE,CAAA;YAC3D,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,mCAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,KAAE,CAAC,gBAAgB,CAAC,EAAE,GAAG,GAAE,CAAA;QAChG,CAAC,CAAC,CAAA;IACJ,CAAC;IAGD,2BAA2B,CAAC,IAAc,EAAE,gBAAwB;;QAClE,MAAM,KAAK,GAAG,MAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,0CAAG,gBAAgB,CAAC,CAAA;QACzD,IAAI,KAAK;YAAE,OAAO,KAAK,CAAA;QAEvB,MAAM,IAAI,KAAK,CAAC,mCAAmC,GAAG,IAAI,CAAC,CAAA;IAC7D,CAAC;IAED,qBAAqB;QACnB,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;IAC7E,CAAC;IAED,yBAAyB;QACvB,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;IAC3E,CAAC;CACF;AAxBD,sCAwBC"}
|
package/build/ld-suites.js
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VeramoLdSignature = void 0;
|
|
1
4
|
/**
|
|
2
5
|
* Base class for Veramo adapters of LinkedDataSignature suites.
|
|
3
6
|
*
|
|
4
7
|
* @alpha This API is experimental and is very likely to change or disappear in future releases without notice.
|
|
5
8
|
*/
|
|
6
|
-
|
|
9
|
+
class VeramoLdSignature {
|
|
7
10
|
preSigningPresModification(presentation) {
|
|
11
|
+
var _a;
|
|
8
12
|
// TODO: Remove invalid field 'verifiers' from Presentation. Needs to be adapted for LD credentials
|
|
9
13
|
// Only remove empty array (vc.signPresentation will throw then)
|
|
10
14
|
const sanitizedPresentation = presentation;
|
|
11
|
-
if (sanitizedPresentation
|
|
15
|
+
if (((_a = sanitizedPresentation === null || sanitizedPresentation === void 0 ? void 0 : sanitizedPresentation.verifier) === null || _a === void 0 ? void 0 : _a.length) == 0) {
|
|
12
16
|
delete sanitizedPresentation.verifier;
|
|
13
17
|
}
|
|
14
18
|
}
|
|
15
19
|
}
|
|
20
|
+
exports.VeramoLdSignature = VeramoLdSignature;
|
|
16
21
|
//# sourceMappingURL=ld-suites.js.map
|
package/build/ld-suites.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ld-suites.js","sourceRoot":"","sources":["../src/ld-suites.ts"],"names":[],"mappings":"AAaA;;;;GAIG;AACH,
|
|
1
|
+
{"version":3,"file":"ld-suites.js","sourceRoot":"","sources":["../src/ld-suites.ts"],"names":[],"mappings":";;;AAaA;;;;GAIG;AACH,MAAsB,iBAAiB;IAuBrC,0BAA0B,CAAC,YAAiC;;QAC1D,mGAAmG;QACnG,gEAAgE;QAChE,MAAM,qBAAqB,GAAG,YAAmB,CAAA;QACjD,IAAI,CAAA,MAAA,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,QAAQ,0CAAE,MAAM,KAAI,CAAC,EAAE;YAChD,OAAO,qBAAqB,CAAC,QAAQ,CAAA;SACtC;IACH,CAAC;CACF;AA/BD,8CA+BC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RequiredAgentMethods, VeramoLdSignature } from '../ld-suites
|
|
1
|
+
import { RequiredAgentMethods, VeramoLdSignature } from '../ld-suites';
|
|
2
2
|
import { CredentialPayload, DIDDocument, IAgentContext, IKey, TKeyType } from '@veramo/core';
|
|
3
3
|
/**
|
|
4
4
|
* Veramo wrapper for the EcdsaSecp256k1RecoverySignature2020 suite by Transmute Industries
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EcdsaSecp256k1RecoverySignature2020.d.ts","sourceRoot":"","sources":["../../src/suites/EcdsaSecp256k1RecoverySignature2020.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"EcdsaSecp256k1RecoverySignature2020.d.ts","sourceRoot":"","sources":["../../src/suites/EcdsaSecp256k1RecoverySignature2020.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAS5F;;;;GAIG;AACH,qBAAa,yCAA0C,SAAQ,iBAAiB;IAC9E,4BAA4B,IAAI,MAAM;IAItC,yBAAyB,IAAI,QAAQ;IAIrC,kBAAkB,CAChB,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,MAAM,EACX,kBAAkB,EAAE,MAAM,EAC1B,OAAO,EAAE,aAAa,CAAC,oBAAoB,CAAC,GAC3C,GAAG;IAyCN,uBAAuB,IAAI,GAAG;IAI9B,0BAA0B,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI;IAG/D,4BAA4B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI;IAmBvE,UAAU,IAAI,MAAM;CAGrB"}
|
|
@@ -1,14 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
exports.VeramoEcdsaSecp256k1RecoverySignature2020 = void 0;
|
|
36
|
+
const ld_suites_1 = require("../ld-suites");
|
|
37
|
+
const lds_ecdsa_secp256k1_recovery2020_1 = require("@veramo-community/lds-ecdsa-secp256k1-recovery2020");
|
|
38
|
+
const u8a = __importStar(require("uint8arrays"));
|
|
39
|
+
const utils_1 = require("@veramo/utils");
|
|
6
40
|
/**
|
|
7
41
|
* Veramo wrapper for the EcdsaSecp256k1RecoverySignature2020 suite by Transmute Industries
|
|
8
42
|
*
|
|
9
43
|
* @alpha This API is experimental and is very likely to change or disappear in future releases without notice.
|
|
10
44
|
*/
|
|
11
|
-
|
|
45
|
+
class VeramoEcdsaSecp256k1RecoverySignature2020 extends ld_suites_1.VeramoLdSignature {
|
|
12
46
|
getSupportedVerificationType() {
|
|
13
47
|
return 'EcdsaSecp256k1RecoveryMethod2020';
|
|
14
48
|
}
|
|
@@ -19,27 +53,27 @@ export class VeramoEcdsaSecp256k1RecoverySignature2020 extends VeramoLdSignature
|
|
|
19
53
|
const controller = did;
|
|
20
54
|
const signer = {
|
|
21
55
|
//returns a JWS detached
|
|
22
|
-
sign:
|
|
56
|
+
sign: (args) => __awaiter(this, void 0, void 0, function* () {
|
|
23
57
|
const header = {
|
|
24
58
|
alg: 'ES256K-R',
|
|
25
59
|
b64: false,
|
|
26
60
|
crit: ['b64'],
|
|
27
61
|
};
|
|
28
|
-
const headerString = encodeJoseBlob(header);
|
|
62
|
+
const headerString = (0, utils_1.encodeJoseBlob)(header);
|
|
29
63
|
const messageBuffer = u8a.concat([u8a.fromString(`${headerString}.`, 'utf-8'), args.data]);
|
|
30
64
|
const messageString = u8a.toString(messageBuffer, 'base64');
|
|
31
|
-
const signature =
|
|
65
|
+
const signature = yield context.agent.keyManagerSign({
|
|
32
66
|
keyRef: key.kid,
|
|
33
67
|
algorithm: 'ES256K-R',
|
|
34
68
|
data: messageString,
|
|
35
69
|
encoding: 'base64',
|
|
36
70
|
});
|
|
37
71
|
return `${headerString}..${signature}`;
|
|
38
|
-
},
|
|
72
|
+
}),
|
|
39
73
|
};
|
|
40
|
-
const suite = new EcdsaSecp256k1RecoverySignature2020({
|
|
74
|
+
const suite = new lds_ecdsa_secp256k1_recovery2020_1.EcdsaSecp256k1RecoverySignature2020({
|
|
41
75
|
// signer,
|
|
42
|
-
key: new EcdsaSecp256k1RecoveryMethod2020({
|
|
76
|
+
key: new lds_ecdsa_secp256k1_recovery2020_1.EcdsaSecp256k1RecoveryMethod2020({
|
|
43
77
|
publicKeyHex: key.publicKeyHex,
|
|
44
78
|
signer: () => signer,
|
|
45
79
|
type: this.getSupportedVerificationType(),
|
|
@@ -48,24 +82,25 @@ export class VeramoEcdsaSecp256k1RecoverySignature2020 extends VeramoLdSignature
|
|
|
48
82
|
}),
|
|
49
83
|
});
|
|
50
84
|
suite.ensureSuiteContext = ({ document }) => {
|
|
51
|
-
document['@context'] = [...asArray(document['@context'] || []), this.getContext()];
|
|
85
|
+
document['@context'] = [...(0, utils_1.asArray)(document['@context'] || []), this.getContext()];
|
|
52
86
|
};
|
|
53
87
|
return suite;
|
|
54
88
|
}
|
|
55
89
|
getSuiteForVerification() {
|
|
56
|
-
return new EcdsaSecp256k1RecoverySignature2020();
|
|
90
|
+
return new lds_ecdsa_secp256k1_recovery2020_1.EcdsaSecp256k1RecoverySignature2020();
|
|
57
91
|
}
|
|
58
92
|
preSigningCredModification(credential) {
|
|
59
93
|
}
|
|
60
94
|
preDidResolutionModification(didUrl, didDoc) {
|
|
95
|
+
var _a, _b;
|
|
61
96
|
// did:ethr
|
|
62
|
-
const idx = didDoc['@context']
|
|
97
|
+
const idx = ((_a = didDoc['@context']) === null || _a === void 0 ? void 0 : _a.indexOf('https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld')) || -1;
|
|
63
98
|
if (Array.isArray(didDoc['@context']) && idx !== -1) {
|
|
64
99
|
didDoc['@context'][idx] = this.getContext();
|
|
65
100
|
}
|
|
66
101
|
if (didUrl.toLowerCase().startsWith('did:ethr')) {
|
|
67
102
|
//EcdsaSecp256k1RecoveryMethod2020 does not support older format blockchainAccountId
|
|
68
|
-
didDoc.verificationMethod
|
|
103
|
+
(_b = didDoc.verificationMethod) === null || _b === void 0 ? void 0 : _b.forEach((x) => {
|
|
69
104
|
if (x.blockchainAccountId) {
|
|
70
105
|
if (x.blockchainAccountId.lastIndexOf('@eip155:') !== -1) {
|
|
71
106
|
const [address, chain] = x.blockchainAccountId.split("@eip155:");
|
|
@@ -79,4 +114,5 @@ export class VeramoEcdsaSecp256k1RecoverySignature2020 extends VeramoLdSignature
|
|
|
79
114
|
return 'https://w3id.org/security/suites/secp256k1recovery-2020/v2';
|
|
80
115
|
}
|
|
81
116
|
}
|
|
117
|
+
exports.VeramoEcdsaSecp256k1RecoverySignature2020 = VeramoEcdsaSecp256k1RecoverySignature2020;
|
|
82
118
|
//# sourceMappingURL=EcdsaSecp256k1RecoverySignature2020.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EcdsaSecp256k1RecoverySignature2020.js","sourceRoot":"","sources":["../../src/suites/EcdsaSecp256k1RecoverySignature2020.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"EcdsaSecp256k1RecoverySignature2020.js","sourceRoot":"","sources":["../../src/suites/EcdsaSecp256k1RecoverySignature2020.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAsE;AAEtE,yGAG2D;AAE3D,iDAAkC;AAClC,yCAAuD;AAEvD;;;;GAIG;AACH,MAAa,yCAA0C,SAAQ,6BAAiB;IAC9E,4BAA4B;QAC1B,OAAO,kCAAkC,CAAA;IAC3C,CAAC;IAED,yBAAyB;QACvB,OAAO,WAAW,CAAA;IACpB,CAAC;IAED,kBAAkB,CAChB,GAAS,EACT,GAAW,EACX,kBAA0B,EAC1B,OAA4C;QAE5C,MAAM,UAAU,GAAG,GAAG,CAAA;QACtB,MAAM,MAAM,GAAG;YACb,wBAAwB;YACxB,IAAI,EAAE,CAAO,IAA0B,EAAmB,EAAE;gBAC1D,MAAM,MAAM,GAAG;oBACb,GAAG,EAAE,UAAU;oBACf,GAAG,EAAE,KAAK;oBACV,IAAI,EAAE,CAAC,KAAK,CAAC;iBACd,CAAA;gBACD,MAAM,YAAY,GAAG,IAAA,sBAAc,EAAC,MAAM,CAAC,CAAA;gBAC3C,MAAM,aAAa,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,YAAY,GAAG,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;gBAC1F,MAAM,aAAa,GAAG,GAAG,CAAC,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC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AAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,EAAE,CAAA;SAC5C;QAED,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE;YAC/C,oFAAoF;YACpF,MAAA,MAAM,CAAC,kBAAkB,0CAAE,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;gBACvC,IAAI,CAAC,CAAC,mBAAmB,EAAE;oBACzB,IAAI,CAAC,CAAC,mBAAmB,CAAC,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE;wBACxD,MAAM,CAAE,OAAO,EAAE,KAAK,CAAE,GAAG,CAAC,CAAC,mBAAmB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;wBAClE,CAAC,CAAC,mBAAmB,GAAG,UAAU,KAAK,IAAI,OAAO,EAAE,CAAA;qBACrD;iBACF;YACH,CAAC,CAAC,CAAA;SACH;IACH,CAAC;IACD,UAAU;QACR,OAAO,4DAA4D,CAAA;IACrE,CAAC;CACF;AApFD,8FAoFC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RequiredAgentMethods, VeramoLdSignature } from '../ld-suites
|
|
1
|
+
import { RequiredAgentMethods, VeramoLdSignature } from '../ld-suites';
|
|
2
2
|
import { CredentialPayload, DIDDocument, IAgentContext, IKey, TKeyType } from '@veramo/core';
|
|
3
3
|
/**
|
|
4
4
|
* Veramo wrapper for the Ed25519Signature2018 suite by Transmute Industries
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ed25519Signature2018.d.ts","sourceRoot":"","sources":["../../src/suites/Ed25519Signature2018.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Ed25519Signature2018.d.ts","sourceRoot":"","sources":["../../src/suites/Ed25519Signature2018.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAI5F;;;;GAIG;AACH,qBAAa,0BAA2B,SAAQ,iBAAiB;IAC/D,4BAA4B,IAAI,MAAM;IAItC,yBAAyB,IAAI,QAAQ;IAIrC,kBAAkB,CAChB,GAAG,EAAE,IAAI,EACT,SAAS,EAAE,MAAM,EACjB,oBAAoB,EAAE,MAAM,EAC5B,OAAO,EAAE,aAAa,CAAC,oBAAoB,CAAC,GAC3C,GAAG;IA2CN,uBAAuB,IAAI,GAAG;IAI9B,0BAA0B,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI;IAI/D,4BAA4B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI;CAGxE"}
|
|
@@ -1,13 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
exports.VeramoEd25519Signature2018 = void 0;
|
|
36
|
+
const utils_1 = require("@veramo/utils");
|
|
37
|
+
const ld_suites_1 = require("../ld-suites");
|
|
38
|
+
const u8a = __importStar(require("uint8arrays"));
|
|
39
|
+
const ed25519_signature_2018_1 = require("@transmute/ed25519-signature-2018");
|
|
5
40
|
/**
|
|
6
41
|
* Veramo wrapper for the Ed25519Signature2018 suite by Transmute Industries
|
|
7
42
|
*
|
|
8
43
|
* @alpha This API is experimental and is very likely to change or disappear in future releases without notice.
|
|
9
44
|
*/
|
|
10
|
-
|
|
45
|
+
class VeramoEd25519Signature2018 extends ld_suites_1.VeramoLdSignature {
|
|
11
46
|
getSupportedVerificationType() {
|
|
12
47
|
return 'Ed25519VerificationKey2018';
|
|
13
48
|
}
|
|
@@ -20,25 +55,25 @@ export class VeramoEd25519Signature2018 extends VeramoLdSignature {
|
|
|
20
55
|
let id = verificationMethodId;
|
|
21
56
|
const signer = {
|
|
22
57
|
// returns a JWS detached
|
|
23
|
-
sign:
|
|
58
|
+
sign: (args) => __awaiter(this, void 0, void 0, function* () {
|
|
24
59
|
const header = {
|
|
25
60
|
alg: 'EdDSA',
|
|
26
61
|
b64: false,
|
|
27
62
|
crit: ['b64'],
|
|
28
63
|
};
|
|
29
|
-
const headerString = encodeJoseBlob(header);
|
|
64
|
+
const headerString = (0, utils_1.encodeJoseBlob)(header);
|
|
30
65
|
const messageBuffer = u8a.concat([u8a.fromString(`${headerString}.`, 'utf-8'), args.data]);
|
|
31
66
|
const messageString = u8a.toString(messageBuffer, 'base64');
|
|
32
|
-
const signature =
|
|
67
|
+
const signature = yield context.agent.keyManagerSign({
|
|
33
68
|
keyRef: key.kid,
|
|
34
69
|
algorithm: 'EdDSA',
|
|
35
70
|
data: messageString,
|
|
36
71
|
encoding: 'base64',
|
|
37
72
|
});
|
|
38
73
|
return `${headerString}..${signature}`;
|
|
39
|
-
},
|
|
74
|
+
}),
|
|
40
75
|
};
|
|
41
|
-
const verificationKey = new Ed25519VerificationKey2018({
|
|
76
|
+
const verificationKey = new ed25519_signature_2018_1.Ed25519VerificationKey2018({
|
|
42
77
|
id,
|
|
43
78
|
controller,
|
|
44
79
|
publicKey: u8a.fromString(key.publicKeyHex, 'base16'),
|
|
@@ -47,13 +82,13 @@ export class VeramoEd25519Signature2018 extends VeramoLdSignature {
|
|
|
47
82
|
});
|
|
48
83
|
// overwrite the signer since we're not passing the private key and transmute doesn't support that behavior
|
|
49
84
|
verificationKey.signer = () => signer;
|
|
50
|
-
return new Ed25519Signature2018({
|
|
85
|
+
return new ed25519_signature_2018_1.Ed25519Signature2018({
|
|
51
86
|
key: verificationKey,
|
|
52
87
|
signer: signer,
|
|
53
88
|
});
|
|
54
89
|
}
|
|
55
90
|
getSuiteForVerification() {
|
|
56
|
-
return new Ed25519Signature2018();
|
|
91
|
+
return new ed25519_signature_2018_1.Ed25519Signature2018();
|
|
57
92
|
}
|
|
58
93
|
preSigningCredModification(credential) {
|
|
59
94
|
// nothing to do here
|
|
@@ -62,4 +97,5 @@ export class VeramoEd25519Signature2018 extends VeramoLdSignature {
|
|
|
62
97
|
// nothing to do here
|
|
63
98
|
}
|
|
64
99
|
}
|
|
100
|
+
exports.VeramoEd25519Signature2018 = VeramoEd25519Signature2018;
|
|
65
101
|
//# sourceMappingURL=Ed25519Signature2018.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ed25519Signature2018.js","sourceRoot":"","sources":["../../src/suites/Ed25519Signature2018.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"Ed25519Signature2018.js","sourceRoot":"","sources":["../../src/suites/Ed25519Signature2018.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA8C;AAC9C,4CAAsE;AAEtE,iDAAkC;AAClC,8EAAoG;AAEpG;;;;GAIG;AACH,MAAa,0BAA2B,SAAQ,6BAAiB;IAC/D,4BAA4B;QAC1B,OAAO,4BAA4B,CAAA;IACrC,CAAC;IAED,yBAAyB;QACvB,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,kBAAkB,CAChB,GAAS,EACT,SAAiB,EACjB,oBAA4B,EAC5B,OAA4C;QAE5C,MAAM,UAAU,GAAG,SAAS,CAAA;QAE5B,aAAa;QACb,IAAI,EAAE,GAAG,oBAAoB,CAAA;QAE7B,MAAM,MAAM,GAAG;YACb,yBAAyB;YACzB,IAAI,EAAE,CAAO,IAA0B,EAAmB,EAAE;gBAC1D,MAAM,MAAM,GAAG;oBACb,GAAG,EAAE,OAAO;oBACZ,GAAG,EAAE,KAAK;oBACV,IAAI,EAAE,CAAC,KAAK,CAAC;iBACd,CAAA;gBACD,MAAM,YAAY,GAAG,IAAA,sBAAc,EAAC,MAAM,CAAC,CAAA;gBAC3C,MAAM,aAAa,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,C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
2
|
import { CredentialPayload, DIDDocument, IAgentContext, IKey, TKeyType } from '@veramo/core';
|
|
3
3
|
/**
|
|
4
4
|
* Veramo wrapper for the Ed25519Signature2020 suite by digitalcredentials
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ed25519Signature2020.d.ts","sourceRoot":"","sources":["../../src/suites/Ed25519Signature2020.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Ed25519Signature2020.d.ts","sourceRoot":"","sources":["../../src/suites/Ed25519Signature2020.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAK5F;;;;GAIG;AACH,qBAAa,0BAA2B,SAAQ,iBAAiB;IAC/D,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAAM;IACjD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAe;IAEjD,4BAA4B,IAAI,MAAM;IAItC,yBAAyB,IAAI,QAAQ;IAIrC,kBAAkB,CAChB,GAAG,EAAE,IAAI,EACT,SAAS,EAAE,MAAM,EACjB,oBAAoB,EAAE,MAAM,EAC5B,OAAO,EAAE,aAAa,CAAC,oBAAoB,CAAC,GAC3C,OAAO,CAAC,GAAG,CAAC;IAmCf,uBAAuB,IAAI,GAAG;IAI9B,0BAA0B,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI;IAI/D,4BAA4B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI;IAIvE,yBAAyB,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM;CAInD"}
|
|
@@ -1,15 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
exports.VeramoEd25519Signature2020 = void 0;
|
|
36
|
+
const ld_suites_1 = require("../ld-suites");
|
|
37
|
+
const u8a = __importStar(require("uint8arrays"));
|
|
38
|
+
const ed25519_signature_2020_1 = require("@digitalcredentials/ed25519-signature-2020");
|
|
39
|
+
const ed25519_verification_key_2020_1 = require("@digitalcredentials/ed25519-verification-key-2020");
|
|
5
40
|
/**
|
|
6
41
|
* Veramo wrapper for the Ed25519Signature2020 suite by digitalcredentials
|
|
7
42
|
*
|
|
8
43
|
* @alpha This API is experimental and is very likely to change or disappear in future releases without notice.
|
|
9
44
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
45
|
+
class VeramoEd25519Signature2020 extends ld_suites_1.VeramoLdSignature {
|
|
46
|
+
constructor() {
|
|
47
|
+
super(...arguments);
|
|
48
|
+
this.MULTIBASE_BASE58BTC_PREFIX = 'z';
|
|
49
|
+
this.MULTICODEC_PREFIX = [0xed, 0x01];
|
|
50
|
+
}
|
|
13
51
|
getSupportedVerificationType() {
|
|
14
52
|
return 'Ed25519VerificationKey2020';
|
|
15
53
|
}
|
|
@@ -22,17 +60,17 @@ export class VeramoEd25519Signature2020 extends VeramoLdSignature {
|
|
|
22
60
|
let id = verificationMethodId;
|
|
23
61
|
const signer = {
|
|
24
62
|
// returns signatureBytes
|
|
25
|
-
sign:
|
|
63
|
+
sign: (args) => __awaiter(this, void 0, void 0, function* () {
|
|
26
64
|
const messageString = u8a.toString(args.data, 'base64');
|
|
27
|
-
const signature =
|
|
65
|
+
const signature = yield context.agent.keyManagerSign({
|
|
28
66
|
keyRef: key.kid,
|
|
29
67
|
data: messageString,
|
|
30
68
|
encoding: 'base64',
|
|
31
69
|
});
|
|
32
70
|
return u8a.fromString(signature);
|
|
33
|
-
},
|
|
71
|
+
}),
|
|
34
72
|
};
|
|
35
|
-
const verificationKey = new Ed25519VerificationKey2020({
|
|
73
|
+
const verificationKey = new ed25519_verification_key_2020_1.Ed25519VerificationKey2020({
|
|
36
74
|
id,
|
|
37
75
|
controller,
|
|
38
76
|
publicKeyMultibase: this.preSigningKeyModification(u8a.fromString(key.publicKeyHex, 'hex')),
|
|
@@ -42,13 +80,13 @@ export class VeramoEd25519Signature2020 extends VeramoLdSignature {
|
|
|
42
80
|
// overwrite the signer since we're not passing the private key
|
|
43
81
|
verificationKey.signer = () => signer;
|
|
44
82
|
verificationKey.type = this.getSupportedVerificationType();
|
|
45
|
-
return new Ed25519Signature2020({
|
|
83
|
+
return new ed25519_signature_2020_1.Ed25519Signature2020({
|
|
46
84
|
key: verificationKey,
|
|
47
85
|
signer: signer,
|
|
48
86
|
});
|
|
49
87
|
}
|
|
50
88
|
getSuiteForVerification() {
|
|
51
|
-
return new Ed25519Signature2020();
|
|
89
|
+
return new ed25519_signature_2020_1.Ed25519Signature2020();
|
|
52
90
|
}
|
|
53
91
|
preSigningCredModification(credential) {
|
|
54
92
|
// nothing to do here
|
|
@@ -61,4 +99,5 @@ export class VeramoEd25519Signature2020 extends VeramoLdSignature {
|
|
|
61
99
|
return `${this.MULTIBASE_BASE58BTC_PREFIX}${u8a.toString(modifiedKey, 'base58btc')}`;
|
|
62
100
|
}
|
|
63
101
|
}
|
|
102
|
+
exports.VeramoEd25519Signature2020 = VeramoEd25519Signature2020;
|
|
64
103
|
//# sourceMappingURL=Ed25519Signature2020.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ed25519Signature2020.js","sourceRoot":"","sources":["../../src/suites/Ed25519Signature2020.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"Ed25519Signature2020.js","sourceRoot":"","sources":["../../src/suites/Ed25519Signature2020.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAsE;AAEtE,iDAAkC;AAClC,uFAAiF;AACjF,qGAA8F;AAE9F;;;;GAIG;AACH,MAAa,0BAA2B,SAAQ,6BA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AAe;YACpB,MAAM,EAAE,MAAM;SACf,CAAC,CAAA;IACJ,CAAC;IAED,uBAAuB;QACrB,OAAO,IAAI,6CAAoB,EAAE,CAAA;IACnC,CAAC;IAED,0BAA0B,CAAC,UAA6B;QACtD,qBAAqB;IACvB,CAAC;IAED,4BAA4B,CAAC,MAAc,EAAE,MAAmB;QAC9D,qBAAqB;IACvB,CAAC;IAED,yBAAyB,CAAC,GAAe;QACvC,MAAM,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC,CAAA;QAC7D,OAAO,GAAG,IAAI,CAAC,0BAA0B,GAAG,GAAG,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,CAAA;IACtF,CAAC;CACF;AApED,gEAoEC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CredentialPayload, DIDDocument, IAgentContext, IKey, TKeyType } from "@veramo/core";
|
|
2
|
-
import { RequiredAgentMethods, VeramoLdSignature } from "../ld-suites
|
|
2
|
+
import { RequiredAgentMethods, VeramoLdSignature } from "../ld-suites";
|
|
3
3
|
/**
|
|
4
4
|
* Veramo wrapper for the JsonWebSignature2020 suite by Transmute Industries
|
|
5
5
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonWebSignature2020.d.ts","sourceRoot":"","sources":["../../src/suites/JsonWebSignature2020.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"JsonWebSignature2020.d.ts","sourceRoot":"","sources":["../../src/suites/JsonWebSignature2020.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAMvE;;;;GAIG;AACH,qBAAa,0BAA2B,SAAQ,iBAAiB;IAC7D,4BAA4B,IAAI,gBAAgB;IAIhD,yBAAyB,IAAI,QAAQ;IAI/B,kBAAkB,CACpB,GAAG,EAAE,IAAI,EACT,SAAS,EAAE,MAAM,EACjB,oBAAoB,EAAE,MAAM,EAC5B,OAAO,EAAE,aAAa,CAAC,oBAAoB,CAAC,GAC7C,OAAO,CAAC,GAAG,CAAC;IA+Cf,uBAAuB,IAAI,GAAG;IAI9B,0BAA0B,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI;IAI/D,4BAA4B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI;CAG1E"}
|