@sphereon/ssi-sdk.mdl-mdoc 0.34.1-feature.FIDES.1.274 → 0.34.1-feature.IDK.11.48
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 +29 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +51 -50
- package/dist/index.d.ts +51 -50
- package/dist/index.js +11 -14
- package/dist/index.js.map +1 -1
- package/package.json +17 -16
- package/plugin.schema.json +1 -1
- package/src/agent/mDLMdoc.ts +2 -3
- package/src/functions/index.ts +28 -31
- package/src/types/ImDLMdoc.ts +13 -14
package/dist/index.d.cts
CHANGED
|
@@ -1,53 +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
|
|
3
|
+
import * as _sphereon_kmp_mdoc_core from '@sphereon/kmp-mdoc-core';
|
|
4
|
+
import { com, Nullable } from '@sphereon/kmp-mdoc-core';
|
|
4
5
|
import { PresentationDefinitionV2, PresentationSubmission } from '@sphereon/pex-models';
|
|
5
6
|
import { ISphereonKeyManager } from '@sphereon/ssi-sdk-ext.key-manager';
|
|
6
7
|
import { X509ValidationResult, SubjectAlternativeGeneralName, CertificateInfo } from '@sphereon/ssi-sdk-ext.x509-utils';
|
|
7
8
|
|
|
8
|
-
type IKey$1 =
|
|
9
|
-
type CoseSign1Json =
|
|
10
|
-
type CoseSign1Cbor<Any> =
|
|
11
|
-
type ICoseKeyCbor$1 =
|
|
12
|
-
type ICoseKeyJson =
|
|
13
|
-
type IKeyInfo<KT extends IKey$1 = IKey$1> =
|
|
14
|
-
type IVerifyResults<KT extends IKey$1> =
|
|
15
|
-
type IVerifySignatureResult<KT extends IKey$1> =
|
|
16
|
-
type DocumentJson =
|
|
17
|
-
type DocumentCbor =
|
|
18
|
-
declare const CborByteString: typeof
|
|
19
|
-
declare const CoseKeyCbor: typeof
|
|
20
|
-
declare const CoseCryptoServiceJS: typeof
|
|
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;
|
|
21
22
|
declare const CoseJoseKeyMappingService: {
|
|
22
|
-
toJoseJwk(key:
|
|
23
|
-
toCoseKey(key:
|
|
24
|
-
getJoseX5c(key:
|
|
25
|
-
toJoseX5c(x5c:
|
|
26
|
-
toJwkKeyInfo(keyInfo:
|
|
27
|
-
toResolvedJwkKeyInfo(resolvedKeyInfo:
|
|
28
|
-
toCoseKeyInfo(keyInfo:
|
|
29
|
-
toResolvedCoseKeyInfo(resolvedKeyInfo:
|
|
30
|
-
isResolvedKeyInfo(keyInfo:
|
|
31
|
-
toResolvedKeyInfo<KeyType extends
|
|
32
|
-
toResolvedKeyInfoWithResolver<KeyType extends
|
|
33
|
-
getCoseX5chain(key:
|
|
34
|
-
toCoseX5chain(x5c:
|
|
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): _sphereon_kmp_mdoc_core.Nullable<Array<string>>;
|
|
26
|
+
toJoseX5c(x5c: _sphereon_kmp_mdoc_core.Nullable<Array<any>>): _sphereon_kmp_mdoc_core.Nullable<Array<string>>;
|
|
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?: _sphereon_kmp_mdoc_core.Nullable<KeyType>): com.sphereon.crypto.ResolvedKeyInfo<KeyType>;
|
|
33
|
+
toResolvedKeyInfoWithResolver<KeyType extends com.sphereon.crypto.IKey>(keyInfo: com.sphereon.crypto.IKeyInfo<KeyType>, resolveCallback: _sphereon_kmp_mdoc_core.Nullable<(p0: com.sphereon.crypto.IKeyInfo<KeyType>) => com.sphereon.crypto.ResolvedKeyInfo<KeyType>>): com.sphereon.crypto.ResolvedKeyInfo<KeyType>;
|
|
34
|
+
getCoseX5chain(key: com.sphereon.crypto.IKey): _sphereon_kmp_mdoc_core.Nullable<com.sphereon.cbor.CborArray<com.sphereon.cbor.CborByteString>>;
|
|
35
|
+
toCoseX5chain(x5c: _sphereon_kmp_mdoc_core.Nullable<Array<any>>): _sphereon_kmp_mdoc_core.Nullable<com.sphereon.cbor.CborArray<com.sphereon.cbor.CborByteString>>;
|
|
35
36
|
};
|
|
36
|
-
declare const KeyInfo: typeof
|
|
37
|
-
declare const DateTimeUtils: typeof
|
|
38
|
-
declare const decodeFrom: typeof
|
|
39
|
-
declare const encodeTo: typeof
|
|
40
|
-
declare const Encoding: typeof
|
|
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;
|
|
41
42
|
declare const MdocValidations: {
|
|
42
|
-
fromDocumentAsync(document:
|
|
43
|
-
fromIssuerAuthAsync(issuerAuth:
|
|
44
|
-
withParamsAsync(issuerAuth?:
|
|
43
|
+
fromDocumentAsync(document: com.sphereon.mdoc.data.device.DocumentCbor, keyInfo?: _sphereon_kmp_mdoc_core.Nullable<com.sphereon.crypto.IKeyInfo<com.sphereon.crypto.cose.ICoseKeyCbor>>, trustedCerts?: _sphereon_kmp_mdoc_core.Nullable<Array<string>>, verificationTime?: _sphereon_kmp_mdoc_core.Nullable<com.sphereon.kmp.LocalDateTimeKMP>, allowExpiredDocuments?: _sphereon_kmp_mdoc_core.Nullable<boolean>, dateTimeUtils?: com.sphereon.kmp.DateTimeUtils, timeZoneId?: _sphereon_kmp_mdoc_core.Nullable<string>, clockSkewAllowedInSec?: number): Promise<com.sphereon.crypto.generic.IVerifyResults<com.sphereon.crypto.cose.ICoseKeyCbor>>;
|
|
44
|
+
fromIssuerAuthAsync(issuerAuth: com.sphereon.crypto.cose.CoseSign1Cbor<com.sphereon.mdoc.data.mso.MobileSecurityObjectCbor>, keyInfo?: _sphereon_kmp_mdoc_core.Nullable<com.sphereon.crypto.IKeyInfo<com.sphereon.crypto.cose.ICoseKeyCbor>>, trustedCerts?: _sphereon_kmp_mdoc_core.Nullable<Array<string>>, verificationTime?: _sphereon_kmp_mdoc_core.Nullable<com.sphereon.kmp.LocalDateTimeKMP>, allowExpiredDocuments?: _sphereon_kmp_mdoc_core.Nullable<boolean>, dateTimeUtils?: com.sphereon.kmp.DateTimeUtils, timeZoneId?: _sphereon_kmp_mdoc_core.Nullable<string>, clockSkewAllowedInSec?: number): Promise<com.sphereon.crypto.generic.IVerifyResults<com.sphereon.crypto.cose.ICoseKeyCbor>>;
|
|
45
|
+
withParamsAsync(issuerAuth?: _sphereon_kmp_mdoc_core.Nullable<com.sphereon.crypto.cose.CoseSign1Cbor<com.sphereon.mdoc.data.mso.MobileSecurityObjectCbor>>, document?: _sphereon_kmp_mdoc_core.Nullable<com.sphereon.mdoc.data.device.DocumentCbor>, mdocVerificationTypes?: _sphereon_kmp_mdoc_core.kotlin.collections.KtSet<com.sphereon.mdoc.data.MdocVerification>, keyInfo?: _sphereon_kmp_mdoc_core.Nullable<com.sphereon.crypto.IKeyInfo<com.sphereon.crypto.cose.ICoseKeyCbor>>, trustedCerts?: _sphereon_kmp_mdoc_core.Nullable<Array<string>>, verificationTime?: _sphereon_kmp_mdoc_core.Nullable<com.sphereon.kmp.LocalDateTimeKMP>, allowExpiredDocuments?: _sphereon_kmp_mdoc_core.Nullable<boolean>, dateTimeUtils?: com.sphereon.kmp.DateTimeUtils, timeZoneId?: _sphereon_kmp_mdoc_core.Nullable<string>, clockSkewAllowedInSec?: number): Promise<com.sphereon.crypto.generic.IVerifyResults<com.sphereon.crypto.cose.ICoseKeyCbor>>;
|
|
45
46
|
};
|
|
46
|
-
declare const MdocOid4vpService: typeof
|
|
47
|
-
declare const Jwk: typeof
|
|
48
|
-
type DocumentDescriptorMatchResult =
|
|
49
|
-
type IOid4VPPresentationDefinition =
|
|
50
|
-
declare const Oid4VPPresentationSubmission: typeof
|
|
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;
|
|
51
52
|
interface ImDLMdoc extends IPluginMethodMap {
|
|
52
53
|
x509VerifyCertificateChain(args: VerifyCertificateChainArgs, context: IRequiredContext): Promise<X509ValidationResult>;
|
|
53
54
|
x509GetCertificateInfo(args: GetX509CertificateInfoArgs, context: IRequiredContext): Promise<CertificateInfo[]>;
|
|
@@ -176,20 +177,20 @@ declare class MDLMdoc implements IAgentPlugin {
|
|
|
176
177
|
private x509GetCertificateInfo;
|
|
177
178
|
}
|
|
178
179
|
|
|
179
|
-
type ICoseKeyCbor =
|
|
180
|
-
type ToBeSignedCbor =
|
|
181
|
-
type ICoseCryptoCallbackJS =
|
|
182
|
-
type IKey =
|
|
183
|
-
type IX509ServiceJS =
|
|
184
|
-
type X509VerificationProfile =
|
|
185
|
-
type LocalDateTimeKMP =
|
|
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;
|
|
186
187
|
declare class CoseCryptoService implements ICoseCryptoCallbackJS {
|
|
187
188
|
private context?;
|
|
188
189
|
constructor(context?: IRequiredContext | undefined);
|
|
189
190
|
setContext(context: IRequiredContext): void;
|
|
190
191
|
signAsync(input: ToBeSignedCbor, requireX5Chain: Nullable<boolean>): Promise<Int8Array>;
|
|
191
|
-
verify1Async<CborType>(input:
|
|
192
|
-
resolvePublicKeyAsync<KT extends
|
|
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>>;
|
|
193
194
|
}
|
|
194
195
|
/**
|
|
195
196
|
* This class can be used for X509 validations.
|
|
@@ -211,7 +212,7 @@ declare class X509CallbackService implements IX509ServiceJS {
|
|
|
211
212
|
/**
|
|
212
213
|
* This method is the implementation used within the mDL/Mdoc library
|
|
213
214
|
*/
|
|
214
|
-
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<com.sphereon.crypto.IX509VerificationResult<KeyType>>;
|
|
215
216
|
setTrustedCerts: (trustedCertsInPEM?: Array<string>) => void;
|
|
216
217
|
getTrustedCerts: () => string[] | undefined;
|
|
217
218
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,53 +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
|
|
3
|
+
import * as _sphereon_kmp_mdoc_core from '@sphereon/kmp-mdoc-core';
|
|
4
|
+
import { com, Nullable } from '@sphereon/kmp-mdoc-core';
|
|
4
5
|
import { PresentationDefinitionV2, PresentationSubmission } from '@sphereon/pex-models';
|
|
5
6
|
import { ISphereonKeyManager } from '@sphereon/ssi-sdk-ext.key-manager';
|
|
6
7
|
import { X509ValidationResult, SubjectAlternativeGeneralName, CertificateInfo } from '@sphereon/ssi-sdk-ext.x509-utils';
|
|
7
8
|
|
|
8
|
-
type IKey$1 =
|
|
9
|
-
type CoseSign1Json =
|
|
10
|
-
type CoseSign1Cbor<Any> =
|
|
11
|
-
type ICoseKeyCbor$1 =
|
|
12
|
-
type ICoseKeyJson =
|
|
13
|
-
type IKeyInfo<KT extends IKey$1 = IKey$1> =
|
|
14
|
-
type IVerifyResults<KT extends IKey$1> =
|
|
15
|
-
type IVerifySignatureResult<KT extends IKey$1> =
|
|
16
|
-
type DocumentJson =
|
|
17
|
-
type DocumentCbor =
|
|
18
|
-
declare const CborByteString: typeof
|
|
19
|
-
declare const CoseKeyCbor: typeof
|
|
20
|
-
declare const CoseCryptoServiceJS: typeof
|
|
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;
|
|
21
22
|
declare const CoseJoseKeyMappingService: {
|
|
22
|
-
toJoseJwk(key:
|
|
23
|
-
toCoseKey(key:
|
|
24
|
-
getJoseX5c(key:
|
|
25
|
-
toJoseX5c(x5c:
|
|
26
|
-
toJwkKeyInfo(keyInfo:
|
|
27
|
-
toResolvedJwkKeyInfo(resolvedKeyInfo:
|
|
28
|
-
toCoseKeyInfo(keyInfo:
|
|
29
|
-
toResolvedCoseKeyInfo(resolvedKeyInfo:
|
|
30
|
-
isResolvedKeyInfo(keyInfo:
|
|
31
|
-
toResolvedKeyInfo<KeyType extends
|
|
32
|
-
toResolvedKeyInfoWithResolver<KeyType extends
|
|
33
|
-
getCoseX5chain(key:
|
|
34
|
-
toCoseX5chain(x5c:
|
|
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): _sphereon_kmp_mdoc_core.Nullable<Array<string>>;
|
|
26
|
+
toJoseX5c(x5c: _sphereon_kmp_mdoc_core.Nullable<Array<any>>): _sphereon_kmp_mdoc_core.Nullable<Array<string>>;
|
|
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?: _sphereon_kmp_mdoc_core.Nullable<KeyType>): com.sphereon.crypto.ResolvedKeyInfo<KeyType>;
|
|
33
|
+
toResolvedKeyInfoWithResolver<KeyType extends com.sphereon.crypto.IKey>(keyInfo: com.sphereon.crypto.IKeyInfo<KeyType>, resolveCallback: _sphereon_kmp_mdoc_core.Nullable<(p0: com.sphereon.crypto.IKeyInfo<KeyType>) => com.sphereon.crypto.ResolvedKeyInfo<KeyType>>): com.sphereon.crypto.ResolvedKeyInfo<KeyType>;
|
|
34
|
+
getCoseX5chain(key: com.sphereon.crypto.IKey): _sphereon_kmp_mdoc_core.Nullable<com.sphereon.cbor.CborArray<com.sphereon.cbor.CborByteString>>;
|
|
35
|
+
toCoseX5chain(x5c: _sphereon_kmp_mdoc_core.Nullable<Array<any>>): _sphereon_kmp_mdoc_core.Nullable<com.sphereon.cbor.CborArray<com.sphereon.cbor.CborByteString>>;
|
|
35
36
|
};
|
|
36
|
-
declare const KeyInfo: typeof
|
|
37
|
-
declare const DateTimeUtils: typeof
|
|
38
|
-
declare const decodeFrom: typeof
|
|
39
|
-
declare const encodeTo: typeof
|
|
40
|
-
declare const Encoding: typeof
|
|
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;
|
|
41
42
|
declare const MdocValidations: {
|
|
42
|
-
fromDocumentAsync(document:
|
|
43
|
-
fromIssuerAuthAsync(issuerAuth:
|
|
44
|
-
withParamsAsync(issuerAuth?:
|
|
43
|
+
fromDocumentAsync(document: com.sphereon.mdoc.data.device.DocumentCbor, keyInfo?: _sphereon_kmp_mdoc_core.Nullable<com.sphereon.crypto.IKeyInfo<com.sphereon.crypto.cose.ICoseKeyCbor>>, trustedCerts?: _sphereon_kmp_mdoc_core.Nullable<Array<string>>, verificationTime?: _sphereon_kmp_mdoc_core.Nullable<com.sphereon.kmp.LocalDateTimeKMP>, allowExpiredDocuments?: _sphereon_kmp_mdoc_core.Nullable<boolean>, dateTimeUtils?: com.sphereon.kmp.DateTimeUtils, timeZoneId?: _sphereon_kmp_mdoc_core.Nullable<string>, clockSkewAllowedInSec?: number): Promise<com.sphereon.crypto.generic.IVerifyResults<com.sphereon.crypto.cose.ICoseKeyCbor>>;
|
|
44
|
+
fromIssuerAuthAsync(issuerAuth: com.sphereon.crypto.cose.CoseSign1Cbor<com.sphereon.mdoc.data.mso.MobileSecurityObjectCbor>, keyInfo?: _sphereon_kmp_mdoc_core.Nullable<com.sphereon.crypto.IKeyInfo<com.sphereon.crypto.cose.ICoseKeyCbor>>, trustedCerts?: _sphereon_kmp_mdoc_core.Nullable<Array<string>>, verificationTime?: _sphereon_kmp_mdoc_core.Nullable<com.sphereon.kmp.LocalDateTimeKMP>, allowExpiredDocuments?: _sphereon_kmp_mdoc_core.Nullable<boolean>, dateTimeUtils?: com.sphereon.kmp.DateTimeUtils, timeZoneId?: _sphereon_kmp_mdoc_core.Nullable<string>, clockSkewAllowedInSec?: number): Promise<com.sphereon.crypto.generic.IVerifyResults<com.sphereon.crypto.cose.ICoseKeyCbor>>;
|
|
45
|
+
withParamsAsync(issuerAuth?: _sphereon_kmp_mdoc_core.Nullable<com.sphereon.crypto.cose.CoseSign1Cbor<com.sphereon.mdoc.data.mso.MobileSecurityObjectCbor>>, document?: _sphereon_kmp_mdoc_core.Nullable<com.sphereon.mdoc.data.device.DocumentCbor>, mdocVerificationTypes?: _sphereon_kmp_mdoc_core.kotlin.collections.KtSet<com.sphereon.mdoc.data.MdocVerification>, keyInfo?: _sphereon_kmp_mdoc_core.Nullable<com.sphereon.crypto.IKeyInfo<com.sphereon.crypto.cose.ICoseKeyCbor>>, trustedCerts?: _sphereon_kmp_mdoc_core.Nullable<Array<string>>, verificationTime?: _sphereon_kmp_mdoc_core.Nullable<com.sphereon.kmp.LocalDateTimeKMP>, allowExpiredDocuments?: _sphereon_kmp_mdoc_core.Nullable<boolean>, dateTimeUtils?: com.sphereon.kmp.DateTimeUtils, timeZoneId?: _sphereon_kmp_mdoc_core.Nullable<string>, clockSkewAllowedInSec?: number): Promise<com.sphereon.crypto.generic.IVerifyResults<com.sphereon.crypto.cose.ICoseKeyCbor>>;
|
|
45
46
|
};
|
|
46
|
-
declare const MdocOid4vpService: typeof
|
|
47
|
-
declare const Jwk: typeof
|
|
48
|
-
type DocumentDescriptorMatchResult =
|
|
49
|
-
type IOid4VPPresentationDefinition =
|
|
50
|
-
declare const Oid4VPPresentationSubmission: typeof
|
|
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;
|
|
51
52
|
interface ImDLMdoc extends IPluginMethodMap {
|
|
52
53
|
x509VerifyCertificateChain(args: VerifyCertificateChainArgs, context: IRequiredContext): Promise<X509ValidationResult>;
|
|
53
54
|
x509GetCertificateInfo(args: GetX509CertificateInfoArgs, context: IRequiredContext): Promise<CertificateInfo[]>;
|
|
@@ -176,20 +177,20 @@ declare class MDLMdoc implements IAgentPlugin {
|
|
|
176
177
|
private x509GetCertificateInfo;
|
|
177
178
|
}
|
|
178
179
|
|
|
179
|
-
type ICoseKeyCbor =
|
|
180
|
-
type ToBeSignedCbor =
|
|
181
|
-
type ICoseCryptoCallbackJS =
|
|
182
|
-
type IKey =
|
|
183
|
-
type IX509ServiceJS =
|
|
184
|
-
type X509VerificationProfile =
|
|
185
|
-
type LocalDateTimeKMP =
|
|
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;
|
|
186
187
|
declare class CoseCryptoService implements ICoseCryptoCallbackJS {
|
|
187
188
|
private context?;
|
|
188
189
|
constructor(context?: IRequiredContext | undefined);
|
|
189
190
|
setContext(context: IRequiredContext): void;
|
|
190
191
|
signAsync(input: ToBeSignedCbor, requireX5Chain: Nullable<boolean>): Promise<Int8Array>;
|
|
191
|
-
verify1Async<CborType>(input:
|
|
192
|
-
resolvePublicKeyAsync<KT extends
|
|
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>>;
|
|
193
194
|
}
|
|
194
195
|
/**
|
|
195
196
|
* This class can be used for X509 validations.
|
|
@@ -211,7 +212,7 @@ declare class X509CallbackService implements IX509ServiceJS {
|
|
|
211
212
|
/**
|
|
212
213
|
* This method is the implementation used within the mDL/Mdoc library
|
|
213
214
|
*/
|
|
214
|
-
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<com.sphereon.crypto.IX509VerificationResult<KeyType>>;
|
|
215
216
|
setTrustedCerts: (trustedCertsInPEM?: Array<string>) => void;
|
|
216
217
|
getTrustedCerts: () => string[] | undefined;
|
|
217
218
|
}
|
package/dist/index.js
CHANGED
|
@@ -356,7 +356,7 @@ var require_plugin_schema = __commonJS({
|
|
|
356
356
|
di_vp: {
|
|
357
357
|
$ref: "#/components/schemas/DiObject"
|
|
358
358
|
},
|
|
359
|
-
"
|
|
359
|
+
"vc+sd-jwt": {
|
|
360
360
|
$ref: "#/components/schemas/SdJwtObject"
|
|
361
361
|
}
|
|
362
362
|
}
|
|
@@ -2045,26 +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 { com as com3 } 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 { com } 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 { com } = mdocPkg;
|
|
2060
2059
|
var CoseJoseKeyMappingService = com.sphereon.crypto.CoseJoseKeyMappingService;
|
|
2061
|
-
var KeyInfo =
|
|
2062
|
-
var DateTimeUtils =
|
|
2063
|
-
var decodeFrom =
|
|
2064
|
-
var encodeTo =
|
|
2065
|
-
var Encoding =
|
|
2066
|
-
var SignatureAlgorithm =
|
|
2067
|
-
var DefaultCallbacks =
|
|
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;
|
|
2068
2067
|
var CoseCryptoService = class {
|
|
2069
2068
|
static {
|
|
2070
2069
|
__name(this, "CoseCryptoService");
|
|
@@ -2268,8 +2267,7 @@ DefaultCallbacks.setCoseCryptoDefault(new CoseCryptoService());
|
|
|
2268
2267
|
DefaultCallbacks.setX509Default(new X509CallbackService());
|
|
2269
2268
|
|
|
2270
2269
|
// src/types/ImDLMdoc.ts
|
|
2271
|
-
import
|
|
2272
|
-
var { com: com2 } = mdocPkg2;
|
|
2270
|
+
import { com as com2 } from "@sphereon/kmp-mdoc-core";
|
|
2273
2271
|
var CborByteString = com2.sphereon.cbor.CborByteString;
|
|
2274
2272
|
var CoseKeyCbor = com2.sphereon.crypto.cose.CoseKeyCbor;
|
|
2275
2273
|
var CoseCryptoServiceJS = com2.sphereon.crypto.CoseCryptoServiceJS;
|
|
@@ -2285,7 +2283,6 @@ var Jwk = com2.sphereon.crypto.jose.Jwk;
|
|
|
2285
2283
|
var Oid4VPPresentationSubmission = com2.sphereon.mdoc.oid4vp.Oid4VPPresentationSubmission;
|
|
2286
2284
|
|
|
2287
2285
|
// src/agent/mDLMdoc.ts
|
|
2288
|
-
var { com: com3 } = mdocPkg3;
|
|
2289
2286
|
var mdocSupportMethods = [
|
|
2290
2287
|
"x509VerifyCertificateChain",
|
|
2291
2288
|
"x509GetCertificateInfo",
|