@sphereon/ssi-sdk.mdl-mdoc 0.34.1-feature.merge.crypto.extensions.modules.39 → 0.34.1-fix.79
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 +12 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +17 -17
- package/src/functions/index.ts +23 -21
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _sphereon_ssi_types from '@sphereon/ssi-types';
|
|
2
2
|
import { IPluginMethodMap, IAgentContext, IDIDManager, IResolver, IAgentPlugin } from '@veramo/core';
|
|
3
3
|
import * as _sphereon_kmp_mdoc_core from '@sphereon/kmp-mdoc-core';
|
|
4
|
-
import { com, Nullable } from '@sphereon/kmp-mdoc-core';
|
|
4
|
+
import _sphereon_kmp_mdoc_core__default, { com, 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';
|
|
@@ -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 = _sphereon_kmp_mdoc_core__default.com.sphereon.crypto.cose.ICoseKeyCbor;
|
|
181
|
+
type ToBeSignedCbor = _sphereon_kmp_mdoc_core__default.com.sphereon.crypto.cose.ToBeSignedCbor;
|
|
182
|
+
type ICoseCryptoCallbackJS = _sphereon_kmp_mdoc_core__default.com.sphereon.crypto.ICoseCryptoCallbackJS;
|
|
183
|
+
type IKey = _sphereon_kmp_mdoc_core__default.com.sphereon.crypto.IKey;
|
|
184
|
+
type IX509ServiceJS = _sphereon_kmp_mdoc_core__default.com.sphereon.crypto.IX509ServiceJS;
|
|
185
|
+
type X509VerificationProfile = _sphereon_kmp_mdoc_core__default.com.sphereon.crypto.X509VerificationProfile;
|
|
186
|
+
type LocalDateTimeKMP = _sphereon_kmp_mdoc_core__default.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: _sphereon_kmp_mdoc_core__default.com.sphereon.crypto.cose.CoseSign1Cbor<CborType>, keyInfo: _sphereon_kmp_mdoc_core__default.com.sphereon.crypto.IKeyInfo<ICoseKeyCbor>, requireX5Chain: Nullable<boolean>): Promise<_sphereon_kmp_mdoc_core__default.com.sphereon.crypto.generic.IVerifySignatureResult<ICoseKeyCbor>>;
|
|
193
|
+
resolvePublicKeyAsync<KT extends _sphereon_kmp_mdoc_core__default.com.sphereon.crypto.IKey>(keyInfo: _sphereon_kmp_mdoc_core__default.com.sphereon.crypto.IKeyInfo<KT>): Promise<_sphereon_kmp_mdoc_core__default.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<_sphereon_kmp_mdoc_core__default.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,7 +1,7 @@
|
|
|
1
1
|
import * as _sphereon_ssi_types from '@sphereon/ssi-types';
|
|
2
2
|
import { IPluginMethodMap, IAgentContext, IDIDManager, IResolver, IAgentPlugin } from '@veramo/core';
|
|
3
3
|
import * as _sphereon_kmp_mdoc_core from '@sphereon/kmp-mdoc-core';
|
|
4
|
-
import { com, Nullable } from '@sphereon/kmp-mdoc-core';
|
|
4
|
+
import _sphereon_kmp_mdoc_core__default, { com, 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';
|
|
@@ -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 = _sphereon_kmp_mdoc_core__default.com.sphereon.crypto.cose.ICoseKeyCbor;
|
|
181
|
+
type ToBeSignedCbor = _sphereon_kmp_mdoc_core__default.com.sphereon.crypto.cose.ToBeSignedCbor;
|
|
182
|
+
type ICoseCryptoCallbackJS = _sphereon_kmp_mdoc_core__default.com.sphereon.crypto.ICoseCryptoCallbackJS;
|
|
183
|
+
type IKey = _sphereon_kmp_mdoc_core__default.com.sphereon.crypto.IKey;
|
|
184
|
+
type IX509ServiceJS = _sphereon_kmp_mdoc_core__default.com.sphereon.crypto.IX509ServiceJS;
|
|
185
|
+
type X509VerificationProfile = _sphereon_kmp_mdoc_core__default.com.sphereon.crypto.X509VerificationProfile;
|
|
186
|
+
type LocalDateTimeKMP = _sphereon_kmp_mdoc_core__default.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: _sphereon_kmp_mdoc_core__default.com.sphereon.crypto.cose.CoseSign1Cbor<CborType>, keyInfo: _sphereon_kmp_mdoc_core__default.com.sphereon.crypto.IKeyInfo<ICoseKeyCbor>, requireX5Chain: Nullable<boolean>): Promise<_sphereon_kmp_mdoc_core__default.com.sphereon.crypto.generic.IVerifySignatureResult<ICoseKeyCbor>>;
|
|
193
|
+
resolvePublicKeyAsync<KT extends _sphereon_kmp_mdoc_core__default.com.sphereon.crypto.IKey>(keyInfo: _sphereon_kmp_mdoc_core__default.com.sphereon.crypto.IKeyInfo<KT>): Promise<_sphereon_kmp_mdoc_core__default.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<_sphereon_kmp_mdoc_core__default.com.sphereon.crypto.IX509VerificationResult<KeyType>>;
|
|
216
216
|
setTrustedCerts: (trustedCertsInPEM?: Array<string>) => void;
|
|
217
217
|
getTrustedCerts: () => string[] | undefined;
|
|
218
218
|
}
|
package/dist/index.js
CHANGED
|
@@ -2050,12 +2050,13 @@ import { calculateJwkThumbprint as calculateJwkThumbprint2 } from "@sphereon/ssi
|
|
|
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 mdocPkg 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;
|
|
2059
2060
|
var CoseJoseKeyMappingService = com.sphereon.crypto.CoseJoseKeyMappingService;
|
|
2060
2061
|
var KeyInfo = com.sphereon.crypto.KeyInfo;
|
|
2061
2062
|
var DateTimeUtils = com.sphereon.kmp.DateTimeUtils;
|