@sphereon/ssi-sdk.mdl-mdoc 0.34.1-feature.SSISDK.26.51 → 0.34.1-feature.SSISDK.26.RP.55
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 +30 -30
- 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 +30 -30
- package/dist/index.js.map +1 -1
- package/package.json +13 -13
- package/src/agent/mDLMdoc.ts +4 -4
- package/src/functions/index.ts +33 -31
- package/src/types/ImDLMdoc.ts +26 -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 {
|
|
3
|
+
import * as mdoc from '@sphereon/kmp-mdoc-core';
|
|
4
|
+
import { 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 = com.sphereon.crypto.IKey;
|
|
10
|
-
type CoseSign1Json = com.sphereon.crypto.cose.CoseSign1Json;
|
|
11
|
-
type CoseSign1Cbor<Any> = com.sphereon.crypto.cose.CoseSign1Cbor<Any>;
|
|
12
|
-
type ICoseKeyCbor$1 = com.sphereon.crypto.cose.ICoseKeyCbor;
|
|
13
|
-
type ICoseKeyJson = com.sphereon.crypto.cose.ICoseKeyJson;
|
|
14
|
-
type IKeyInfo<KT extends IKey$1 = IKey$1> = com.sphereon.crypto.IKeyInfo<KT>;
|
|
15
|
-
type IVerifyResults<KT extends IKey$1> = com.sphereon.crypto.generic.IVerifyResults<KT>;
|
|
16
|
-
type IVerifySignatureResult<KT extends IKey$1> = com.sphereon.crypto.generic.IVerifySignatureResult<KT>;
|
|
17
|
-
type DocumentJson = com.sphereon.mdoc.data.device.DocumentJson;
|
|
18
|
-
type DocumentCbor = com.sphereon.mdoc.data.device.DocumentCbor;
|
|
19
|
-
declare const CborByteString: typeof com.sphereon.cbor.CborByteString;
|
|
20
|
-
declare const CoseKeyCbor: typeof com.sphereon.crypto.cose.CoseKeyCbor;
|
|
21
|
-
declare const CoseCryptoServiceJS: typeof com.sphereon.crypto.CoseCryptoServiceJS;
|
|
9
|
+
type IKey$1 = mdoc.com.sphereon.crypto.IKey;
|
|
10
|
+
type CoseSign1Json = mdoc.com.sphereon.crypto.cose.CoseSign1Json;
|
|
11
|
+
type CoseSign1Cbor<Any> = mdoc.com.sphereon.crypto.cose.CoseSign1Cbor<Any>;
|
|
12
|
+
type ICoseKeyCbor$1 = mdoc.com.sphereon.crypto.cose.ICoseKeyCbor;
|
|
13
|
+
type ICoseKeyJson = mdoc.com.sphereon.crypto.cose.ICoseKeyJson;
|
|
14
|
+
type IKeyInfo<KT extends IKey$1 = IKey$1> = mdoc.com.sphereon.crypto.IKeyInfo<KT>;
|
|
15
|
+
type IVerifyResults<KT extends IKey$1> = mdoc.com.sphereon.crypto.generic.IVerifyResults<KT>;
|
|
16
|
+
type IVerifySignatureResult<KT extends IKey$1> = mdoc.com.sphereon.crypto.generic.IVerifySignatureResult<KT>;
|
|
17
|
+
type DocumentJson = mdoc.com.sphereon.mdoc.data.device.DocumentJson;
|
|
18
|
+
type DocumentCbor = mdoc.com.sphereon.mdoc.data.device.DocumentCbor;
|
|
19
|
+
declare const CborByteString: typeof mdoc.com.sphereon.cbor.CborByteString;
|
|
20
|
+
declare const CoseKeyCbor: typeof mdoc.com.sphereon.crypto.cose.CoseKeyCbor;
|
|
21
|
+
declare const CoseCryptoServiceJS: typeof mdoc.com.sphereon.crypto.CoseCryptoServiceJS;
|
|
22
22
|
declare const CoseJoseKeyMappingService: {
|
|
23
|
-
toJoseJwk(key: com.sphereon.crypto.IKey): com.sphereon.crypto.jose.Jwk;
|
|
24
|
-
toCoseKey(key: com.sphereon.crypto.IKey): com.sphereon.crypto.cose.CoseKeyCbor;
|
|
25
|
-
getJoseX5c(key: com.sphereon.crypto.IKey):
|
|
26
|
-
toJoseX5c(x5c:
|
|
27
|
-
toJwkKeyInfo(keyInfo: com.sphereon.crypto.IKeyInfo<any>): com.sphereon.crypto.KeyInfo<com.sphereon.crypto.jose.Jwk>;
|
|
28
|
-
toResolvedJwkKeyInfo(resolvedKeyInfo: com.sphereon.crypto.IResolvedKeyInfo<any>): com.sphereon.crypto.ResolvedKeyInfo<com.sphereon.crypto.jose.Jwk>;
|
|
29
|
-
toCoseKeyInfo(keyInfo: com.sphereon.crypto.IKeyInfo<any>): com.sphereon.crypto.KeyInfo<com.sphereon.crypto.cose.CoseKeyCbor>;
|
|
30
|
-
toResolvedCoseKeyInfo(resolvedKeyInfo: com.sphereon.crypto.IResolvedKeyInfo<any>): com.sphereon.crypto.ResolvedKeyInfo<com.sphereon.crypto.cose.CoseKeyCbor>;
|
|
31
|
-
isResolvedKeyInfo(keyInfo: com.sphereon.crypto.IKeyInfo<any>): boolean;
|
|
32
|
-
toResolvedKeyInfo<KeyType extends com.sphereon.crypto.IKey>(keyInfo: com.sphereon.crypto.IKeyInfo<any>, key?:
|
|
33
|
-
toResolvedKeyInfoWithResolver<KeyType extends com.sphereon.crypto.IKey>(keyInfo: com.sphereon.crypto.IKeyInfo<KeyType>, resolveCallback:
|
|
34
|
-
getCoseX5chain(key: com.sphereon.crypto.IKey):
|
|
35
|
-
toCoseX5chain(x5c:
|
|
23
|
+
toJoseJwk(key: mdoc.com.sphereon.crypto.IKey): mdoc.com.sphereon.crypto.jose.Jwk;
|
|
24
|
+
toCoseKey(key: mdoc.com.sphereon.crypto.IKey): mdoc.com.sphereon.crypto.cose.CoseKeyCbor;
|
|
25
|
+
getJoseX5c(key: mdoc.com.sphereon.crypto.IKey): mdoc.Nullable<Array<string>>;
|
|
26
|
+
toJoseX5c(x5c: mdoc.Nullable<Array<any>>): mdoc.Nullable<Array<string>>;
|
|
27
|
+
toJwkKeyInfo(keyInfo: mdoc.com.sphereon.crypto.IKeyInfo<any>): mdoc.com.sphereon.crypto.KeyInfo<mdoc.com.sphereon.crypto.jose.Jwk>;
|
|
28
|
+
toResolvedJwkKeyInfo(resolvedKeyInfo: mdoc.com.sphereon.crypto.IResolvedKeyInfo<any>): mdoc.com.sphereon.crypto.ResolvedKeyInfo<mdoc.com.sphereon.crypto.jose.Jwk>;
|
|
29
|
+
toCoseKeyInfo(keyInfo: mdoc.com.sphereon.crypto.IKeyInfo<any>): mdoc.com.sphereon.crypto.KeyInfo<mdoc.com.sphereon.crypto.cose.CoseKeyCbor>;
|
|
30
|
+
toResolvedCoseKeyInfo(resolvedKeyInfo: mdoc.com.sphereon.crypto.IResolvedKeyInfo<any>): mdoc.com.sphereon.crypto.ResolvedKeyInfo<mdoc.com.sphereon.crypto.cose.CoseKeyCbor>;
|
|
31
|
+
isResolvedKeyInfo(keyInfo: mdoc.com.sphereon.crypto.IKeyInfo<any>): boolean;
|
|
32
|
+
toResolvedKeyInfo<KeyType extends mdoc.com.sphereon.crypto.IKey>(keyInfo: mdoc.com.sphereon.crypto.IKeyInfo<any>, key?: mdoc.Nullable<KeyType>): mdoc.com.sphereon.crypto.ResolvedKeyInfo<KeyType>;
|
|
33
|
+
toResolvedKeyInfoWithResolver<KeyType extends mdoc.com.sphereon.crypto.IKey>(keyInfo: mdoc.com.sphereon.crypto.IKeyInfo<KeyType>, resolveCallback: mdoc.Nullable<(p0: mdoc.com.sphereon.crypto.IKeyInfo<KeyType>) => mdoc.com.sphereon.crypto.ResolvedKeyInfo<KeyType>>): mdoc.com.sphereon.crypto.ResolvedKeyInfo<KeyType>;
|
|
34
|
+
getCoseX5chain(key: mdoc.com.sphereon.crypto.IKey): mdoc.Nullable<mdoc.com.sphereon.cbor.CborArray<mdoc.com.sphereon.cbor.CborByteString>>;
|
|
35
|
+
toCoseX5chain(x5c: mdoc.Nullable<Array<any>>): mdoc.Nullable<mdoc.com.sphereon.cbor.CborArray<mdoc.com.sphereon.cbor.CborByteString>>;
|
|
36
36
|
};
|
|
37
|
-
declare const KeyInfo: typeof com.sphereon.crypto.KeyInfo;
|
|
38
|
-
declare const DateTimeUtils: typeof com.sphereon.kmp.DateTimeUtils;
|
|
39
|
-
declare const decodeFrom: typeof com.sphereon.kmp.decodeFrom;
|
|
40
|
-
declare const encodeTo: typeof com.sphereon.kmp.encodeTo;
|
|
41
|
-
declare const Encoding: typeof com.sphereon.kmp.Encoding;
|
|
37
|
+
declare const KeyInfo: typeof mdoc.com.sphereon.crypto.KeyInfo;
|
|
38
|
+
declare const DateTimeUtils: typeof mdoc.com.sphereon.kmp.DateTimeUtils;
|
|
39
|
+
declare const decodeFrom: typeof mdoc.com.sphereon.kmp.decodeFrom;
|
|
40
|
+
declare const encodeTo: typeof mdoc.com.sphereon.kmp.encodeTo;
|
|
41
|
+
declare const Encoding: typeof mdoc.com.sphereon.kmp.Encoding;
|
|
42
42
|
declare const MdocValidations: {
|
|
43
|
-
fromDocumentAsync(document: com.sphereon.mdoc.data.device.DocumentCbor, keyInfo?:
|
|
44
|
-
fromIssuerAuthAsync(issuerAuth: com.sphereon.crypto.cose.CoseSign1Cbor<com.sphereon.mdoc.data.mso.MobileSecurityObjectCbor>, keyInfo?:
|
|
45
|
-
withParamsAsync(issuerAuth?:
|
|
43
|
+
fromDocumentAsync(document: mdoc.com.sphereon.mdoc.data.device.DocumentCbor, keyInfo?: mdoc.Nullable<mdoc.com.sphereon.crypto.IKeyInfo<mdoc.com.sphereon.crypto.cose.ICoseKeyCbor>>, trustedCerts?: mdoc.Nullable<Array<string>>, verificationTime?: mdoc.Nullable<mdoc.com.sphereon.kmp.LocalDateTimeKMP>, allowExpiredDocuments?: mdoc.Nullable<boolean>, dateTimeUtils?: mdoc.com.sphereon.kmp.DateTimeUtils, timeZoneId?: mdoc.Nullable<string>, clockSkewAllowedInSec?: number): Promise<mdoc.com.sphereon.crypto.generic.IVerifyResults<mdoc.com.sphereon.crypto.cose.ICoseKeyCbor>>;
|
|
44
|
+
fromIssuerAuthAsync(issuerAuth: mdoc.com.sphereon.crypto.cose.CoseSign1Cbor<mdoc.com.sphereon.mdoc.data.mso.MobileSecurityObjectCbor>, keyInfo?: mdoc.Nullable<mdoc.com.sphereon.crypto.IKeyInfo<mdoc.com.sphereon.crypto.cose.ICoseKeyCbor>>, trustedCerts?: mdoc.Nullable<Array<string>>, verificationTime?: mdoc.Nullable<mdoc.com.sphereon.kmp.LocalDateTimeKMP>, allowExpiredDocuments?: mdoc.Nullable<boolean>, dateTimeUtils?: mdoc.com.sphereon.kmp.DateTimeUtils, timeZoneId?: mdoc.Nullable<string>, clockSkewAllowedInSec?: number): Promise<mdoc.com.sphereon.crypto.generic.IVerifyResults<mdoc.com.sphereon.crypto.cose.ICoseKeyCbor>>;
|
|
45
|
+
withParamsAsync(issuerAuth?: mdoc.Nullable<mdoc.com.sphereon.crypto.cose.CoseSign1Cbor<mdoc.com.sphereon.mdoc.data.mso.MobileSecurityObjectCbor>>, document?: mdoc.Nullable<mdoc.com.sphereon.mdoc.data.device.DocumentCbor>, mdocVerificationTypes?: mdoc.kotlin.collections.KtSet<mdoc.com.sphereon.mdoc.data.MdocVerification>, keyInfo?: mdoc.Nullable<mdoc.com.sphereon.crypto.IKeyInfo<mdoc.com.sphereon.crypto.cose.ICoseKeyCbor>>, trustedCerts?: mdoc.Nullable<Array<string>>, verificationTime?: mdoc.Nullable<mdoc.com.sphereon.kmp.LocalDateTimeKMP>, allowExpiredDocuments?: mdoc.Nullable<boolean>, dateTimeUtils?: mdoc.com.sphereon.kmp.DateTimeUtils, timeZoneId?: mdoc.Nullable<string>, clockSkewAllowedInSec?: number): Promise<mdoc.com.sphereon.crypto.generic.IVerifyResults<mdoc.com.sphereon.crypto.cose.ICoseKeyCbor>>;
|
|
46
46
|
};
|
|
47
|
-
declare const MdocOid4vpService: typeof com.sphereon.mdoc.oid4vp.MdocOid4vpServiceJs;
|
|
48
|
-
declare const Jwk: typeof com.sphereon.crypto.jose.Jwk;
|
|
49
|
-
type DocumentDescriptorMatchResult = com.sphereon.mdoc.oid4vp.DocumentDescriptorMatchResult;
|
|
50
|
-
type IOid4VPPresentationDefinition = com.sphereon.mdoc.oid4vp.IOid4VPPresentationDefinition;
|
|
51
|
-
declare const Oid4VPPresentationSubmission: typeof com.sphereon.mdoc.oid4vp.Oid4VPPresentationSubmission;
|
|
47
|
+
declare const MdocOid4vpService: typeof mdoc.com.sphereon.mdoc.oid4vp.MdocOid4vpServiceJs;
|
|
48
|
+
declare const Jwk: typeof mdoc.com.sphereon.crypto.jose.Jwk;
|
|
49
|
+
type DocumentDescriptorMatchResult = mdoc.com.sphereon.mdoc.oid4vp.DocumentDescriptorMatchResult;
|
|
50
|
+
type IOid4VPPresentationDefinition = mdoc.com.sphereon.mdoc.oid4vp.IOid4VPPresentationDefinition;
|
|
51
|
+
declare const Oid4VPPresentationSubmission: typeof mdoc.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 = com.sphereon.crypto.cose.ICoseKeyCbor;
|
|
181
|
-
type ToBeSignedCbor = com.sphereon.crypto.cose.ToBeSignedCbor;
|
|
182
|
-
type ICoseCryptoCallbackJS = com.sphereon.crypto.ICoseCryptoCallbackJS;
|
|
183
|
-
type IKey = com.sphereon.crypto.IKey;
|
|
184
|
-
type IX509ServiceJS = com.sphereon.crypto.IX509ServiceJS;
|
|
185
|
-
type X509VerificationProfile = com.sphereon.crypto.X509VerificationProfile;
|
|
186
|
-
type LocalDateTimeKMP = com.sphereon.kmp.LocalDateTimeKMP;
|
|
180
|
+
type ICoseKeyCbor = mdoc.com.sphereon.crypto.cose.ICoseKeyCbor;
|
|
181
|
+
type ToBeSignedCbor = mdoc.com.sphereon.crypto.cose.ToBeSignedCbor;
|
|
182
|
+
type ICoseCryptoCallbackJS = mdoc.com.sphereon.crypto.ICoseCryptoCallbackJS;
|
|
183
|
+
type IKey = mdoc.com.sphereon.crypto.IKey;
|
|
184
|
+
type IX509ServiceJS = mdoc.com.sphereon.crypto.IX509ServiceJS;
|
|
185
|
+
type X509VerificationProfile = mdoc.com.sphereon.crypto.X509VerificationProfile;
|
|
186
|
+
type LocalDateTimeKMP = mdoc.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: com.sphereon.crypto.cose.CoseSign1Cbor<CborType>, keyInfo: com.sphereon.crypto.IKeyInfo<ICoseKeyCbor>, requireX5Chain: Nullable<boolean>): Promise<com.sphereon.crypto.generic.IVerifySignatureResult<ICoseKeyCbor>>;
|
|
193
|
-
resolvePublicKeyAsync<KT extends com.sphereon.crypto.IKey>(keyInfo: com.sphereon.crypto.IKeyInfo<KT>): Promise<com.sphereon.crypto.IResolvedKeyInfo<KT>>;
|
|
192
|
+
verify1Async<CborType>(input: mdoc.com.sphereon.crypto.cose.CoseSign1Cbor<CborType>, keyInfo: mdoc.com.sphereon.crypto.IKeyInfo<ICoseKeyCbor>, requireX5Chain: Nullable<boolean>): Promise<mdoc.com.sphereon.crypto.generic.IVerifySignatureResult<ICoseKeyCbor>>;
|
|
193
|
+
resolvePublicKeyAsync<KT extends mdoc.com.sphereon.crypto.IKey>(keyInfo: mdoc.com.sphereon.crypto.IKeyInfo<KT>): Promise<mdoc.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<com.sphereon.crypto.IX509VerificationResult<KeyType>>;
|
|
215
|
+
verifyCertificateChainJS<KeyType extends IKey>(chainDER: Nullable<Int8Array[]>, chainPEM: Nullable<string[]>, trustedCerts: Nullable<string[]>, verificationProfile?: X509VerificationProfile | undefined, verificationTime?: Nullable<LocalDateTimeKMP>): Promise<mdoc.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 {
|
|
3
|
+
import * as mdoc from '@sphereon/kmp-mdoc-core';
|
|
4
|
+
import { 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 = com.sphereon.crypto.IKey;
|
|
10
|
-
type CoseSign1Json = com.sphereon.crypto.cose.CoseSign1Json;
|
|
11
|
-
type CoseSign1Cbor<Any> = com.sphereon.crypto.cose.CoseSign1Cbor<Any>;
|
|
12
|
-
type ICoseKeyCbor$1 = com.sphereon.crypto.cose.ICoseKeyCbor;
|
|
13
|
-
type ICoseKeyJson = com.sphereon.crypto.cose.ICoseKeyJson;
|
|
14
|
-
type IKeyInfo<KT extends IKey$1 = IKey$1> = com.sphereon.crypto.IKeyInfo<KT>;
|
|
15
|
-
type IVerifyResults<KT extends IKey$1> = com.sphereon.crypto.generic.IVerifyResults<KT>;
|
|
16
|
-
type IVerifySignatureResult<KT extends IKey$1> = com.sphereon.crypto.generic.IVerifySignatureResult<KT>;
|
|
17
|
-
type DocumentJson = com.sphereon.mdoc.data.device.DocumentJson;
|
|
18
|
-
type DocumentCbor = com.sphereon.mdoc.data.device.DocumentCbor;
|
|
19
|
-
declare const CborByteString: typeof com.sphereon.cbor.CborByteString;
|
|
20
|
-
declare const CoseKeyCbor: typeof com.sphereon.crypto.cose.CoseKeyCbor;
|
|
21
|
-
declare const CoseCryptoServiceJS: typeof com.sphereon.crypto.CoseCryptoServiceJS;
|
|
9
|
+
type IKey$1 = mdoc.com.sphereon.crypto.IKey;
|
|
10
|
+
type CoseSign1Json = mdoc.com.sphereon.crypto.cose.CoseSign1Json;
|
|
11
|
+
type CoseSign1Cbor<Any> = mdoc.com.sphereon.crypto.cose.CoseSign1Cbor<Any>;
|
|
12
|
+
type ICoseKeyCbor$1 = mdoc.com.sphereon.crypto.cose.ICoseKeyCbor;
|
|
13
|
+
type ICoseKeyJson = mdoc.com.sphereon.crypto.cose.ICoseKeyJson;
|
|
14
|
+
type IKeyInfo<KT extends IKey$1 = IKey$1> = mdoc.com.sphereon.crypto.IKeyInfo<KT>;
|
|
15
|
+
type IVerifyResults<KT extends IKey$1> = mdoc.com.sphereon.crypto.generic.IVerifyResults<KT>;
|
|
16
|
+
type IVerifySignatureResult<KT extends IKey$1> = mdoc.com.sphereon.crypto.generic.IVerifySignatureResult<KT>;
|
|
17
|
+
type DocumentJson = mdoc.com.sphereon.mdoc.data.device.DocumentJson;
|
|
18
|
+
type DocumentCbor = mdoc.com.sphereon.mdoc.data.device.DocumentCbor;
|
|
19
|
+
declare const CborByteString: typeof mdoc.com.sphereon.cbor.CborByteString;
|
|
20
|
+
declare const CoseKeyCbor: typeof mdoc.com.sphereon.crypto.cose.CoseKeyCbor;
|
|
21
|
+
declare const CoseCryptoServiceJS: typeof mdoc.com.sphereon.crypto.CoseCryptoServiceJS;
|
|
22
22
|
declare const CoseJoseKeyMappingService: {
|
|
23
|
-
toJoseJwk(key: com.sphereon.crypto.IKey): com.sphereon.crypto.jose.Jwk;
|
|
24
|
-
toCoseKey(key: com.sphereon.crypto.IKey): com.sphereon.crypto.cose.CoseKeyCbor;
|
|
25
|
-
getJoseX5c(key: com.sphereon.crypto.IKey):
|
|
26
|
-
toJoseX5c(x5c:
|
|
27
|
-
toJwkKeyInfo(keyInfo: com.sphereon.crypto.IKeyInfo<any>): com.sphereon.crypto.KeyInfo<com.sphereon.crypto.jose.Jwk>;
|
|
28
|
-
toResolvedJwkKeyInfo(resolvedKeyInfo: com.sphereon.crypto.IResolvedKeyInfo<any>): com.sphereon.crypto.ResolvedKeyInfo<com.sphereon.crypto.jose.Jwk>;
|
|
29
|
-
toCoseKeyInfo(keyInfo: com.sphereon.crypto.IKeyInfo<any>): com.sphereon.crypto.KeyInfo<com.sphereon.crypto.cose.CoseKeyCbor>;
|
|
30
|
-
toResolvedCoseKeyInfo(resolvedKeyInfo: com.sphereon.crypto.IResolvedKeyInfo<any>): com.sphereon.crypto.ResolvedKeyInfo<com.sphereon.crypto.cose.CoseKeyCbor>;
|
|
31
|
-
isResolvedKeyInfo(keyInfo: com.sphereon.crypto.IKeyInfo<any>): boolean;
|
|
32
|
-
toResolvedKeyInfo<KeyType extends com.sphereon.crypto.IKey>(keyInfo: com.sphereon.crypto.IKeyInfo<any>, key?:
|
|
33
|
-
toResolvedKeyInfoWithResolver<KeyType extends com.sphereon.crypto.IKey>(keyInfo: com.sphereon.crypto.IKeyInfo<KeyType>, resolveCallback:
|
|
34
|
-
getCoseX5chain(key: com.sphereon.crypto.IKey):
|
|
35
|
-
toCoseX5chain(x5c:
|
|
23
|
+
toJoseJwk(key: mdoc.com.sphereon.crypto.IKey): mdoc.com.sphereon.crypto.jose.Jwk;
|
|
24
|
+
toCoseKey(key: mdoc.com.sphereon.crypto.IKey): mdoc.com.sphereon.crypto.cose.CoseKeyCbor;
|
|
25
|
+
getJoseX5c(key: mdoc.com.sphereon.crypto.IKey): mdoc.Nullable<Array<string>>;
|
|
26
|
+
toJoseX5c(x5c: mdoc.Nullable<Array<any>>): mdoc.Nullable<Array<string>>;
|
|
27
|
+
toJwkKeyInfo(keyInfo: mdoc.com.sphereon.crypto.IKeyInfo<any>): mdoc.com.sphereon.crypto.KeyInfo<mdoc.com.sphereon.crypto.jose.Jwk>;
|
|
28
|
+
toResolvedJwkKeyInfo(resolvedKeyInfo: mdoc.com.sphereon.crypto.IResolvedKeyInfo<any>): mdoc.com.sphereon.crypto.ResolvedKeyInfo<mdoc.com.sphereon.crypto.jose.Jwk>;
|
|
29
|
+
toCoseKeyInfo(keyInfo: mdoc.com.sphereon.crypto.IKeyInfo<any>): mdoc.com.sphereon.crypto.KeyInfo<mdoc.com.sphereon.crypto.cose.CoseKeyCbor>;
|
|
30
|
+
toResolvedCoseKeyInfo(resolvedKeyInfo: mdoc.com.sphereon.crypto.IResolvedKeyInfo<any>): mdoc.com.sphereon.crypto.ResolvedKeyInfo<mdoc.com.sphereon.crypto.cose.CoseKeyCbor>;
|
|
31
|
+
isResolvedKeyInfo(keyInfo: mdoc.com.sphereon.crypto.IKeyInfo<any>): boolean;
|
|
32
|
+
toResolvedKeyInfo<KeyType extends mdoc.com.sphereon.crypto.IKey>(keyInfo: mdoc.com.sphereon.crypto.IKeyInfo<any>, key?: mdoc.Nullable<KeyType>): mdoc.com.sphereon.crypto.ResolvedKeyInfo<KeyType>;
|
|
33
|
+
toResolvedKeyInfoWithResolver<KeyType extends mdoc.com.sphereon.crypto.IKey>(keyInfo: mdoc.com.sphereon.crypto.IKeyInfo<KeyType>, resolveCallback: mdoc.Nullable<(p0: mdoc.com.sphereon.crypto.IKeyInfo<KeyType>) => mdoc.com.sphereon.crypto.ResolvedKeyInfo<KeyType>>): mdoc.com.sphereon.crypto.ResolvedKeyInfo<KeyType>;
|
|
34
|
+
getCoseX5chain(key: mdoc.com.sphereon.crypto.IKey): mdoc.Nullable<mdoc.com.sphereon.cbor.CborArray<mdoc.com.sphereon.cbor.CborByteString>>;
|
|
35
|
+
toCoseX5chain(x5c: mdoc.Nullable<Array<any>>): mdoc.Nullable<mdoc.com.sphereon.cbor.CborArray<mdoc.com.sphereon.cbor.CborByteString>>;
|
|
36
36
|
};
|
|
37
|
-
declare const KeyInfo: typeof com.sphereon.crypto.KeyInfo;
|
|
38
|
-
declare const DateTimeUtils: typeof com.sphereon.kmp.DateTimeUtils;
|
|
39
|
-
declare const decodeFrom: typeof com.sphereon.kmp.decodeFrom;
|
|
40
|
-
declare const encodeTo: typeof com.sphereon.kmp.encodeTo;
|
|
41
|
-
declare const Encoding: typeof com.sphereon.kmp.Encoding;
|
|
37
|
+
declare const KeyInfo: typeof mdoc.com.sphereon.crypto.KeyInfo;
|
|
38
|
+
declare const DateTimeUtils: typeof mdoc.com.sphereon.kmp.DateTimeUtils;
|
|
39
|
+
declare const decodeFrom: typeof mdoc.com.sphereon.kmp.decodeFrom;
|
|
40
|
+
declare const encodeTo: typeof mdoc.com.sphereon.kmp.encodeTo;
|
|
41
|
+
declare const Encoding: typeof mdoc.com.sphereon.kmp.Encoding;
|
|
42
42
|
declare const MdocValidations: {
|
|
43
|
-
fromDocumentAsync(document: com.sphereon.mdoc.data.device.DocumentCbor, keyInfo?:
|
|
44
|
-
fromIssuerAuthAsync(issuerAuth: com.sphereon.crypto.cose.CoseSign1Cbor<com.sphereon.mdoc.data.mso.MobileSecurityObjectCbor>, keyInfo?:
|
|
45
|
-
withParamsAsync(issuerAuth?:
|
|
43
|
+
fromDocumentAsync(document: mdoc.com.sphereon.mdoc.data.device.DocumentCbor, keyInfo?: mdoc.Nullable<mdoc.com.sphereon.crypto.IKeyInfo<mdoc.com.sphereon.crypto.cose.ICoseKeyCbor>>, trustedCerts?: mdoc.Nullable<Array<string>>, verificationTime?: mdoc.Nullable<mdoc.com.sphereon.kmp.LocalDateTimeKMP>, allowExpiredDocuments?: mdoc.Nullable<boolean>, dateTimeUtils?: mdoc.com.sphereon.kmp.DateTimeUtils, timeZoneId?: mdoc.Nullable<string>, clockSkewAllowedInSec?: number): Promise<mdoc.com.sphereon.crypto.generic.IVerifyResults<mdoc.com.sphereon.crypto.cose.ICoseKeyCbor>>;
|
|
44
|
+
fromIssuerAuthAsync(issuerAuth: mdoc.com.sphereon.crypto.cose.CoseSign1Cbor<mdoc.com.sphereon.mdoc.data.mso.MobileSecurityObjectCbor>, keyInfo?: mdoc.Nullable<mdoc.com.sphereon.crypto.IKeyInfo<mdoc.com.sphereon.crypto.cose.ICoseKeyCbor>>, trustedCerts?: mdoc.Nullable<Array<string>>, verificationTime?: mdoc.Nullable<mdoc.com.sphereon.kmp.LocalDateTimeKMP>, allowExpiredDocuments?: mdoc.Nullable<boolean>, dateTimeUtils?: mdoc.com.sphereon.kmp.DateTimeUtils, timeZoneId?: mdoc.Nullable<string>, clockSkewAllowedInSec?: number): Promise<mdoc.com.sphereon.crypto.generic.IVerifyResults<mdoc.com.sphereon.crypto.cose.ICoseKeyCbor>>;
|
|
45
|
+
withParamsAsync(issuerAuth?: mdoc.Nullable<mdoc.com.sphereon.crypto.cose.CoseSign1Cbor<mdoc.com.sphereon.mdoc.data.mso.MobileSecurityObjectCbor>>, document?: mdoc.Nullable<mdoc.com.sphereon.mdoc.data.device.DocumentCbor>, mdocVerificationTypes?: mdoc.kotlin.collections.KtSet<mdoc.com.sphereon.mdoc.data.MdocVerification>, keyInfo?: mdoc.Nullable<mdoc.com.sphereon.crypto.IKeyInfo<mdoc.com.sphereon.crypto.cose.ICoseKeyCbor>>, trustedCerts?: mdoc.Nullable<Array<string>>, verificationTime?: mdoc.Nullable<mdoc.com.sphereon.kmp.LocalDateTimeKMP>, allowExpiredDocuments?: mdoc.Nullable<boolean>, dateTimeUtils?: mdoc.com.sphereon.kmp.DateTimeUtils, timeZoneId?: mdoc.Nullable<string>, clockSkewAllowedInSec?: number): Promise<mdoc.com.sphereon.crypto.generic.IVerifyResults<mdoc.com.sphereon.crypto.cose.ICoseKeyCbor>>;
|
|
46
46
|
};
|
|
47
|
-
declare const MdocOid4vpService: typeof com.sphereon.mdoc.oid4vp.MdocOid4vpServiceJs;
|
|
48
|
-
declare const Jwk: typeof com.sphereon.crypto.jose.Jwk;
|
|
49
|
-
type DocumentDescriptorMatchResult = com.sphereon.mdoc.oid4vp.DocumentDescriptorMatchResult;
|
|
50
|
-
type IOid4VPPresentationDefinition = com.sphereon.mdoc.oid4vp.IOid4VPPresentationDefinition;
|
|
51
|
-
declare const Oid4VPPresentationSubmission: typeof com.sphereon.mdoc.oid4vp.Oid4VPPresentationSubmission;
|
|
47
|
+
declare const MdocOid4vpService: typeof mdoc.com.sphereon.mdoc.oid4vp.MdocOid4vpServiceJs;
|
|
48
|
+
declare const Jwk: typeof mdoc.com.sphereon.crypto.jose.Jwk;
|
|
49
|
+
type DocumentDescriptorMatchResult = mdoc.com.sphereon.mdoc.oid4vp.DocumentDescriptorMatchResult;
|
|
50
|
+
type IOid4VPPresentationDefinition = mdoc.com.sphereon.mdoc.oid4vp.IOid4VPPresentationDefinition;
|
|
51
|
+
declare const Oid4VPPresentationSubmission: typeof mdoc.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 = com.sphereon.crypto.cose.ICoseKeyCbor;
|
|
181
|
-
type ToBeSignedCbor = com.sphereon.crypto.cose.ToBeSignedCbor;
|
|
182
|
-
type ICoseCryptoCallbackJS = com.sphereon.crypto.ICoseCryptoCallbackJS;
|
|
183
|
-
type IKey = com.sphereon.crypto.IKey;
|
|
184
|
-
type IX509ServiceJS = com.sphereon.crypto.IX509ServiceJS;
|
|
185
|
-
type X509VerificationProfile = com.sphereon.crypto.X509VerificationProfile;
|
|
186
|
-
type LocalDateTimeKMP = com.sphereon.kmp.LocalDateTimeKMP;
|
|
180
|
+
type ICoseKeyCbor = mdoc.com.sphereon.crypto.cose.ICoseKeyCbor;
|
|
181
|
+
type ToBeSignedCbor = mdoc.com.sphereon.crypto.cose.ToBeSignedCbor;
|
|
182
|
+
type ICoseCryptoCallbackJS = mdoc.com.sphereon.crypto.ICoseCryptoCallbackJS;
|
|
183
|
+
type IKey = mdoc.com.sphereon.crypto.IKey;
|
|
184
|
+
type IX509ServiceJS = mdoc.com.sphereon.crypto.IX509ServiceJS;
|
|
185
|
+
type X509VerificationProfile = mdoc.com.sphereon.crypto.X509VerificationProfile;
|
|
186
|
+
type LocalDateTimeKMP = mdoc.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: com.sphereon.crypto.cose.CoseSign1Cbor<CborType>, keyInfo: com.sphereon.crypto.IKeyInfo<ICoseKeyCbor>, requireX5Chain: Nullable<boolean>): Promise<com.sphereon.crypto.generic.IVerifySignatureResult<ICoseKeyCbor>>;
|
|
193
|
-
resolvePublicKeyAsync<KT extends com.sphereon.crypto.IKey>(keyInfo: com.sphereon.crypto.IKeyInfo<KT>): Promise<com.sphereon.crypto.IResolvedKeyInfo<KT>>;
|
|
192
|
+
verify1Async<CborType>(input: mdoc.com.sphereon.crypto.cose.CoseSign1Cbor<CborType>, keyInfo: mdoc.com.sphereon.crypto.IKeyInfo<ICoseKeyCbor>, requireX5Chain: Nullable<boolean>): Promise<mdoc.com.sphereon.crypto.generic.IVerifySignatureResult<ICoseKeyCbor>>;
|
|
193
|
+
resolvePublicKeyAsync<KT extends mdoc.com.sphereon.crypto.IKey>(keyInfo: mdoc.com.sphereon.crypto.IKeyInfo<KT>): Promise<mdoc.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<com.sphereon.crypto.IX509VerificationResult<KeyType>>;
|
|
215
|
+
verifyCertificateChainJS<KeyType extends IKey>(chainDER: Nullable<Int8Array[]>, chainPEM: Nullable<string[]>, trustedCerts: Nullable<string[]>, verificationProfile?: X509VerificationProfile | undefined, verificationTime?: Nullable<LocalDateTimeKMP>): Promise<mdoc.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,25 +2045,25 @@ 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 * as mdoc3 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
|
|
|
2052
2052
|
// src/functions/index.ts
|
|
2053
|
-
import
|
|
2053
|
+
import * as mdoc from "@sphereon/kmp-mdoc-core";
|
|
2054
2054
|
import { calculateJwkThumbprint, globalCrypto, verifyRawSignature } from "@sphereon/ssi-sdk-ext.key-utils";
|
|
2055
2055
|
import { derToPEM, getCertificateInfo, getSubjectDN, pemOrDerToX509Certificate, validateX509CertificateChain } from "@sphereon/ssi-sdk-ext.x509-utils";
|
|
2056
2056
|
import * as crypto from "crypto";
|
|
2057
2057
|
import { CryptoEngine, setEngine } from "pkijs";
|
|
2058
2058
|
import { fromString } from "uint8arrays/from-string";
|
|
2059
|
-
var CoseJoseKeyMappingService = com.sphereon.crypto.CoseJoseKeyMappingService;
|
|
2060
|
-
var KeyInfo = com.sphereon.crypto.KeyInfo;
|
|
2061
|
-
var DateTimeUtils = com.sphereon.kmp.DateTimeUtils;
|
|
2062
|
-
var decodeFrom = com.sphereon.kmp.decodeFrom;
|
|
2063
|
-
var encodeTo = com.sphereon.kmp.encodeTo;
|
|
2064
|
-
var Encoding = com.sphereon.kmp.Encoding;
|
|
2065
|
-
var SignatureAlgorithm = com.sphereon.crypto.generic.SignatureAlgorithm;
|
|
2066
|
-
var DefaultCallbacks = com.sphereon.crypto.DefaultCallbacks;
|
|
2059
|
+
var CoseJoseKeyMappingService = mdoc.com.sphereon.crypto.CoseJoseKeyMappingService;
|
|
2060
|
+
var KeyInfo = mdoc.com.sphereon.crypto.KeyInfo;
|
|
2061
|
+
var DateTimeUtils = mdoc.com.sphereon.kmp.DateTimeUtils;
|
|
2062
|
+
var decodeFrom = mdoc.com.sphereon.kmp.decodeFrom;
|
|
2063
|
+
var encodeTo = mdoc.com.sphereon.kmp.encodeTo;
|
|
2064
|
+
var Encoding = mdoc.com.sphereon.kmp.Encoding;
|
|
2065
|
+
var SignatureAlgorithm = mdoc.com.sphereon.crypto.generic.SignatureAlgorithm;
|
|
2066
|
+
var DefaultCallbacks = mdoc.com.sphereon.crypto.DefaultCallbacks;
|
|
2067
2067
|
var CoseCryptoService = class {
|
|
2068
2068
|
static {
|
|
2069
2069
|
__name(this, "CoseCryptoService");
|
|
@@ -2086,7 +2086,7 @@ var CoseCryptoService = class {
|
|
|
2086
2086
|
if (key == null) {
|
|
2087
2087
|
return Promise.reject(Error("No key present in keyInfo. This implementation cannot sign without a key!"));
|
|
2088
2088
|
}
|
|
2089
|
-
const resolvedKeyInfo = com.sphereon.crypto.ResolvedKeyInfo.Static.fromKeyInfo(keyInfo, key);
|
|
2089
|
+
const resolvedKeyInfo = mdoc.com.sphereon.crypto.ResolvedKeyInfo.Static.fromKeyInfo(keyInfo, key);
|
|
2090
2090
|
const jwkKeyInfo = CoseJoseKeyMappingService.toResolvedJwkKeyInfo(resolvedKeyInfo);
|
|
2091
2091
|
const kid = jwkKeyInfo.kid ?? calculateJwkThumbprint({
|
|
2092
2092
|
jwk: jwkKeyInfo.key.toJsonDTO()
|
|
@@ -2147,7 +2147,7 @@ var CoseCryptoService = class {
|
|
|
2147
2147
|
if (kid === null) {
|
|
2148
2148
|
kid = coseKeyInfo.key.getKidAsString(false);
|
|
2149
2149
|
}
|
|
2150
|
-
issuerCoseKey = com.sphereon.crypto.cose.CoseKeyCbor.Static.fromDTO(coseKeyInfo.key);
|
|
2150
|
+
issuerCoseKey = mdoc.com.sphereon.crypto.cose.CoseKeyCbor.Static.fromDTO(coseKeyInfo.key);
|
|
2151
2151
|
}
|
|
2152
2152
|
const issuerCoseKeyInfo = new KeyInfo(kid, issuerCoseKey, coseKeyInfo.opts, coseKeyInfo.keyVisibility, issuerCoseKey.getSignatureAlgorithm() ?? coseKeyInfo.signatureAlgorithm, x5c, coseKeyInfo.kmsKeyRef, coseKeyInfo.kms, coseKeyInfo.keyType ?? issuerCoseKey.getKty());
|
|
2153
2153
|
const recalculatedToBeSigned = input.toBeSignedJson(issuerCoseKeyInfo, SignatureAlgorithm.Static.fromCose(coseAlg));
|
|
@@ -2267,20 +2267,20 @@ DefaultCallbacks.setCoseCryptoDefault(new CoseCryptoService());
|
|
|
2267
2267
|
DefaultCallbacks.setX509Default(new X509CallbackService());
|
|
2268
2268
|
|
|
2269
2269
|
// src/types/ImDLMdoc.ts
|
|
2270
|
-
import
|
|
2271
|
-
var CborByteString =
|
|
2272
|
-
var CoseKeyCbor =
|
|
2273
|
-
var CoseCryptoServiceJS =
|
|
2274
|
-
var CoseJoseKeyMappingService2 =
|
|
2275
|
-
var KeyInfo2 =
|
|
2276
|
-
var DateTimeUtils2 =
|
|
2277
|
-
var decodeFrom2 =
|
|
2278
|
-
var encodeTo2 =
|
|
2279
|
-
var Encoding2 =
|
|
2280
|
-
var MdocValidations =
|
|
2281
|
-
var MdocOid4vpService =
|
|
2282
|
-
var Jwk =
|
|
2283
|
-
var Oid4VPPresentationSubmission =
|
|
2270
|
+
import * as mdoc2 from "@sphereon/kmp-mdoc-core";
|
|
2271
|
+
var CborByteString = mdoc2.com.sphereon.cbor.CborByteString;
|
|
2272
|
+
var CoseKeyCbor = mdoc2.com.sphereon.crypto.cose.CoseKeyCbor;
|
|
2273
|
+
var CoseCryptoServiceJS = mdoc2.com.sphereon.crypto.CoseCryptoServiceJS;
|
|
2274
|
+
var CoseJoseKeyMappingService2 = mdoc2.com.sphereon.crypto.CoseJoseKeyMappingService;
|
|
2275
|
+
var KeyInfo2 = mdoc2.com.sphereon.crypto.KeyInfo;
|
|
2276
|
+
var DateTimeUtils2 = mdoc2.com.sphereon.kmp.DateTimeUtils;
|
|
2277
|
+
var decodeFrom2 = mdoc2.com.sphereon.kmp.decodeFrom;
|
|
2278
|
+
var encodeTo2 = mdoc2.com.sphereon.kmp.encodeTo;
|
|
2279
|
+
var Encoding2 = mdoc2.com.sphereon.kmp.Encoding;
|
|
2280
|
+
var MdocValidations = mdoc2.com.sphereon.mdoc.data.MdocValidations;
|
|
2281
|
+
var MdocOid4vpService = mdoc2.com.sphereon.mdoc.oid4vp.MdocOid4vpServiceJs;
|
|
2282
|
+
var Jwk = mdoc2.com.sphereon.crypto.jose.Jwk;
|
|
2283
|
+
var Oid4VPPresentationSubmission = mdoc2.com.sphereon.mdoc.oid4vp.Oid4VPPresentationSubmission;
|
|
2284
2284
|
|
|
2285
2285
|
// src/agent/mDLMdoc.ts
|
|
2286
2286
|
var mdocSupportMethods = [
|
|
@@ -2320,9 +2320,9 @@ var MDLMdoc = class {
|
|
|
2320
2320
|
async mdocOid4vpHolderPresent(args, _context) {
|
|
2321
2321
|
const { mdocs, presentationDefinition, trustAnchors, verifications, mdocHolderNonce, authorizationRequestNonce, responseUri, clientId } = args;
|
|
2322
2322
|
const oid4vpService = new MdocOid4vpService();
|
|
2323
|
-
const validate = /* @__PURE__ */ __name(async (
|
|
2323
|
+
const validate = /* @__PURE__ */ __name(async (mdoc4) => {
|
|
2324
2324
|
try {
|
|
2325
|
-
const result = await MdocValidations.fromDocumentAsync(
|
|
2325
|
+
const result = await MdocValidations.fromDocumentAsync(mdoc4, null, trustAnchors ?? this.trustAnchors, DateTimeUtils2.Static.DEFAULT.dateTimeLocal((verifications?.verificationTime?.getTime() ?? Date.now()) / 1e3), verifications?.allowExpiredDocuments);
|
|
2326
2326
|
if (result.error) {
|
|
2327
2327
|
console.log(JSON.stringify(result, null, 2));
|
|
2328
2328
|
}
|
|
@@ -2403,7 +2403,7 @@ var MDLMdoc = class {
|
|
|
2403
2403
|
*/
|
|
2404
2404
|
async mdocOid4vpRPVerify(args, _context) {
|
|
2405
2405
|
const { vp_token, presentation_submission, trustAnchors } = args;
|
|
2406
|
-
const deviceResponse =
|
|
2406
|
+
const deviceResponse = mdoc3.com.sphereon.mdoc.data.device.DeviceResponseCbor.Static.cborDecode(decodeFrom2(vp_token, Encoding2.BASE64URL));
|
|
2407
2407
|
if (!deviceResponse.documents) {
|
|
2408
2408
|
return Promise.reject(Error(`No documents found in vp_token`));
|
|
2409
2409
|
}
|
|
@@ -2464,7 +2464,7 @@ var MDLMdoc = class {
|
|
|
2464
2464
|
async mdocVerifyIssuerSigned(args, context) {
|
|
2465
2465
|
const { input, keyInfo, requireX5Chain } = args;
|
|
2466
2466
|
const coseKeyInfo = keyInfo && CoseJoseKeyMappingService2.toCoseKeyInfo(keyInfo);
|
|
2467
|
-
const verification = await new CoseCryptoServiceJS(new CoseCryptoService(context)).verify1(
|
|
2467
|
+
const verification = await new CoseCryptoServiceJS(new CoseCryptoService(context)).verify1(mdoc3.com.sphereon.crypto.cose.CoseSign1Json.Static.fromDTO(input).toCbor(), coseKeyInfo, requireX5Chain);
|
|
2468
2468
|
return {
|
|
2469
2469
|
...verification,
|
|
2470
2470
|
keyInfo
|