@sphereon/ssi-sdk-ext.key-manager 0.14.0 → 0.14.1-next.6
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/dist/agent/SphereonKeyManager.d.ts +2 -2
- package/dist/agent/SphereonKeyManager.d.ts.map +1 -1
- package/dist/agent/SphereonKeyManager.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/ssi-sdk-ext.key-manager.d.ts +15 -6
- package/dist/types/ISphereonKeyManager.d.ts +12 -6
- package/dist/types/ISphereonKeyManager.d.ts.map +1 -1
- package/package.json +5 -5
- package/plugin.schema.json +6 -99
- package/src/agent/SphereonKeyManager.ts +2 -2
- package/src/index.ts +1 -0
- package/src/types/ISphereonKeyManager.ts +10 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { KeyManager, AbstractKeyManagementSystem, AbstractKeyStore } from '@veramo/key-manager';
|
|
1
|
+
import { KeyManager as VeramoKeyManager, AbstractKeyManagementSystem, AbstractKeyStore } from '@veramo/key-manager';
|
|
2
2
|
import { ISphereonKeyManager, ISphereonKeyManagerSignArgs, ISphereonKeyManagerVerifyArgs } from '../types/ISphereonKeyManager';
|
|
3
|
-
export declare class SphereonKeyManager extends
|
|
3
|
+
export declare class SphereonKeyManager extends VeramoKeyManager {
|
|
4
4
|
private localStore;
|
|
5
5
|
private readonly localKms;
|
|
6
6
|
readonly localMethods: ISphereonKeyManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SphereonKeyManager.d.ts","sourceRoot":"","sources":["../../src/agent/SphereonKeyManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"SphereonKeyManager.d.ts","sourceRoot":"","sources":["../../src/agent/SphereonKeyManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAInH,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAA;AAE9H,qBAAa,kBAAmB,SAAQ,gBAAgB;IACtD,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6C;IACtE,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAA;gBAE9B,OAAO,EAAE;QAAE,KAAK,EAAE,gBAAgB,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAA;KAAE;IASlG,OAAO,CAAC,WAAW;IASb,cAAc,CAAC,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC;IAUlE,gBAAgB,CAAC,IAAI,EAAE,6BAA6B,GAAG,OAAO,CAAC,OAAO,CAAC;CAQ9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SphereonKeyManager.js","sourceRoot":"","sources":["../../src/agent/SphereonKeyManager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"SphereonKeyManager.js","sourceRoot":"","sources":["../../src/agent/SphereonKeyManager.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmH;AAGnH,2EAAsF;AAGtF,MAAa,kBAAmB,SAAQ,wBAAgB;IAKtD,YAAY,OAAsF;QAChG,KAAK,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QACjD,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,KAAK,CAAA;QAC/B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAA;QAC3B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAC5B,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC3D,IAAI,CAAC,YAAY,GAAkC,OAAQ,CAAA;IAC7D,CAAC;IAEO,WAAW,CAAC,IAAY;QAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;QAC/B,IAAI,CAAC,GAAG,EAAE;YACR,MAAM,KAAK,CAAC,iFAAiF,IAAI,GAAG,CAAC,CAAA;SACtG;QACD,OAAO,GAAG,CAAA;IACZ,CAAC;IAED,8EAA8E;IACxE,cAAc,CAAC,IAAiC;;;;;YACpD,MAAM,OAAO,GAAS,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAS,CAAA;YAC/E,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YACzC,IAAI,OAAO,CAAC,IAAI,KAAe,+BAAO,CAAC,UAAU,EAAE;gBACjD,OAAO,MAAM,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAA;aAC1F;YACD,aAAa;YACb,OAAO,MAAM,OAAM,cAAc,YAAC,IAAI,CAAC,CAAA;QACzC,CAAC;KAAA;IAEK,gBAAgB,CAAC,IAAmC;;YACxD,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACtC,IAAI,CAAC,QAAQ,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,MAAM,KAAK,UAAU,CAAC,IAAI,GAAG,YAAY,mDAA2B,EAAE;gBACvG,aAAa;gBACb,OAAO,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;aAC9B;YACD,MAAM,KAAK,CAAC,OAAO,GAAG,gCAAgC,CAAC,CAAA;QACzD,CAAC;KAAA;CACF;AAzCD,gDAyCC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,MAAM,KAAmC,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,CAAA;AACjB,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,cAAc,6BAA6B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,MAAM,KAAmC,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,CAAA;AACjB,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,cAAc,6BAA6B,CAAA;AAC3C,cAAc,qBAAqB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -20,4 +20,5 @@ exports.schema = schema;
|
|
|
20
20
|
var SphereonKeyManager_1 = require("./agent/SphereonKeyManager");
|
|
21
21
|
Object.defineProperty(exports, "SphereonKeyManager", { enumerable: true, get: function () { return SphereonKeyManager_1.SphereonKeyManager; } });
|
|
22
22
|
__exportStar(require("./types/ISphereonKeyManager"), exports);
|
|
23
|
+
__exportStar(require("@veramo/key-manager"), exports);
|
|
23
24
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,MAAM,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AACtC,wBAAM;AACf,iEAA+D;AAAtD,wHAAA,kBAAkB,OAAA;AAC3B,8DAA2C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,MAAM,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAA;AACtC,wBAAM;AACf,iEAA+D;AAAtD,wHAAA,kBAAkB,OAAA;AAC3B,8DAA2C;AAC3C,sDAAmC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { AbstractKeyManagementSystem } from '@veramo/key-manager';
|
|
2
2
|
import { AbstractKeyStore } from '@veramo/key-manager';
|
|
3
|
-
import {
|
|
3
|
+
import { IKeyManager } from '@veramo/core';
|
|
4
4
|
import { IKeyManagerSignArgs } from '@veramo/core';
|
|
5
5
|
import { IPluginMethodMap } from '@veramo/core';
|
|
6
6
|
import { KeyManager } from '@veramo/key-manager';
|
|
7
7
|
import { KeyMetadata } from '@veramo/core';
|
|
8
|
+
import { ManagedKeyInfo } from '@veramo/core';
|
|
8
9
|
import { MinimalImportableKey } from '@veramo/core';
|
|
9
10
|
import { TKeyType } from '@veramo/core';
|
|
10
11
|
|
|
@@ -49,13 +50,16 @@ export declare interface IKeyManagerGetArgs {
|
|
|
49
50
|
kid: string;
|
|
50
51
|
}
|
|
51
52
|
|
|
52
|
-
export declare interface ISphereonKeyManager extends IPluginMethodMap {
|
|
53
|
+
export declare interface ISphereonKeyManager extends IKeyManager, IPluginMethodMap {
|
|
53
54
|
keyManagerCreate(args: IKeyManagerCreateArgs): Promise<PartialKey>;
|
|
54
|
-
keyManagerGetKeyManagementSystems(): Promise<Array<string>>;
|
|
55
|
-
keyManagerGet({ kid }: IKeyManagerGetArgs): Promise<IKey>;
|
|
56
|
-
keyManagerDelete({ kid }: IKeyManagerDeleteArgs): Promise<boolean>;
|
|
57
55
|
keyManagerImport(key: MinimalImportableKey): Promise<PartialKey>;
|
|
58
56
|
keyManagerSign(args: ISphereonKeyManagerSignArgs): Promise<string>;
|
|
57
|
+
/**
|
|
58
|
+
* Verifies a signature using the key
|
|
59
|
+
*
|
|
60
|
+
* Does not exist in IKeyManager
|
|
61
|
+
* @param args
|
|
62
|
+
*/
|
|
59
63
|
keyManagerVerify(args: ISphereonKeyManagerVerifyArgs): Promise<boolean>;
|
|
60
64
|
}
|
|
61
65
|
|
|
@@ -79,7 +83,9 @@ export declare interface ISphereonKeyManagerVerifyArgs {
|
|
|
79
83
|
signature: string;
|
|
80
84
|
}
|
|
81
85
|
|
|
82
|
-
export declare type PartialKey =
|
|
86
|
+
export declare type PartialKey = ManagedKeyInfo & {
|
|
87
|
+
privateKeyHex: string;
|
|
88
|
+
};
|
|
83
89
|
|
|
84
90
|
export declare const schema: any;
|
|
85
91
|
|
|
@@ -96,4 +102,7 @@ export declare class SphereonKeyManager extends KeyManager {
|
|
|
96
102
|
keyManagerVerify(args: ISphereonKeyManagerVerifyArgs): Promise<boolean>;
|
|
97
103
|
}
|
|
98
104
|
|
|
105
|
+
|
|
106
|
+
export * from "@veramo/key-manager";
|
|
107
|
+
|
|
99
108
|
export { }
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import { IPluginMethodMap,
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import { IPluginMethodMap, KeyMetadata, MinimalImportableKey, TKeyType, IKeyManagerSignArgs, IKeyManager } from '@veramo/core';
|
|
2
|
+
import { ManagedKeyInfo } from '@veramo/core';
|
|
3
|
+
export type PartialKey = ManagedKeyInfo & {
|
|
4
|
+
privateKeyHex: string;
|
|
5
|
+
};
|
|
6
|
+
export interface ISphereonKeyManager extends IKeyManager, IPluginMethodMap {
|
|
4
7
|
keyManagerCreate(args: IKeyManagerCreateArgs): Promise<PartialKey>;
|
|
5
|
-
keyManagerGetKeyManagementSystems(): Promise<Array<string>>;
|
|
6
|
-
keyManagerGet({ kid }: IKeyManagerGetArgs): Promise<IKey>;
|
|
7
|
-
keyManagerDelete({ kid }: IKeyManagerDeleteArgs): Promise<boolean>;
|
|
8
8
|
keyManagerImport(key: MinimalImportableKey): Promise<PartialKey>;
|
|
9
9
|
keyManagerSign(args: ISphereonKeyManagerSignArgs): Promise<string>;
|
|
10
|
+
/**
|
|
11
|
+
* Verifies a signature using the key
|
|
12
|
+
*
|
|
13
|
+
* Does not exist in IKeyManager
|
|
14
|
+
* @param args
|
|
15
|
+
*/
|
|
10
16
|
keyManagerVerify(args: ISphereonKeyManagerVerifyArgs): Promise<boolean>;
|
|
11
17
|
}
|
|
12
18
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ISphereonKeyManager.d.ts","sourceRoot":"","sources":["../../src/types/ISphereonKeyManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"ISphereonKeyManager.d.ts","sourceRoot":"","sources":["../../src/types/ISphereonKeyManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,oBAAoB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC9H,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,CAAA;AAEnE,MAAM,WAAW,mBAAoB,SAAQ,WAAW,EAAE,gBAAgB;IACxE,gBAAgB,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAElE,gBAAgB,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAEhE,cAAc,CAAC,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAElE;;;;;OAKG;IACH,gBAAgB,CAAC,IAAI,EAAE,6BAA6B,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CACxE;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAA;IAEd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IAEX;;OAEG;IACH,IAAI,CAAC,EAAE,WAAW,CAAA;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;CACZ;AAED;;;GAGG;AAEH,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;IACtE;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,UAAU,CAAA;CAC1B;AAED,MAAM,WAAW,6BAA6B;IAC5C,GAAG,EAAE,MAAM,CAAA;IACX,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,QAAQ,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,UAAU,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;CAClB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk-ext.key-manager",
|
|
3
3
|
"description": "Sphereon Key Manager plugin with BLS support",
|
|
4
|
-
"version": "0.14.
|
|
4
|
+
"version": "0.14.1-next.6+e3c4771",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
14
|
"build": "tsc --build",
|
|
15
|
-
"generate-plugin-schema": "
|
|
15
|
+
"generate-plugin-schema": "sphereon dev generate-plugin-schema"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@mattrglobal/bbs-signatures": "^1.1.0",
|
|
19
|
-
"@sphereon/ssi-sdk-ext.kms-local": "^0.14.
|
|
19
|
+
"@sphereon/ssi-sdk-ext.kms-local": "^0.14.1-next.6+e3c4771",
|
|
20
20
|
"@veramo/core": "4.2.0",
|
|
21
21
|
"@veramo/key-manager": "4.2.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@
|
|
24
|
+
"@sphereon/ssi-sdk.dev": "^0.15.1"
|
|
25
25
|
},
|
|
26
26
|
"resolutions": {
|
|
27
27
|
"jsonld": "npm:@digitalcredentials/jsonld@^5.2.1",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"kms",
|
|
46
46
|
"Veramo"
|
|
47
47
|
],
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "e3c47715c8d751bc2ec75bdd1ed1e4965650c947"
|
|
49
49
|
}
|
package/plugin.schema.json
CHANGED
|
@@ -52,68 +52,9 @@
|
|
|
52
52
|
"PartialKey": {
|
|
53
53
|
"type": "object",
|
|
54
54
|
"properties": {
|
|
55
|
-
"kid": {
|
|
56
|
-
"type": "string",
|
|
57
|
-
"description": "Key ID"
|
|
58
|
-
},
|
|
59
|
-
"kms": {
|
|
60
|
-
"type": "string",
|
|
61
|
-
"description": "Key Management System"
|
|
62
|
-
},
|
|
63
|
-
"type": {
|
|
64
|
-
"$ref": "#/components/schemas/TKeyType",
|
|
65
|
-
"description": "Key type"
|
|
66
|
-
},
|
|
67
|
-
"publicKeyHex": {
|
|
68
|
-
"type": "string",
|
|
69
|
-
"description": "Public key"
|
|
70
|
-
},
|
|
71
55
|
"privateKeyHex": {
|
|
72
|
-
"type": "string"
|
|
73
|
-
"description": "Optional. Private key"
|
|
56
|
+
"type": "string"
|
|
74
57
|
},
|
|
75
|
-
"meta": {
|
|
76
|
-
"anyOf": [
|
|
77
|
-
{
|
|
78
|
-
"$ref": "#/components/schemas/KeyMetadata"
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
"type": "null"
|
|
82
|
-
}
|
|
83
|
-
],
|
|
84
|
-
"description": "Optional. Key metadata. This should be used to determine which algorithms are supported."
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
"IKeyManagerDeleteArgs": {
|
|
89
|
-
"type": "object",
|
|
90
|
-
"properties": {
|
|
91
|
-
"kid": {
|
|
92
|
-
"type": "string",
|
|
93
|
-
"description": "Key ID"
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
"required": [
|
|
97
|
-
"kid"
|
|
98
|
-
],
|
|
99
|
-
"description": "Input arguments for {@link ISphereonKeyManager.keyManagerDelete | keyManagerDelete }"
|
|
100
|
-
},
|
|
101
|
-
"IKeyManagerGetArgs": {
|
|
102
|
-
"type": "object",
|
|
103
|
-
"properties": {
|
|
104
|
-
"kid": {
|
|
105
|
-
"type": "string",
|
|
106
|
-
"description": "Key ID"
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
"required": [
|
|
110
|
-
"kid"
|
|
111
|
-
],
|
|
112
|
-
"description": "Input arguments for {@link ISphereonKeyManager.keyManagerGet | keyManagerGet }"
|
|
113
|
-
},
|
|
114
|
-
"IKey": {
|
|
115
|
-
"type": "object",
|
|
116
|
-
"properties": {
|
|
117
58
|
"kid": {
|
|
118
59
|
"type": "string",
|
|
119
60
|
"description": "Key ID"
|
|
@@ -130,10 +71,6 @@
|
|
|
130
71
|
"type": "string",
|
|
131
72
|
"description": "Public key"
|
|
132
73
|
},
|
|
133
|
-
"privateKeyHex": {
|
|
134
|
-
"type": "string",
|
|
135
|
-
"description": "Optional. Private key"
|
|
136
|
-
},
|
|
137
74
|
"meta": {
|
|
138
75
|
"anyOf": [
|
|
139
76
|
{
|
|
@@ -149,10 +86,10 @@
|
|
|
149
86
|
"required": [
|
|
150
87
|
"kid",
|
|
151
88
|
"kms",
|
|
152
|
-
"
|
|
153
|
-
"publicKeyHex"
|
|
154
|
-
|
|
155
|
-
|
|
89
|
+
"privateKeyHex",
|
|
90
|
+
"publicKeyHex",
|
|
91
|
+
"type"
|
|
92
|
+
]
|
|
156
93
|
},
|
|
157
94
|
"MinimalImportableKey": {
|
|
158
95
|
"$ref": "#/components/schemas/RequireOnly<IKey,(\"privateKeyHex\"|\"type\"|\"kms\")>",
|
|
@@ -355,36 +292,6 @@
|
|
|
355
292
|
"$ref": "#/components/schemas/PartialKey"
|
|
356
293
|
}
|
|
357
294
|
},
|
|
358
|
-
"keyManagerDelete": {
|
|
359
|
-
"description": "",
|
|
360
|
-
"arguments": {
|
|
361
|
-
"$ref": "#/components/schemas/IKeyManagerDeleteArgs"
|
|
362
|
-
},
|
|
363
|
-
"returnType": {
|
|
364
|
-
"type": "boolean"
|
|
365
|
-
}
|
|
366
|
-
},
|
|
367
|
-
"keyManagerGet": {
|
|
368
|
-
"description": "",
|
|
369
|
-
"arguments": {
|
|
370
|
-
"$ref": "#/components/schemas/IKeyManagerGetArgs"
|
|
371
|
-
},
|
|
372
|
-
"returnType": {
|
|
373
|
-
"$ref": "#/components/schemas/IKey"
|
|
374
|
-
}
|
|
375
|
-
},
|
|
376
|
-
"keyManagerGetKeyManagementSystems": {
|
|
377
|
-
"description": "",
|
|
378
|
-
"arguments": {
|
|
379
|
-
"type": "object"
|
|
380
|
-
},
|
|
381
|
-
"returnType": {
|
|
382
|
-
"type": "array",
|
|
383
|
-
"items": {
|
|
384
|
-
"type": "string"
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
},
|
|
388
295
|
"keyManagerImport": {
|
|
389
296
|
"description": "",
|
|
390
297
|
"arguments": {
|
|
@@ -404,7 +311,7 @@
|
|
|
404
311
|
}
|
|
405
312
|
},
|
|
406
313
|
"keyManagerVerify": {
|
|
407
|
-
"description": "",
|
|
314
|
+
"description": "Verifies a signature using the key",
|
|
408
315
|
"arguments": {
|
|
409
316
|
"$ref": "#/components/schemas/ISphereonKeyManagerVerifyArgs"
|
|
410
317
|
},
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { KeyManager, AbstractKeyManagementSystem, AbstractKeyStore } from '@veramo/key-manager'
|
|
1
|
+
import { KeyManager as VeramoKeyManager, AbstractKeyManagementSystem, AbstractKeyStore } from '@veramo/key-manager'
|
|
2
2
|
|
|
3
3
|
import { IKey, TKeyType } from '@veramo/core'
|
|
4
4
|
import { KeyType, SphereonKeyManagementSystem } from '@sphereon/ssi-sdk-ext.kms-local'
|
|
5
5
|
import { ISphereonKeyManager, ISphereonKeyManagerSignArgs, ISphereonKeyManagerVerifyArgs } from '../types/ISphereonKeyManager'
|
|
6
6
|
|
|
7
|
-
export class SphereonKeyManager extends
|
|
7
|
+
export class SphereonKeyManager extends VeramoKeyManager {
|
|
8
8
|
private localStore: AbstractKeyStore
|
|
9
9
|
private readonly localKms: Record<string, AbstractKeyManagementSystem>
|
|
10
10
|
readonly localMethods: ISphereonKeyManager
|
package/src/index.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { IPluginMethodMap,
|
|
1
|
+
import { IPluginMethodMap, KeyMetadata, MinimalImportableKey, TKeyType, IKeyManagerSignArgs, IKeyManager } from '@veramo/core'
|
|
2
|
+
import { ManagedKeyInfo } from '@veramo/core'
|
|
2
3
|
|
|
3
|
-
export type PartialKey =
|
|
4
|
+
export type PartialKey = ManagedKeyInfo & { privateKeyHex: string }
|
|
4
5
|
|
|
5
|
-
export interface ISphereonKeyManager extends IPluginMethodMap {
|
|
6
|
+
export interface ISphereonKeyManager extends IKeyManager, IPluginMethodMap {
|
|
6
7
|
keyManagerCreate(args: IKeyManagerCreateArgs): Promise<PartialKey>
|
|
7
8
|
|
|
8
|
-
keyManagerGetKeyManagementSystems(): Promise<Array<string>>
|
|
9
|
-
|
|
10
|
-
keyManagerGet({ kid }: IKeyManagerGetArgs): Promise<IKey>
|
|
11
|
-
|
|
12
|
-
keyManagerDelete({ kid }: IKeyManagerDeleteArgs): Promise<boolean>
|
|
13
|
-
|
|
14
9
|
keyManagerImport(key: MinimalImportableKey): Promise<PartialKey>
|
|
15
10
|
|
|
16
11
|
keyManagerSign(args: ISphereonKeyManagerSignArgs): Promise<string>
|
|
17
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Verifies a signature using the key
|
|
15
|
+
*
|
|
16
|
+
* Does not exist in IKeyManager
|
|
17
|
+
* @param args
|
|
18
|
+
*/
|
|
18
19
|
keyManagerVerify(args: ISphereonKeyManagerVerifyArgs): Promise<boolean>
|
|
19
20
|
}
|
|
20
21
|
|