@sphereon/ssi-sdk.oidf-client 0.30.2-feature.SPRIND.84.145 → 0.30.2-feature.SPRIND.92.151
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/OIDFClient.d.ts +3 -2
- package/dist/agent/OIDFClient.d.ts.map +1 -1
- package/dist/agent/OIDFClient.js +7 -31
- package/dist/agent/OIDFClient.js.map +1 -1
- package/dist/ssi-sdk.oidf-client.d.ts +6 -5
- package/dist/types/IOIDFClient.d.ts +1 -1
- package/dist/types/IOIDFClient.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/agent/OIDFClient.ts +12 -36
- package/src/types/IOIDFClient.ts +1 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { IAgentPlugin } from "@veramo/core";
|
|
2
2
|
import { IOIDFClient, OIDFClientArgs } from '../types/IOIDFClient';
|
|
3
|
+
import { com } from '@sphereon/openid-federation-client';
|
|
4
|
+
import FederationClient = com.sphereon.oid.fed.client.FederationClient;
|
|
3
5
|
export declare const oidfClientMethods: Array<string>;
|
|
4
6
|
export declare class OIDFClient implements IAgentPlugin {
|
|
5
|
-
|
|
7
|
+
readonly oidfClient: FederationClient;
|
|
6
8
|
readonly schema: any;
|
|
7
9
|
constructor(args?: OIDFClientArgs);
|
|
8
10
|
readonly methods: IOIDFClient;
|
|
9
11
|
private resolveTrustChain;
|
|
10
|
-
private checkAndSetDefaultCryptoService;
|
|
11
12
|
private signJwt;
|
|
12
13
|
private verifyJwt;
|
|
13
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OIDFClient.d.ts","sourceRoot":"","sources":["../../src/agent/OIDFClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAO1C,OAAO,EACH,WAAW,EACX,cAAc,EAIjB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"OIDFClient.d.ts","sourceRoot":"","sources":["../../src/agent/OIDFClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,cAAc,CAAC;AAO1C,OAAO,EACH,WAAW,EACX,cAAc,EAIjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,oCAAoC,CAAC;AAEzD,OAAO,gBAAgB,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC;AAKvE,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAI3C,CAAA;AAED,qBAAa,UAAW,YAAW,YAAY;IAC3C,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAA;IACrC,QAAQ,CAAC,MAAM,MAAqB;gBAExB,IAAI,CAAC,EAAE,cAAc;IAWjC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAI5B;YAEa,iBAAiB;YAKjB,OAAO;YAIP,SAAS;CAG1B"}
|
package/dist/agent/OIDFClient.js
CHANGED
|
@@ -30,44 +30,20 @@ class OIDFClient {
|
|
|
30
30
|
verifyJwt: this.verifyJwt.bind(this)
|
|
31
31
|
};
|
|
32
32
|
const { cryptoServiceCallback } = Object.assign({}, args);
|
|
33
|
-
|
|
33
|
+
DefaultCallbacks.setFetchServiceDefault(new DefaultFetchJSImpl());
|
|
34
|
+
DefaultCallbacks.setTrustChainServiceDefault(new DefaultTrustChainJSImpl());
|
|
35
|
+
if (cryptoServiceCallback) {
|
|
34
36
|
DefaultCallbacks.setCryptoServiceDefault(cryptoServiceCallback);
|
|
35
|
-
DefaultCallbacks.setFetchServiceDefault(new DefaultFetchJSImpl());
|
|
36
|
-
// Depends on the crypto and fetch services, thus it must be the last one to be set
|
|
37
|
-
DefaultCallbacks.setTrustChainServiceDefault(new DefaultTrustChainJSImpl());
|
|
38
|
-
this.oidfClient = new FederationClient();
|
|
39
37
|
}
|
|
38
|
+
//FIXME set default Federation client crypto callback
|
|
39
|
+
this.oidfClient = new FederationClient();
|
|
40
40
|
}
|
|
41
|
-
resolveTrustChain(args
|
|
41
|
+
resolveTrustChain(args) {
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
var _a;
|
|
44
43
|
const { entityIdentifier, trustAnchors } = args;
|
|
45
|
-
this.
|
|
46
|
-
return yield ((_a = this.oidfClient) === null || _a === void 0 ? void 0 : _a.resolveTrustChain(entityIdentifier, trustAnchors));
|
|
44
|
+
return yield this.oidfClient.resolveTrustChain(entityIdentifier, trustAnchors);
|
|
47
45
|
});
|
|
48
46
|
}
|
|
49
|
-
checkAndSetDefaultCryptoService(context) {
|
|
50
|
-
if ((context.agent.jwtVerifyJwsSignature !== undefined &&
|
|
51
|
-
context.agent.jwtVerifyJwsSignature !== null) &&
|
|
52
|
-
(DefaultCallbacks.jwtService() === undefined || DefaultCallbacks.jwtService() === null)) {
|
|
53
|
-
try {
|
|
54
|
-
DefaultCallbacks.setCryptoServiceDefault({
|
|
55
|
-
verify: (jwt, key) => __awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
return !(yield context.agent.jwtVerifyJwsSignature({
|
|
57
|
-
jws: jwt,
|
|
58
|
-
jwk: key
|
|
59
|
-
})).error;
|
|
60
|
-
})
|
|
61
|
-
});
|
|
62
|
-
DefaultCallbacks.setFetchServiceDefault(new DefaultFetchJSImpl());
|
|
63
|
-
DefaultCallbacks.setTrustChainServiceDefault(new DefaultTrustChainJSImpl());
|
|
64
|
-
this.oidfClient = new FederationClient();
|
|
65
|
-
}
|
|
66
|
-
catch (error) {
|
|
67
|
-
throw Error(`Could not initialize the federation client: ${error.message}`);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
47
|
signJwt(args, context) {
|
|
72
48
|
return __awaiter(this, void 0, void 0, function* () {
|
|
73
49
|
return yield context.agent.jwtCreateJwsCompactSignature(args);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OIDFClient.js","sourceRoot":"","sources":["../../src/agent/OIDFClient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAcA,
|
|
1
|
+
{"version":3,"file":"OIDFClient.js","sourceRoot":"","sources":["../../src/agent/OIDFClient.ts"],"names":[],"mappings":";;;;;;;;;;;;AAcA,iFAAyD;AACzD,oCAAgC;AAChC,IAAO,gBAAgB,GAAG,8BAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC;AACvE,IAAO,kBAAkB,GAAG,8BAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAA;AAChF,IAAO,uBAAuB,GAAG,8BAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,uBAAuB,CAAA;AAC/F,IAAO,gBAAgB,GAAG,8BAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAA;AAEjE,QAAA,iBAAiB,GAAkB;IAC5C,mBAAmB;IACnB,SAAS;IACT,WAAW;CACd,CAAA;AAED,MAAa,UAAU;IAInB,YAAY,IAAqB;QAFxB,WAAM,GAAG,cAAM,CAAC,WAAW,CAAA;QAa3B,YAAO,GAAgB;YAC5B,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC;YACpD,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YAChC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;SACvC,CAAA;QAdG,MAAM,EAAE,qBAAqB,EAAE,qBAAQ,IAAI,CAAE,CAAA;QAC7C,gBAAgB,CAAC,sBAAsB,CAAC,IAAI,kBAAkB,EAAE,CAAC,CAAA;QACjE,gBAAgB,CAAC,2BAA2B,CAAC,IAAI,uBAAuB,EAAE,CAAC,CAAA;QAC3E,IAAI,qBAAqB,EAAE,CAAC;YACxB,gBAAgB,CAAC,uBAAuB,CAAC,qBAAqB,CAAC,CAAA;QACnE,CAAC;QACD,qDAAqD;QACrD,IAAI,CAAC,UAAU,GAAG,IAAI,gBAAgB,EAAE,CAAA;IAC5C,CAAC;IAQa,iBAAiB,CAAC,IAA2B;;YACvD,MAAM,EAAE,gBAAgB,EAAE,YAAY,EAAE,GAAG,IAAI,CAAA;YAC/C,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAA;QAClF,CAAC;KAAA;IAEa,OAAO,CAAC,IAA0B,EAAE,OAAwB;;YACtE,OAAO,MAAM,OAAO,CAAC,KAAK,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAA;QACjE,CAAC;KAAA;IAEa,SAAS,CAAC,IAAmB,EAAE,OAAwB;;YACjE,OAAO,MAAM,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAA;QAC1D,CAAC;KAAA;CACJ;AAjCD,gCAiCC"}
|
|
@@ -11,22 +11,23 @@ import { VerifyJwsArgs } from '@sphereon/ssi-sdk-ext.jwt-service';
|
|
|
11
11
|
export declare type CryptoServiceCallbackArgs = ICryptoCallbackServiceJS;
|
|
12
12
|
|
|
13
13
|
export declare interface IOIDFClient extends IPluginMethodMap {
|
|
14
|
-
resolveTrustChain(args: ResolveTrustChainArgs
|
|
14
|
+
resolveTrustChain(args: ResolveTrustChainArgs): Promise<ResolveTrustChainCallbackResult>;
|
|
15
15
|
signJwt(args: CreateJwsCompactArgs, context: RequiredContext): Promise<JwtCompactResult>;
|
|
16
16
|
verifyJwt(args: VerifyJwsArgs, context: RequiredContext): Promise<IJwsValidationResult>;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export declare const logger: ISimpleLogger<unknown>;
|
|
20
20
|
|
|
21
|
-
declare type Nullable<T> = T | null | undefined
|
|
21
|
+
declare type Nullable<T> = T | null | undefined
|
|
22
|
+
|
|
23
|
+
declare type Nullable_2<T> = T | null | undefined;
|
|
22
24
|
|
|
23
25
|
export declare class OIDFClient implements IAgentPlugin {
|
|
24
|
-
|
|
26
|
+
readonly oidfClient: FederationClient;
|
|
25
27
|
readonly schema: any;
|
|
26
28
|
constructor(args?: OIDFClientArgs);
|
|
27
29
|
readonly methods: IOIDFClient;
|
|
28
30
|
private resolveTrustChain;
|
|
29
|
-
private checkAndSetDefaultCryptoService;
|
|
30
31
|
private signJwt;
|
|
31
32
|
private verifyJwt;
|
|
32
33
|
}
|
|
@@ -44,7 +45,7 @@ export declare type ResolveTrustChainArgs = {
|
|
|
44
45
|
trustAnchors: Array<string>;
|
|
45
46
|
};
|
|
46
47
|
|
|
47
|
-
export declare type ResolveTrustChainCallbackResult =
|
|
48
|
+
export declare type ResolveTrustChainCallbackResult = Nullable_2<Array<string>>;
|
|
48
49
|
|
|
49
50
|
/**
|
|
50
51
|
* @public
|
|
@@ -3,7 +3,7 @@ import { com } from '@sphereon/openid-federation-client';
|
|
|
3
3
|
import ICryptoCallbackServiceJS = com.sphereon.oid.fed.client.crypto.ICryptoCallbackServiceJS;
|
|
4
4
|
import { CreateJwsCompactArgs, IJwsValidationResult, IJwtService, JwtCompactResult, VerifyJwsArgs } from '@sphereon/ssi-sdk-ext.jwt-service';
|
|
5
5
|
export interface IOIDFClient extends IPluginMethodMap {
|
|
6
|
-
resolveTrustChain(args: ResolveTrustChainArgs
|
|
6
|
+
resolveTrustChain(args: ResolveTrustChainArgs): Promise<ResolveTrustChainCallbackResult>;
|
|
7
7
|
signJwt(args: CreateJwsCompactArgs, context: RequiredContext): Promise<JwtCompactResult>;
|
|
8
8
|
verifyJwt(args: VerifyJwsArgs, context: RequiredContext): Promise<IJwsValidationResult>;
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IOIDFClient.d.ts","sourceRoot":"","sources":["../../src/types/IOIDFClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,GAAG,EAAE,MAAM,oCAAoC,CAAC;AACzD,OAAO,wBAAwB,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC;AAC9F,OAAO,EACH,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,EACX,gBAAgB,EAChB,aAAa,EAChB,MAAM,mCAAmC,CAAC;AAE3C,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACjD,iBAAiB,CAAC,IAAI,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"IOIDFClient.d.ts","sourceRoot":"","sources":["../../src/types/IOIDFClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,GAAG,EAAE,MAAM,oCAAoC,CAAC;AACzD,OAAO,wBAAwB,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC;AAC9F,OAAO,EACH,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,EACX,gBAAgB,EAChB,aAAa,EAChB,MAAM,mCAAmC,CAAC;AAE3C,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACjD,iBAAiB,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAAA;IACxF,OAAO,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,eAAe,GAAI,OAAO,CAAC,gBAAgB,CAAC,CAAA;IACzF,SAAS,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;CAC1F;AAED,MAAM,MAAM,qBAAqB,GAAG;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IACzB,qBAAqB,CAAC,EAAE,yBAAyB,CAAA;CACpD,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG,wBAAwB,CAAA;AAEhE,KAAK,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,SAAS,CAAA;AAEvC,MAAM,MAAM,+BAA+B,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA;AAErE,MAAM,MAAM,eAAe,GAAG,aAAa,CAAC,WAAW,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk.oidf-client",
|
|
3
|
-
"version": "0.30.2-feature.SPRIND.
|
|
3
|
+
"version": "0.30.2-feature.SPRIND.92.151+b2f6ed99",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"@sphereon/openid-federation-common": "0.1.0-unstable.151480d",
|
|
20
20
|
"@sphereon/openid-federation-open-api": "0.1.0-unstable.151480d",
|
|
21
21
|
"@sphereon/ssi-sdk-ext.jwt-service": "^0.24.1-unstable.130",
|
|
22
|
-
"@sphereon/ssi-types": "0.30.2-feature.SPRIND.
|
|
22
|
+
"@sphereon/ssi-types": "0.30.2-feature.SPRIND.92.151+b2f6ed99"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@sphereon/ssi-sdk.agent-config": "0.30.2-feature.SPRIND.
|
|
25
|
+
"@sphereon/ssi-sdk.agent-config": "0.30.2-feature.SPRIND.92.151+b2f6ed99",
|
|
26
26
|
"@veramo/remote-client": "4.2.0",
|
|
27
27
|
"@veramo/remote-server": "4.2.0",
|
|
28
28
|
"cross-fetch": "^3.1.8",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"Veramo",
|
|
50
50
|
"OpenID Federation"
|
|
51
51
|
],
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "b2f6ed99b66f409ce9cfe2e8fdafbba01842033b"
|
|
53
53
|
}
|
package/src/agent/OIDFClient.ts
CHANGED
|
@@ -12,12 +12,12 @@ import {
|
|
|
12
12
|
ResolveTrustChainArgs,
|
|
13
13
|
ResolveTrustChainCallbackResult
|
|
14
14
|
} from '../types/IOIDFClient';
|
|
15
|
-
import {com} from '@sphereon/openid-federation-client';
|
|
15
|
+
import { com } from '@sphereon/openid-federation-client';
|
|
16
16
|
import {schema} from '../index';
|
|
17
17
|
import FederationClient = com.sphereon.oid.fed.client.FederationClient;
|
|
18
|
-
import DefaultFetchJSImpl = com.sphereon.oid.fed.client.fetch.DefaultFetchJSImpl
|
|
19
|
-
import DefaultTrustChainJSImpl = com.sphereon.oid.fed.client.trustchain.DefaultTrustChainJSImpl
|
|
20
|
-
import DefaultCallbacks = com.sphereon.oid.fed.client.service.DefaultCallbacks
|
|
18
|
+
import DefaultFetchJSImpl = com.sphereon.oid.fed.client.fetch.DefaultFetchJSImpl
|
|
19
|
+
import DefaultTrustChainJSImpl = com.sphereon.oid.fed.client.trustchain.DefaultTrustChainJSImpl
|
|
20
|
+
import DefaultCallbacks = com.sphereon.oid.fed.client.service.DefaultCallbacks
|
|
21
21
|
|
|
22
22
|
export const oidfClientMethods: Array<string> = [
|
|
23
23
|
'resolveTrustChain',
|
|
@@ -26,19 +26,18 @@ export const oidfClientMethods: Array<string> = [
|
|
|
26
26
|
]
|
|
27
27
|
|
|
28
28
|
export class OIDFClient implements IAgentPlugin {
|
|
29
|
-
|
|
29
|
+
readonly oidfClient: FederationClient
|
|
30
30
|
readonly schema = schema.IOIDFClient
|
|
31
31
|
|
|
32
32
|
constructor(args?: OIDFClientArgs) {
|
|
33
33
|
const { cryptoServiceCallback } = { ...args }
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
DefaultCallbacks.setFetchServiceDefault(new DefaultFetchJSImpl())
|
|
35
|
+
DefaultCallbacks.setTrustChainServiceDefault(new DefaultTrustChainJSImpl())
|
|
36
|
+
if (cryptoServiceCallback) {
|
|
36
37
|
DefaultCallbacks.setCryptoServiceDefault(cryptoServiceCallback)
|
|
37
|
-
DefaultCallbacks.setFetchServiceDefault(new DefaultFetchJSImpl())
|
|
38
|
-
// Depends on the crypto and fetch services, thus it must be the last one to be set
|
|
39
|
-
DefaultCallbacks.setTrustChainServiceDefault(new DefaultTrustChainJSImpl())
|
|
40
|
-
this.oidfClient = new FederationClient()
|
|
41
38
|
}
|
|
39
|
+
//FIXME set default Federation client crypto callback
|
|
40
|
+
this.oidfClient = new FederationClient()
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
readonly methods: IOIDFClient = {
|
|
@@ -47,32 +46,9 @@ export class OIDFClient implements IAgentPlugin {
|
|
|
47
46
|
verifyJwt: this.verifyJwt.bind(this)
|
|
48
47
|
}
|
|
49
48
|
|
|
50
|
-
private async resolveTrustChain(args: ResolveTrustChainArgs
|
|
49
|
+
private async resolveTrustChain(args: ResolveTrustChainArgs): Promise<ResolveTrustChainCallbackResult> {
|
|
51
50
|
const { entityIdentifier, trustAnchors } = args
|
|
52
|
-
this.
|
|
53
|
-
return await this.oidfClient?.resolveTrustChain(entityIdentifier, trustAnchors)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
private checkAndSetDefaultCryptoService(context: RequiredContext) {
|
|
57
|
-
if ((context.agent.jwtVerifyJwsSignature !== undefined &&
|
|
58
|
-
context.agent.jwtVerifyJwsSignature !== null) &&
|
|
59
|
-
(DefaultCallbacks.jwtService() === undefined || DefaultCallbacks.jwtService() === null)) {
|
|
60
|
-
try {
|
|
61
|
-
DefaultCallbacks.setCryptoServiceDefault({
|
|
62
|
-
verify: async (jwt: string, key: any): Promise<boolean> => {
|
|
63
|
-
return !(await context.agent.jwtVerifyJwsSignature({
|
|
64
|
-
jws: jwt,
|
|
65
|
-
jwk: key
|
|
66
|
-
})).error
|
|
67
|
-
}
|
|
68
|
-
})
|
|
69
|
-
DefaultCallbacks.setFetchServiceDefault(new DefaultFetchJSImpl())
|
|
70
|
-
DefaultCallbacks.setTrustChainServiceDefault(new DefaultTrustChainJSImpl())
|
|
71
|
-
this.oidfClient = new FederationClient()
|
|
72
|
-
} catch (error) {
|
|
73
|
-
throw Error(`Could not initialize the federation client: ${error.message}`)
|
|
74
|
-
}
|
|
75
|
-
}
|
|
51
|
+
return await this.oidfClient.resolveTrustChain(entityIdentifier, trustAnchors)
|
|
76
52
|
}
|
|
77
53
|
|
|
78
54
|
private async signJwt(args: CreateJwsCompactArgs, context: RequiredContext): Promise<JwtCompactResult> {
|
package/src/types/IOIDFClient.ts
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from '@sphereon/ssi-sdk-ext.jwt-service';
|
|
11
11
|
|
|
12
12
|
export interface IOIDFClient extends IPluginMethodMap {
|
|
13
|
-
resolveTrustChain(args: ResolveTrustChainArgs
|
|
13
|
+
resolveTrustChain(args: ResolveTrustChainArgs): Promise<ResolveTrustChainCallbackResult>
|
|
14
14
|
signJwt(args: CreateJwsCompactArgs, context: RequiredContext ): Promise<JwtCompactResult>
|
|
15
15
|
verifyJwt(args: VerifyJwsArgs, context: RequiredContext): Promise<IJwsValidationResult>
|
|
16
16
|
}
|