@sphereon/ssi-sdk.mdl-mdoc 0.34.1-feature.SSISDK.26.RP.55 → 0.34.1-feature.SSISDK.26.RP.57
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/index.cjs +21 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +51 -51
- package/dist/index.d.ts +51 -51
- package/dist/index.js +21 -19
- package/dist/index.js.map +1 -1
- package/package.json +13 -13
- package/src/agent/mDLMdoc.ts +5 -4
- package/src/types/ImDLMdoc.ts +27 -26
package/dist/index.d.cts
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
import * as _sphereon_ssi_types from '@sphereon/ssi-types';
|
|
2
2
|
import { IPluginMethodMap, IAgentContext, IDIDManager, IResolver, IAgentPlugin } from '@veramo/core';
|
|
3
|
-
import * as
|
|
4
|
-
import { Nullable } from '@sphereon/kmp-mdoc-core';
|
|
3
|
+
import * as mdocPkg from '@sphereon/kmp-mdoc-core';
|
|
4
|
+
import mdocPkg__default, { Nullable } from '@sphereon/kmp-mdoc-core';
|
|
5
5
|
import { PresentationDefinitionV2, PresentationSubmission } from '@sphereon/pex-models';
|
|
6
6
|
import { ISphereonKeyManager } from '@sphereon/ssi-sdk-ext.key-manager';
|
|
7
7
|
import { X509ValidationResult, SubjectAlternativeGeneralName, CertificateInfo } from '@sphereon/ssi-sdk-ext.x509-utils';
|
|
8
8
|
|
|
9
|
-
type IKey$1 =
|
|
10
|
-
type CoseSign1Json =
|
|
11
|
-
type CoseSign1Cbor<Any> =
|
|
12
|
-
type ICoseKeyCbor$1 =
|
|
13
|
-
type ICoseKeyJson =
|
|
14
|
-
type IKeyInfo<KT extends IKey$1 = IKey$1> =
|
|
15
|
-
type IVerifyResults<KT extends IKey$1> =
|
|
16
|
-
type IVerifySignatureResult<KT extends IKey$1> =
|
|
17
|
-
type DocumentJson =
|
|
18
|
-
type DocumentCbor =
|
|
19
|
-
declare const CborByteString: typeof
|
|
20
|
-
declare const CoseKeyCbor: typeof
|
|
21
|
-
declare const CoseCryptoServiceJS: typeof
|
|
9
|
+
type IKey$1 = mdocPkg__default.com.sphereon.crypto.IKey;
|
|
10
|
+
type CoseSign1Json = mdocPkg__default.com.sphereon.crypto.cose.CoseSign1Json;
|
|
11
|
+
type CoseSign1Cbor<Any> = mdocPkg__default.com.sphereon.crypto.cose.CoseSign1Cbor<Any>;
|
|
12
|
+
type ICoseKeyCbor$1 = mdocPkg__default.com.sphereon.crypto.cose.ICoseKeyCbor;
|
|
13
|
+
type ICoseKeyJson = mdocPkg__default.com.sphereon.crypto.cose.ICoseKeyJson;
|
|
14
|
+
type IKeyInfo<KT extends IKey$1 = IKey$1> = mdocPkg__default.com.sphereon.crypto.IKeyInfo<KT>;
|
|
15
|
+
type IVerifyResults<KT extends IKey$1> = mdocPkg__default.com.sphereon.crypto.generic.IVerifyResults<KT>;
|
|
16
|
+
type IVerifySignatureResult<KT extends IKey$1> = mdocPkg__default.com.sphereon.crypto.generic.IVerifySignatureResult<KT>;
|
|
17
|
+
type DocumentJson = mdocPkg__default.com.sphereon.mdoc.data.device.DocumentJson;
|
|
18
|
+
type DocumentCbor = mdocPkg__default.com.sphereon.mdoc.data.device.DocumentCbor;
|
|
19
|
+
declare const CborByteString: typeof mdocPkg__default.com.sphereon.cbor.CborByteString;
|
|
20
|
+
declare const CoseKeyCbor: typeof mdocPkg__default.com.sphereon.crypto.cose.CoseKeyCbor;
|
|
21
|
+
declare const CoseCryptoServiceJS: typeof mdocPkg__default.com.sphereon.crypto.CoseCryptoServiceJS;
|
|
22
22
|
declare const CoseJoseKeyMappingService: {
|
|
23
|
-
toJoseJwk(key:
|
|
24
|
-
toCoseKey(key:
|
|
25
|
-
getJoseX5c(key:
|
|
26
|
-
toJoseX5c(x5c:
|
|
27
|
-
toJwkKeyInfo(keyInfo:
|
|
28
|
-
toResolvedJwkKeyInfo(resolvedKeyInfo:
|
|
29
|
-
toCoseKeyInfo(keyInfo:
|
|
30
|
-
toResolvedCoseKeyInfo(resolvedKeyInfo:
|
|
31
|
-
isResolvedKeyInfo(keyInfo:
|
|
32
|
-
toResolvedKeyInfo<KeyType extends
|
|
33
|
-
toResolvedKeyInfoWithResolver<KeyType extends
|
|
34
|
-
getCoseX5chain(key:
|
|
35
|
-
toCoseX5chain(x5c:
|
|
23
|
+
toJoseJwk(key: mdocPkg__default.com.sphereon.crypto.IKey): mdocPkg__default.com.sphereon.crypto.jose.Jwk;
|
|
24
|
+
toCoseKey(key: mdocPkg__default.com.sphereon.crypto.IKey): mdocPkg__default.com.sphereon.crypto.cose.CoseKeyCbor;
|
|
25
|
+
getJoseX5c(key: mdocPkg__default.com.sphereon.crypto.IKey): mdocPkg__default.Nullable<Array<string>>;
|
|
26
|
+
toJoseX5c(x5c: mdocPkg__default.Nullable<Array<any>>): mdocPkg__default.Nullable<Array<string>>;
|
|
27
|
+
toJwkKeyInfo(keyInfo: mdocPkg__default.com.sphereon.crypto.IKeyInfo<any>): mdocPkg__default.com.sphereon.crypto.KeyInfo<mdocPkg__default.com.sphereon.crypto.jose.Jwk>;
|
|
28
|
+
toResolvedJwkKeyInfo(resolvedKeyInfo: mdocPkg__default.com.sphereon.crypto.IResolvedKeyInfo<any>): mdocPkg__default.com.sphereon.crypto.ResolvedKeyInfo<mdocPkg__default.com.sphereon.crypto.jose.Jwk>;
|
|
29
|
+
toCoseKeyInfo(keyInfo: mdocPkg__default.com.sphereon.crypto.IKeyInfo<any>): mdocPkg__default.com.sphereon.crypto.KeyInfo<mdocPkg__default.com.sphereon.crypto.cose.CoseKeyCbor>;
|
|
30
|
+
toResolvedCoseKeyInfo(resolvedKeyInfo: mdocPkg__default.com.sphereon.crypto.IResolvedKeyInfo<any>): mdocPkg__default.com.sphereon.crypto.ResolvedKeyInfo<mdocPkg__default.com.sphereon.crypto.cose.CoseKeyCbor>;
|
|
31
|
+
isResolvedKeyInfo(keyInfo: mdocPkg__default.com.sphereon.crypto.IKeyInfo<any>): boolean;
|
|
32
|
+
toResolvedKeyInfo<KeyType extends mdocPkg__default.com.sphereon.crypto.IKey>(keyInfo: mdocPkg__default.com.sphereon.crypto.IKeyInfo<any>, key?: mdocPkg__default.Nullable<KeyType>): mdocPkg__default.com.sphereon.crypto.ResolvedKeyInfo<KeyType>;
|
|
33
|
+
toResolvedKeyInfoWithResolver<KeyType extends mdocPkg__default.com.sphereon.crypto.IKey>(keyInfo: mdocPkg__default.com.sphereon.crypto.IKeyInfo<KeyType>, resolveCallback: mdocPkg__default.Nullable<(p0: mdocPkg__default.com.sphereon.crypto.IKeyInfo<KeyType>) => mdocPkg__default.com.sphereon.crypto.ResolvedKeyInfo<KeyType>>): mdocPkg__default.com.sphereon.crypto.ResolvedKeyInfo<KeyType>;
|
|
34
|
+
getCoseX5chain(key: mdocPkg__default.com.sphereon.crypto.IKey): mdocPkg__default.Nullable<mdocPkg__default.com.sphereon.cbor.CborArray<mdocPkg__default.com.sphereon.cbor.CborByteString>>;
|
|
35
|
+
toCoseX5chain(x5c: mdocPkg__default.Nullable<Array<any>>): mdocPkg__default.Nullable<mdocPkg__default.com.sphereon.cbor.CborArray<mdocPkg__default.com.sphereon.cbor.CborByteString>>;
|
|
36
36
|
};
|
|
37
|
-
declare const KeyInfo: typeof
|
|
38
|
-
declare const DateTimeUtils: typeof
|
|
39
|
-
declare const decodeFrom: typeof
|
|
40
|
-
declare const encodeTo: typeof
|
|
41
|
-
declare const Encoding: typeof
|
|
37
|
+
declare const KeyInfo: typeof mdocPkg__default.com.sphereon.crypto.KeyInfo;
|
|
38
|
+
declare const DateTimeUtils: typeof mdocPkg__default.com.sphereon.kmp.DateTimeUtils;
|
|
39
|
+
declare const decodeFrom: typeof mdocPkg__default.com.sphereon.kmp.decodeFrom;
|
|
40
|
+
declare const encodeTo: typeof mdocPkg__default.com.sphereon.kmp.encodeTo;
|
|
41
|
+
declare const Encoding: typeof mdocPkg__default.com.sphereon.kmp.Encoding;
|
|
42
42
|
declare const MdocValidations: {
|
|
43
|
-
fromDocumentAsync(document:
|
|
44
|
-
fromIssuerAuthAsync(issuerAuth:
|
|
45
|
-
withParamsAsync(issuerAuth?:
|
|
43
|
+
fromDocumentAsync(document: mdocPkg__default.com.sphereon.mdoc.data.device.DocumentCbor, keyInfo?: mdocPkg__default.Nullable<mdocPkg__default.com.sphereon.crypto.IKeyInfo<mdocPkg__default.com.sphereon.crypto.cose.ICoseKeyCbor>>, trustedCerts?: mdocPkg__default.Nullable<Array<string>>, verificationTime?: mdocPkg__default.Nullable<mdocPkg__default.com.sphereon.kmp.LocalDateTimeKMP>, allowExpiredDocuments?: mdocPkg__default.Nullable<boolean>, dateTimeUtils?: mdocPkg__default.com.sphereon.kmp.DateTimeUtils, timeZoneId?: mdocPkg__default.Nullable<string>, clockSkewAllowedInSec?: number): Promise<mdocPkg__default.com.sphereon.crypto.generic.IVerifyResults<mdocPkg__default.com.sphereon.crypto.cose.ICoseKeyCbor>>;
|
|
44
|
+
fromIssuerAuthAsync(issuerAuth: mdocPkg__default.com.sphereon.crypto.cose.CoseSign1Cbor<mdocPkg__default.com.sphereon.mdoc.data.mso.MobileSecurityObjectCbor>, keyInfo?: mdocPkg__default.Nullable<mdocPkg__default.com.sphereon.crypto.IKeyInfo<mdocPkg__default.com.sphereon.crypto.cose.ICoseKeyCbor>>, trustedCerts?: mdocPkg__default.Nullable<Array<string>>, verificationTime?: mdocPkg__default.Nullable<mdocPkg__default.com.sphereon.kmp.LocalDateTimeKMP>, allowExpiredDocuments?: mdocPkg__default.Nullable<boolean>, dateTimeUtils?: mdocPkg__default.com.sphereon.kmp.DateTimeUtils, timeZoneId?: mdocPkg__default.Nullable<string>, clockSkewAllowedInSec?: number): Promise<mdocPkg__default.com.sphereon.crypto.generic.IVerifyResults<mdocPkg__default.com.sphereon.crypto.cose.ICoseKeyCbor>>;
|
|
45
|
+
withParamsAsync(issuerAuth?: mdocPkg__default.Nullable<mdocPkg__default.com.sphereon.crypto.cose.CoseSign1Cbor<mdocPkg__default.com.sphereon.mdoc.data.mso.MobileSecurityObjectCbor>>, document?: mdocPkg__default.Nullable<mdocPkg__default.com.sphereon.mdoc.data.device.DocumentCbor>, mdocVerificationTypes?: mdocPkg__default.kotlin.collections.KtSet<mdocPkg__default.com.sphereon.mdoc.data.MdocVerification>, keyInfo?: mdocPkg__default.Nullable<mdocPkg__default.com.sphereon.crypto.IKeyInfo<mdocPkg__default.com.sphereon.crypto.cose.ICoseKeyCbor>>, trustedCerts?: mdocPkg__default.Nullable<Array<string>>, verificationTime?: mdocPkg__default.Nullable<mdocPkg__default.com.sphereon.kmp.LocalDateTimeKMP>, allowExpiredDocuments?: mdocPkg__default.Nullable<boolean>, dateTimeUtils?: mdocPkg__default.com.sphereon.kmp.DateTimeUtils, timeZoneId?: mdocPkg__default.Nullable<string>, clockSkewAllowedInSec?: number): Promise<mdocPkg__default.com.sphereon.crypto.generic.IVerifyResults<mdocPkg__default.com.sphereon.crypto.cose.ICoseKeyCbor>>;
|
|
46
46
|
};
|
|
47
|
-
declare const MdocOid4vpService: typeof
|
|
48
|
-
declare const Jwk: typeof
|
|
49
|
-
type DocumentDescriptorMatchResult =
|
|
50
|
-
type IOid4VPPresentationDefinition =
|
|
51
|
-
declare const Oid4VPPresentationSubmission: typeof
|
|
47
|
+
declare const MdocOid4vpService: typeof mdocPkg__default.com.sphereon.mdoc.oid4vp.MdocOid4vpServiceJs;
|
|
48
|
+
declare const Jwk: typeof mdocPkg__default.com.sphereon.crypto.jose.Jwk;
|
|
49
|
+
type DocumentDescriptorMatchResult = mdocPkg__default.com.sphereon.mdoc.oid4vp.DocumentDescriptorMatchResult;
|
|
50
|
+
type IOid4VPPresentationDefinition = mdocPkg__default.com.sphereon.mdoc.oid4vp.IOid4VPPresentationDefinition;
|
|
51
|
+
declare const Oid4VPPresentationSubmission: typeof mdocPkg__default.com.sphereon.mdoc.oid4vp.Oid4VPPresentationSubmission;
|
|
52
52
|
interface ImDLMdoc extends IPluginMethodMap {
|
|
53
53
|
x509VerifyCertificateChain(args: VerifyCertificateChainArgs, context: IRequiredContext): Promise<X509ValidationResult>;
|
|
54
54
|
x509GetCertificateInfo(args: GetX509CertificateInfoArgs, context: IRequiredContext): Promise<CertificateInfo[]>;
|
|
@@ -177,20 +177,20 @@ declare class MDLMdoc implements IAgentPlugin {
|
|
|
177
177
|
private x509GetCertificateInfo;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
type ICoseKeyCbor =
|
|
181
|
-
type ToBeSignedCbor =
|
|
182
|
-
type ICoseCryptoCallbackJS =
|
|
183
|
-
type IKey =
|
|
184
|
-
type IX509ServiceJS =
|
|
185
|
-
type X509VerificationProfile =
|
|
186
|
-
type LocalDateTimeKMP =
|
|
180
|
+
type ICoseKeyCbor = mdocPkg.com.sphereon.crypto.cose.ICoseKeyCbor;
|
|
181
|
+
type ToBeSignedCbor = mdocPkg.com.sphereon.crypto.cose.ToBeSignedCbor;
|
|
182
|
+
type ICoseCryptoCallbackJS = mdocPkg.com.sphereon.crypto.ICoseCryptoCallbackJS;
|
|
183
|
+
type IKey = mdocPkg.com.sphereon.crypto.IKey;
|
|
184
|
+
type IX509ServiceJS = mdocPkg.com.sphereon.crypto.IX509ServiceJS;
|
|
185
|
+
type X509VerificationProfile = mdocPkg.com.sphereon.crypto.X509VerificationProfile;
|
|
186
|
+
type LocalDateTimeKMP = mdocPkg.com.sphereon.kmp.LocalDateTimeKMP;
|
|
187
187
|
declare class CoseCryptoService implements ICoseCryptoCallbackJS {
|
|
188
188
|
private context?;
|
|
189
189
|
constructor(context?: IRequiredContext | undefined);
|
|
190
190
|
setContext(context: IRequiredContext): void;
|
|
191
191
|
signAsync(input: ToBeSignedCbor, requireX5Chain: Nullable<boolean>): Promise<Int8Array>;
|
|
192
|
-
verify1Async<CborType>(input:
|
|
193
|
-
resolvePublicKeyAsync<KT extends
|
|
192
|
+
verify1Async<CborType>(input: mdocPkg.com.sphereon.crypto.cose.CoseSign1Cbor<CborType>, keyInfo: mdocPkg.com.sphereon.crypto.IKeyInfo<ICoseKeyCbor>, requireX5Chain: Nullable<boolean>): Promise<mdocPkg.com.sphereon.crypto.generic.IVerifySignatureResult<ICoseKeyCbor>>;
|
|
193
|
+
resolvePublicKeyAsync<KT extends mdocPkg.com.sphereon.crypto.IKey>(keyInfo: mdocPkg.com.sphereon.crypto.IKeyInfo<KT>): Promise<mdocPkg.com.sphereon.crypto.IResolvedKeyInfo<KT>>;
|
|
194
194
|
}
|
|
195
195
|
/**
|
|
196
196
|
* This class can be used for X509 validations.
|
|
@@ -212,7 +212,7 @@ declare class X509CallbackService implements IX509ServiceJS {
|
|
|
212
212
|
/**
|
|
213
213
|
* This method is the implementation used within the mDL/Mdoc library
|
|
214
214
|
*/
|
|
215
|
-
verifyCertificateChainJS<KeyType extends IKey>(chainDER: Nullable<Int8Array[]>, chainPEM: Nullable<string[]>, trustedCerts: Nullable<string[]>, verificationProfile?: X509VerificationProfile | undefined, verificationTime?: Nullable<LocalDateTimeKMP>): Promise<
|
|
215
|
+
verifyCertificateChainJS<KeyType extends IKey>(chainDER: Nullable<Int8Array[]>, chainPEM: Nullable<string[]>, trustedCerts: Nullable<string[]>, verificationProfile?: X509VerificationProfile | undefined, verificationTime?: Nullable<LocalDateTimeKMP>): Promise<mdocPkg.com.sphereon.crypto.IX509VerificationResult<KeyType>>;
|
|
216
216
|
setTrustedCerts: (trustedCertsInPEM?: Array<string>) => void;
|
|
217
217
|
getTrustedCerts: () => string[] | undefined;
|
|
218
218
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
import * as _sphereon_ssi_types from '@sphereon/ssi-types';
|
|
2
2
|
import { IPluginMethodMap, IAgentContext, IDIDManager, IResolver, IAgentPlugin } from '@veramo/core';
|
|
3
|
-
import * as
|
|
4
|
-
import { Nullable } from '@sphereon/kmp-mdoc-core';
|
|
3
|
+
import * as mdocPkg from '@sphereon/kmp-mdoc-core';
|
|
4
|
+
import mdocPkg__default, { Nullable } from '@sphereon/kmp-mdoc-core';
|
|
5
5
|
import { PresentationDefinitionV2, PresentationSubmission } from '@sphereon/pex-models';
|
|
6
6
|
import { ISphereonKeyManager } from '@sphereon/ssi-sdk-ext.key-manager';
|
|
7
7
|
import { X509ValidationResult, SubjectAlternativeGeneralName, CertificateInfo } from '@sphereon/ssi-sdk-ext.x509-utils';
|
|
8
8
|
|
|
9
|
-
type IKey$1 =
|
|
10
|
-
type CoseSign1Json =
|
|
11
|
-
type CoseSign1Cbor<Any> =
|
|
12
|
-
type ICoseKeyCbor$1 =
|
|
13
|
-
type ICoseKeyJson =
|
|
14
|
-
type IKeyInfo<KT extends IKey$1 = IKey$1> =
|
|
15
|
-
type IVerifyResults<KT extends IKey$1> =
|
|
16
|
-
type IVerifySignatureResult<KT extends IKey$1> =
|
|
17
|
-
type DocumentJson =
|
|
18
|
-
type DocumentCbor =
|
|
19
|
-
declare const CborByteString: typeof
|
|
20
|
-
declare const CoseKeyCbor: typeof
|
|
21
|
-
declare const CoseCryptoServiceJS: typeof
|
|
9
|
+
type IKey$1 = mdocPkg__default.com.sphereon.crypto.IKey;
|
|
10
|
+
type CoseSign1Json = mdocPkg__default.com.sphereon.crypto.cose.CoseSign1Json;
|
|
11
|
+
type CoseSign1Cbor<Any> = mdocPkg__default.com.sphereon.crypto.cose.CoseSign1Cbor<Any>;
|
|
12
|
+
type ICoseKeyCbor$1 = mdocPkg__default.com.sphereon.crypto.cose.ICoseKeyCbor;
|
|
13
|
+
type ICoseKeyJson = mdocPkg__default.com.sphereon.crypto.cose.ICoseKeyJson;
|
|
14
|
+
type IKeyInfo<KT extends IKey$1 = IKey$1> = mdocPkg__default.com.sphereon.crypto.IKeyInfo<KT>;
|
|
15
|
+
type IVerifyResults<KT extends IKey$1> = mdocPkg__default.com.sphereon.crypto.generic.IVerifyResults<KT>;
|
|
16
|
+
type IVerifySignatureResult<KT extends IKey$1> = mdocPkg__default.com.sphereon.crypto.generic.IVerifySignatureResult<KT>;
|
|
17
|
+
type DocumentJson = mdocPkg__default.com.sphereon.mdoc.data.device.DocumentJson;
|
|
18
|
+
type DocumentCbor = mdocPkg__default.com.sphereon.mdoc.data.device.DocumentCbor;
|
|
19
|
+
declare const CborByteString: typeof mdocPkg__default.com.sphereon.cbor.CborByteString;
|
|
20
|
+
declare const CoseKeyCbor: typeof mdocPkg__default.com.sphereon.crypto.cose.CoseKeyCbor;
|
|
21
|
+
declare const CoseCryptoServiceJS: typeof mdocPkg__default.com.sphereon.crypto.CoseCryptoServiceJS;
|
|
22
22
|
declare const CoseJoseKeyMappingService: {
|
|
23
|
-
toJoseJwk(key:
|
|
24
|
-
toCoseKey(key:
|
|
25
|
-
getJoseX5c(key:
|
|
26
|
-
toJoseX5c(x5c:
|
|
27
|
-
toJwkKeyInfo(keyInfo:
|
|
28
|
-
toResolvedJwkKeyInfo(resolvedKeyInfo:
|
|
29
|
-
toCoseKeyInfo(keyInfo:
|
|
30
|
-
toResolvedCoseKeyInfo(resolvedKeyInfo:
|
|
31
|
-
isResolvedKeyInfo(keyInfo:
|
|
32
|
-
toResolvedKeyInfo<KeyType extends
|
|
33
|
-
toResolvedKeyInfoWithResolver<KeyType extends
|
|
34
|
-
getCoseX5chain(key:
|
|
35
|
-
toCoseX5chain(x5c:
|
|
23
|
+
toJoseJwk(key: mdocPkg__default.com.sphereon.crypto.IKey): mdocPkg__default.com.sphereon.crypto.jose.Jwk;
|
|
24
|
+
toCoseKey(key: mdocPkg__default.com.sphereon.crypto.IKey): mdocPkg__default.com.sphereon.crypto.cose.CoseKeyCbor;
|
|
25
|
+
getJoseX5c(key: mdocPkg__default.com.sphereon.crypto.IKey): mdocPkg__default.Nullable<Array<string>>;
|
|
26
|
+
toJoseX5c(x5c: mdocPkg__default.Nullable<Array<any>>): mdocPkg__default.Nullable<Array<string>>;
|
|
27
|
+
toJwkKeyInfo(keyInfo: mdocPkg__default.com.sphereon.crypto.IKeyInfo<any>): mdocPkg__default.com.sphereon.crypto.KeyInfo<mdocPkg__default.com.sphereon.crypto.jose.Jwk>;
|
|
28
|
+
toResolvedJwkKeyInfo(resolvedKeyInfo: mdocPkg__default.com.sphereon.crypto.IResolvedKeyInfo<any>): mdocPkg__default.com.sphereon.crypto.ResolvedKeyInfo<mdocPkg__default.com.sphereon.crypto.jose.Jwk>;
|
|
29
|
+
toCoseKeyInfo(keyInfo: mdocPkg__default.com.sphereon.crypto.IKeyInfo<any>): mdocPkg__default.com.sphereon.crypto.KeyInfo<mdocPkg__default.com.sphereon.crypto.cose.CoseKeyCbor>;
|
|
30
|
+
toResolvedCoseKeyInfo(resolvedKeyInfo: mdocPkg__default.com.sphereon.crypto.IResolvedKeyInfo<any>): mdocPkg__default.com.sphereon.crypto.ResolvedKeyInfo<mdocPkg__default.com.sphereon.crypto.cose.CoseKeyCbor>;
|
|
31
|
+
isResolvedKeyInfo(keyInfo: mdocPkg__default.com.sphereon.crypto.IKeyInfo<any>): boolean;
|
|
32
|
+
toResolvedKeyInfo<KeyType extends mdocPkg__default.com.sphereon.crypto.IKey>(keyInfo: mdocPkg__default.com.sphereon.crypto.IKeyInfo<any>, key?: mdocPkg__default.Nullable<KeyType>): mdocPkg__default.com.sphereon.crypto.ResolvedKeyInfo<KeyType>;
|
|
33
|
+
toResolvedKeyInfoWithResolver<KeyType extends mdocPkg__default.com.sphereon.crypto.IKey>(keyInfo: mdocPkg__default.com.sphereon.crypto.IKeyInfo<KeyType>, resolveCallback: mdocPkg__default.Nullable<(p0: mdocPkg__default.com.sphereon.crypto.IKeyInfo<KeyType>) => mdocPkg__default.com.sphereon.crypto.ResolvedKeyInfo<KeyType>>): mdocPkg__default.com.sphereon.crypto.ResolvedKeyInfo<KeyType>;
|
|
34
|
+
getCoseX5chain(key: mdocPkg__default.com.sphereon.crypto.IKey): mdocPkg__default.Nullable<mdocPkg__default.com.sphereon.cbor.CborArray<mdocPkg__default.com.sphereon.cbor.CborByteString>>;
|
|
35
|
+
toCoseX5chain(x5c: mdocPkg__default.Nullable<Array<any>>): mdocPkg__default.Nullable<mdocPkg__default.com.sphereon.cbor.CborArray<mdocPkg__default.com.sphereon.cbor.CborByteString>>;
|
|
36
36
|
};
|
|
37
|
-
declare const KeyInfo: typeof
|
|
38
|
-
declare const DateTimeUtils: typeof
|
|
39
|
-
declare const decodeFrom: typeof
|
|
40
|
-
declare const encodeTo: typeof
|
|
41
|
-
declare const Encoding: typeof
|
|
37
|
+
declare const KeyInfo: typeof mdocPkg__default.com.sphereon.crypto.KeyInfo;
|
|
38
|
+
declare const DateTimeUtils: typeof mdocPkg__default.com.sphereon.kmp.DateTimeUtils;
|
|
39
|
+
declare const decodeFrom: typeof mdocPkg__default.com.sphereon.kmp.decodeFrom;
|
|
40
|
+
declare const encodeTo: typeof mdocPkg__default.com.sphereon.kmp.encodeTo;
|
|
41
|
+
declare const Encoding: typeof mdocPkg__default.com.sphereon.kmp.Encoding;
|
|
42
42
|
declare const MdocValidations: {
|
|
43
|
-
fromDocumentAsync(document:
|
|
44
|
-
fromIssuerAuthAsync(issuerAuth:
|
|
45
|
-
withParamsAsync(issuerAuth?:
|
|
43
|
+
fromDocumentAsync(document: mdocPkg__default.com.sphereon.mdoc.data.device.DocumentCbor, keyInfo?: mdocPkg__default.Nullable<mdocPkg__default.com.sphereon.crypto.IKeyInfo<mdocPkg__default.com.sphereon.crypto.cose.ICoseKeyCbor>>, trustedCerts?: mdocPkg__default.Nullable<Array<string>>, verificationTime?: mdocPkg__default.Nullable<mdocPkg__default.com.sphereon.kmp.LocalDateTimeKMP>, allowExpiredDocuments?: mdocPkg__default.Nullable<boolean>, dateTimeUtils?: mdocPkg__default.com.sphereon.kmp.DateTimeUtils, timeZoneId?: mdocPkg__default.Nullable<string>, clockSkewAllowedInSec?: number): Promise<mdocPkg__default.com.sphereon.crypto.generic.IVerifyResults<mdocPkg__default.com.sphereon.crypto.cose.ICoseKeyCbor>>;
|
|
44
|
+
fromIssuerAuthAsync(issuerAuth: mdocPkg__default.com.sphereon.crypto.cose.CoseSign1Cbor<mdocPkg__default.com.sphereon.mdoc.data.mso.MobileSecurityObjectCbor>, keyInfo?: mdocPkg__default.Nullable<mdocPkg__default.com.sphereon.crypto.IKeyInfo<mdocPkg__default.com.sphereon.crypto.cose.ICoseKeyCbor>>, trustedCerts?: mdocPkg__default.Nullable<Array<string>>, verificationTime?: mdocPkg__default.Nullable<mdocPkg__default.com.sphereon.kmp.LocalDateTimeKMP>, allowExpiredDocuments?: mdocPkg__default.Nullable<boolean>, dateTimeUtils?: mdocPkg__default.com.sphereon.kmp.DateTimeUtils, timeZoneId?: mdocPkg__default.Nullable<string>, clockSkewAllowedInSec?: number): Promise<mdocPkg__default.com.sphereon.crypto.generic.IVerifyResults<mdocPkg__default.com.sphereon.crypto.cose.ICoseKeyCbor>>;
|
|
45
|
+
withParamsAsync(issuerAuth?: mdocPkg__default.Nullable<mdocPkg__default.com.sphereon.crypto.cose.CoseSign1Cbor<mdocPkg__default.com.sphereon.mdoc.data.mso.MobileSecurityObjectCbor>>, document?: mdocPkg__default.Nullable<mdocPkg__default.com.sphereon.mdoc.data.device.DocumentCbor>, mdocVerificationTypes?: mdocPkg__default.kotlin.collections.KtSet<mdocPkg__default.com.sphereon.mdoc.data.MdocVerification>, keyInfo?: mdocPkg__default.Nullable<mdocPkg__default.com.sphereon.crypto.IKeyInfo<mdocPkg__default.com.sphereon.crypto.cose.ICoseKeyCbor>>, trustedCerts?: mdocPkg__default.Nullable<Array<string>>, verificationTime?: mdocPkg__default.Nullable<mdocPkg__default.com.sphereon.kmp.LocalDateTimeKMP>, allowExpiredDocuments?: mdocPkg__default.Nullable<boolean>, dateTimeUtils?: mdocPkg__default.com.sphereon.kmp.DateTimeUtils, timeZoneId?: mdocPkg__default.Nullable<string>, clockSkewAllowedInSec?: number): Promise<mdocPkg__default.com.sphereon.crypto.generic.IVerifyResults<mdocPkg__default.com.sphereon.crypto.cose.ICoseKeyCbor>>;
|
|
46
46
|
};
|
|
47
|
-
declare const MdocOid4vpService: typeof
|
|
48
|
-
declare const Jwk: typeof
|
|
49
|
-
type DocumentDescriptorMatchResult =
|
|
50
|
-
type IOid4VPPresentationDefinition =
|
|
51
|
-
declare const Oid4VPPresentationSubmission: typeof
|
|
47
|
+
declare const MdocOid4vpService: typeof mdocPkg__default.com.sphereon.mdoc.oid4vp.MdocOid4vpServiceJs;
|
|
48
|
+
declare const Jwk: typeof mdocPkg__default.com.sphereon.crypto.jose.Jwk;
|
|
49
|
+
type DocumentDescriptorMatchResult = mdocPkg__default.com.sphereon.mdoc.oid4vp.DocumentDescriptorMatchResult;
|
|
50
|
+
type IOid4VPPresentationDefinition = mdocPkg__default.com.sphereon.mdoc.oid4vp.IOid4VPPresentationDefinition;
|
|
51
|
+
declare const Oid4VPPresentationSubmission: typeof mdocPkg__default.com.sphereon.mdoc.oid4vp.Oid4VPPresentationSubmission;
|
|
52
52
|
interface ImDLMdoc extends IPluginMethodMap {
|
|
53
53
|
x509VerifyCertificateChain(args: VerifyCertificateChainArgs, context: IRequiredContext): Promise<X509ValidationResult>;
|
|
54
54
|
x509GetCertificateInfo(args: GetX509CertificateInfoArgs, context: IRequiredContext): Promise<CertificateInfo[]>;
|
|
@@ -177,20 +177,20 @@ declare class MDLMdoc implements IAgentPlugin {
|
|
|
177
177
|
private x509GetCertificateInfo;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
type ICoseKeyCbor =
|
|
181
|
-
type ToBeSignedCbor =
|
|
182
|
-
type ICoseCryptoCallbackJS =
|
|
183
|
-
type IKey =
|
|
184
|
-
type IX509ServiceJS =
|
|
185
|
-
type X509VerificationProfile =
|
|
186
|
-
type LocalDateTimeKMP =
|
|
180
|
+
type ICoseKeyCbor = mdocPkg.com.sphereon.crypto.cose.ICoseKeyCbor;
|
|
181
|
+
type ToBeSignedCbor = mdocPkg.com.sphereon.crypto.cose.ToBeSignedCbor;
|
|
182
|
+
type ICoseCryptoCallbackJS = mdocPkg.com.sphereon.crypto.ICoseCryptoCallbackJS;
|
|
183
|
+
type IKey = mdocPkg.com.sphereon.crypto.IKey;
|
|
184
|
+
type IX509ServiceJS = mdocPkg.com.sphereon.crypto.IX509ServiceJS;
|
|
185
|
+
type X509VerificationProfile = mdocPkg.com.sphereon.crypto.X509VerificationProfile;
|
|
186
|
+
type LocalDateTimeKMP = mdocPkg.com.sphereon.kmp.LocalDateTimeKMP;
|
|
187
187
|
declare class CoseCryptoService implements ICoseCryptoCallbackJS {
|
|
188
188
|
private context?;
|
|
189
189
|
constructor(context?: IRequiredContext | undefined);
|
|
190
190
|
setContext(context: IRequiredContext): void;
|
|
191
191
|
signAsync(input: ToBeSignedCbor, requireX5Chain: Nullable<boolean>): Promise<Int8Array>;
|
|
192
|
-
verify1Async<CborType>(input:
|
|
193
|
-
resolvePublicKeyAsync<KT extends
|
|
192
|
+
verify1Async<CborType>(input: mdocPkg.com.sphereon.crypto.cose.CoseSign1Cbor<CborType>, keyInfo: mdocPkg.com.sphereon.crypto.IKeyInfo<ICoseKeyCbor>, requireX5Chain: Nullable<boolean>): Promise<mdocPkg.com.sphereon.crypto.generic.IVerifySignatureResult<ICoseKeyCbor>>;
|
|
193
|
+
resolvePublicKeyAsync<KT extends mdocPkg.com.sphereon.crypto.IKey>(keyInfo: mdocPkg.com.sphereon.crypto.IKeyInfo<KT>): Promise<mdocPkg.com.sphereon.crypto.IResolvedKeyInfo<KT>>;
|
|
194
194
|
}
|
|
195
195
|
/**
|
|
196
196
|
* This class can be used for X509 validations.
|
|
@@ -212,7 +212,7 @@ declare class X509CallbackService implements IX509ServiceJS {
|
|
|
212
212
|
/**
|
|
213
213
|
* This method is the implementation used within the mDL/Mdoc library
|
|
214
214
|
*/
|
|
215
|
-
verifyCertificateChainJS<KeyType extends IKey>(chainDER: Nullable<Int8Array[]>, chainPEM: Nullable<string[]>, trustedCerts: Nullable<string[]>, verificationProfile?: X509VerificationProfile | undefined, verificationTime?: Nullable<LocalDateTimeKMP>): Promise<
|
|
215
|
+
verifyCertificateChainJS<KeyType extends IKey>(chainDER: Nullable<Int8Array[]>, chainPEM: Nullable<string[]>, trustedCerts: Nullable<string[]>, verificationProfile?: X509VerificationProfile | undefined, verificationTime?: Nullable<LocalDateTimeKMP>): Promise<mdocPkg.com.sphereon.crypto.IX509VerificationResult<KeyType>>;
|
|
216
216
|
setTrustedCerts: (trustedCertsInPEM?: Array<string>) => void;
|
|
217
217
|
getTrustedCerts: () => string[] | undefined;
|
|
218
218
|
}
|
package/dist/index.js
CHANGED
|
@@ -2045,7 +2045,7 @@ var require_plugin_schema = __commonJS({
|
|
|
2045
2045
|
import { Loggers } from "@sphereon/ssi-types";
|
|
2046
2046
|
|
|
2047
2047
|
// src/agent/mDLMdoc.ts
|
|
2048
|
-
import
|
|
2048
|
+
import mdocPkg2 from "@sphereon/kmp-mdoc-core";
|
|
2049
2049
|
import { calculateJwkThumbprint as calculateJwkThumbprint2 } from "@sphereon/ssi-sdk-ext.key-utils";
|
|
2050
2050
|
import { getCertificateInfo as getCertificateInfo2, pemOrDerToX509Certificate as pemOrDerToX509Certificate2 } from "@sphereon/ssi-sdk-ext.x509-utils";
|
|
2051
2051
|
|
|
@@ -2267,22 +2267,24 @@ DefaultCallbacks.setCoseCryptoDefault(new CoseCryptoService());
|
|
|
2267
2267
|
DefaultCallbacks.setX509Default(new X509CallbackService());
|
|
2268
2268
|
|
|
2269
2269
|
// src/types/ImDLMdoc.ts
|
|
2270
|
-
import
|
|
2271
|
-
var
|
|
2272
|
-
var
|
|
2273
|
-
var
|
|
2274
|
-
var
|
|
2275
|
-
var
|
|
2276
|
-
var
|
|
2277
|
-
var
|
|
2278
|
-
var
|
|
2279
|
-
var
|
|
2280
|
-
var
|
|
2281
|
-
var
|
|
2282
|
-
var
|
|
2283
|
-
var
|
|
2270
|
+
import mdocPkg from "@sphereon/kmp-mdoc-core";
|
|
2271
|
+
var { com: com2 } = mdocPkg;
|
|
2272
|
+
var CborByteString = com2.sphereon.cbor.CborByteString;
|
|
2273
|
+
var CoseKeyCbor = com2.sphereon.crypto.cose.CoseKeyCbor;
|
|
2274
|
+
var CoseCryptoServiceJS = com2.sphereon.crypto.CoseCryptoServiceJS;
|
|
2275
|
+
var CoseJoseKeyMappingService2 = com2.sphereon.crypto.CoseJoseKeyMappingService;
|
|
2276
|
+
var KeyInfo2 = com2.sphereon.crypto.KeyInfo;
|
|
2277
|
+
var DateTimeUtils2 = com2.sphereon.kmp.DateTimeUtils;
|
|
2278
|
+
var decodeFrom2 = com2.sphereon.kmp.decodeFrom;
|
|
2279
|
+
var encodeTo2 = com2.sphereon.kmp.encodeTo;
|
|
2280
|
+
var Encoding2 = com2.sphereon.kmp.Encoding;
|
|
2281
|
+
var MdocValidations = com2.sphereon.mdoc.data.MdocValidations;
|
|
2282
|
+
var MdocOid4vpService = com2.sphereon.mdoc.oid4vp.MdocOid4vpServiceJs;
|
|
2283
|
+
var Jwk = com2.sphereon.crypto.jose.Jwk;
|
|
2284
|
+
var Oid4VPPresentationSubmission = com2.sphereon.mdoc.oid4vp.Oid4VPPresentationSubmission;
|
|
2284
2285
|
|
|
2285
2286
|
// src/agent/mDLMdoc.ts
|
|
2287
|
+
var { com: com3 } = mdocPkg2;
|
|
2286
2288
|
var mdocSupportMethods = [
|
|
2287
2289
|
"x509VerifyCertificateChain",
|
|
2288
2290
|
"x509GetCertificateInfo",
|
|
@@ -2320,9 +2322,9 @@ var MDLMdoc = class {
|
|
|
2320
2322
|
async mdocOid4vpHolderPresent(args, _context) {
|
|
2321
2323
|
const { mdocs, presentationDefinition, trustAnchors, verifications, mdocHolderNonce, authorizationRequestNonce, responseUri, clientId } = args;
|
|
2322
2324
|
const oid4vpService = new MdocOid4vpService();
|
|
2323
|
-
const validate = /* @__PURE__ */ __name(async (
|
|
2325
|
+
const validate = /* @__PURE__ */ __name(async (mdoc2) => {
|
|
2324
2326
|
try {
|
|
2325
|
-
const result = await MdocValidations.fromDocumentAsync(
|
|
2327
|
+
const result = await MdocValidations.fromDocumentAsync(mdoc2, null, trustAnchors ?? this.trustAnchors, DateTimeUtils2.Static.DEFAULT.dateTimeLocal((verifications?.verificationTime?.getTime() ?? Date.now()) / 1e3), verifications?.allowExpiredDocuments);
|
|
2326
2328
|
if (result.error) {
|
|
2327
2329
|
console.log(JSON.stringify(result, null, 2));
|
|
2328
2330
|
}
|
|
@@ -2403,7 +2405,7 @@ var MDLMdoc = class {
|
|
|
2403
2405
|
*/
|
|
2404
2406
|
async mdocOid4vpRPVerify(args, _context) {
|
|
2405
2407
|
const { vp_token, presentation_submission, trustAnchors } = args;
|
|
2406
|
-
const deviceResponse =
|
|
2408
|
+
const deviceResponse = com3.sphereon.mdoc.data.device.DeviceResponseCbor.Static.cborDecode(decodeFrom2(vp_token, Encoding2.BASE64URL));
|
|
2407
2409
|
if (!deviceResponse.documents) {
|
|
2408
2410
|
return Promise.reject(Error(`No documents found in vp_token`));
|
|
2409
2411
|
}
|
|
@@ -2464,7 +2466,7 @@ var MDLMdoc = class {
|
|
|
2464
2466
|
async mdocVerifyIssuerSigned(args, context) {
|
|
2465
2467
|
const { input, keyInfo, requireX5Chain } = args;
|
|
2466
2468
|
const coseKeyInfo = keyInfo && CoseJoseKeyMappingService2.toCoseKeyInfo(keyInfo);
|
|
2467
|
-
const verification = await new CoseCryptoServiceJS(new CoseCryptoService(context)).verify1(
|
|
2469
|
+
const verification = await new CoseCryptoServiceJS(new CoseCryptoService(context)).verify1(com3.sphereon.crypto.cose.CoseSign1Json.Static.fromDTO(input).toCbor(), coseKeyInfo, requireX5Chain);
|
|
2468
2470
|
return {
|
|
2469
2471
|
...verification,
|
|
2470
2472
|
keyInfo
|