node-opcua-crypto 4.16.1 → 5.0.0

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.
@@ -72,7 +72,7 @@ import {
72
72
  verifyChunkSignature,
73
73
  verifyChunkSignatureWithDerivedKeys,
74
74
  verifyMessageChunkSignature
75
- } from "../chunk-MGQCHN54.mjs";
75
+ } from "../chunk-BIS3W2GR.mjs";
76
76
  export {
77
77
  CertificatePurpose,
78
78
  PaddingAlgorithm,
@@ -1,11 +1,8 @@
1
- import { C as Certificate, P as PrivateKey, d as CertificatePEM, b as PEM, D as DER, f as PublicKeyPEM, S as Signature, K as KeyObject, e as PrivateKeyPEM, a as PublicKey, N as Nonce, g as CertificateRevocationList, h as CertificatePurpose } from '../common-CFr95Map.mjs';
2
- export { c as createPrivateKeyFromNodeJSCrypto, i as isKeyObject } from '../common-CFr95Map.mjs';
3
- import { KeyLike } from 'crypto';
1
+ import { C as Certificate, d as CertificatePEM, b as PEM, D as DER, P as PrivateKey, f as PublicKeyPEM, S as Signature, K as KeyObject, e as PrivateKeyPEM, a as PublicKey, N as Nonce, g as CertificateRevocationList, h as CertificatePurpose } from '../common-DxHkx4Pv.mjs';
2
+ export { c as createPrivateKeyFromNodeJSCrypto, i as isKeyObject } from '../common-DxHkx4Pv.mjs';
3
+ import { KeyLike } from 'node:crypto';
4
4
  import * as x509 from '@peculiar/x509';
5
5
 
6
- declare function publicKeyAndPrivateKeyMatches(certificate: Certificate, privateKey: PrivateKey): boolean;
7
- declare function certificateMatchesPrivateKey(certificate: Certificate, privateKey: PrivateKey): boolean;
8
-
9
6
  interface DirectoryName {
10
7
  stateOrProvinceName?: string;
11
8
  localityName?: string;
@@ -88,7 +85,7 @@ declare function exploreCertificateInfo(certificate: Certificate | CertificatePE
88
85
  */
89
86
 
90
87
  interface AttributeTypeAndValue {
91
- [key: string]: any;
88
+ [key: string]: unknown;
92
89
  }
93
90
  interface Validity {
94
91
  notBefore: Date;
@@ -124,7 +121,9 @@ declare function readExtension(buffer: Buffer, block: BlockInfo): {
124
121
  oid: string;
125
122
  name: string;
126
123
  };
127
- value: any;
124
+ value: string | X509KeyUsage | X509ExtKeyUsage | AuthorityKeyIdentifier | BasicConstraints | {
125
+ [key: string]: string[];
126
+ };
128
127
  };
129
128
  interface SubjectPublicKeyInfo {
130
129
  algorithm: string;
@@ -148,12 +147,14 @@ interface CertificateExtension {
148
147
  authorityKeyIdentifier?: AuthorityKeyIdentifier;
149
148
  keyUsage?: X509KeyUsage;
150
149
  extKeyUsage?: X509ExtKeyUsage;
151
- subjectAltName?: any;
150
+ subjectAltName?: {
151
+ [key: string]: string[];
152
+ };
152
153
  }
153
154
  interface TbsCertificate {
154
155
  version: number;
155
156
  serialNumber: string;
156
- issuer: any;
157
+ issuer: DirectoryName;
157
158
  signature: AlgorithmIdentifier;
158
159
  validity: Validity;
159
160
  subject: DirectoryName;
@@ -365,10 +366,16 @@ interface CertificateRevocationListInfo {
365
366
  declare function readNameForCrl(buffer: Buffer, block: BlockInfo): DirectoryName;
366
367
  declare function exploreCertificateRevocationList(crl: CertificateRevocationList): CertificateRevocationListInfo;
367
368
 
369
+ interface SubjectAltName {
370
+ uniformResourceIdentifier: string[];
371
+ dNSName: string[];
372
+ iPAddress: string[];
373
+ [key: string]: unknown;
374
+ }
368
375
  interface ExtensionRequest {
369
376
  basicConstraints: BasicConstraints;
370
377
  keyUsage: X509KeyUsage;
371
- subjectAltName: any;
378
+ subjectAltName: SubjectAltName;
372
379
  }
373
380
  interface CertificateSigningRequestInfo {
374
381
  extensionRequest: ExtensionRequest;
@@ -406,7 +413,10 @@ declare function explorePrivateKey(privateKey2: PrivateKey): PrivateKeyInternals
406
413
 
407
414
  declare function makePrivateKeyFromPem(privateKeyInPem: string): PrivateKey;
408
415
 
409
- declare function makePrivateKeyThumbPrint(privateKey: PrivateKey): Buffer;
416
+ declare function makePrivateKeyThumbPrint(_privateKey: PrivateKey): Buffer;
417
+
418
+ declare function publicKeyAndPrivateKeyMatches(certificate: Certificate, privateKey: PrivateKey): boolean;
419
+ declare function certificateMatchesPrivateKey(certificate: Certificate, privateKey: PrivateKey): boolean;
410
420
 
411
421
  interface SubjectOptions {
412
422
  commonName?: string;
@@ -450,7 +460,7 @@ declare function coercePEMorDerToPrivateKey(privateKeyInDerOrPem: string | Buffe
450
460
  *
451
461
  * @private
452
462
  */
453
- declare function _coercePrivateKey(privateKey: any): Promise<KeyObject>;
463
+ declare function _coercePrivateKey(privateKey: unknown): Promise<KeyObject>;
454
464
 
455
465
  interface CreateCertificateSigningRequestOptions {
456
466
  privateKey: CryptoKey;
@@ -503,10 +513,6 @@ declare function createSelfSignedCertificate({ privateKey, notAfter, notBefore,
503
513
  der: x509.X509Certificate;
504
514
  }>;
505
515
 
506
- /**
507
- * @module node_opcua_crypto
508
- */
509
-
510
516
  declare const asn1: {
511
517
  readDirectoryName: typeof readDirectoryName;
512
518
  readTag: typeof readTag;
@@ -515,4 +521,4 @@ declare const asn1: {
515
521
  readSignatureValueBin: typeof readSignatureValueBin;
516
522
  };
517
523
 
518
- export { type AttributeTypeAndValue, type AuthorityKeyIdentifier, type BasicConstraints, Certificate, type CertificateExtension, type CertificateInfo, type CertificateInternals, CertificatePEM, CertificatePurpose, CertificateRevocationList, type CertificateRevocationListInfo, type CertificateSerialNumber, type CertificateSigningRequestInfo, type ComputeDerivedKeysOptions, type CreateSelfSignCertificateOptions, DER, type DerivedKeys, type DirectoryName, type ExtensionRequest, type Extensions, KeyObject, type Name, Nonce, PEM, PaddingAlgorithm, PrivateKey, type PrivateKeyInternals, PrivateKeyPEM, PublicKey, type PublicKeyLength, PublicKeyPEM, RSA_PKCS1_OAEP_PADDING, RSA_PKCS1_PADDING, type RevokedCertificate, Signature, Subject, type SubjectOptions, type SubjectPublicKey, type SubjectPublicKeyInfo, type TBSCertList, type TbsCertificate, type Validity, type VerifyChunkSignatureOptions, type VerifyMessageChunkSignatureOptions, type Version, type X509ExtKeyUsage, type X509KeyUsage, type _VerifyStatus, _coercePrivateKey, asn1, certificateMatchesPrivateKey, coerceCertificate, coerceCertificatePem, coercePEMorDerToPrivateKey, coercePrivateKeyPem, coercePublicKeyPem, coerceRsaPublicKeyPem, combine_der, computeDerivedKeys, computePaddingFooter, convertPEMtoDER, createCertificateSigningRequest, createSelfSignedCertificate, decryptBufferWithDerivedKeys, derToPrivateKey, encryptBufferWithDerivedKeys, exploreAsn1, exploreCertificate, exploreCertificateInfo, exploreCertificateRevocationList, exploreCertificateSigningRequest, explorePrivateKey, extractPublicKeyFromCertificate, extractPublicKeyFromCertificateSync, generateKeyPair, generatePrivateKey, hexDump, identifyPemType, makeMessageChunkSignature, makeMessageChunkSignatureWithDerivedKeys, makePrivateKeyFromPem, makePrivateKeyThumbPrint, makePseudoRandomBuffer, makeSHA1Thumbprint, pemToPrivateKey, privateDecrypt, privateDecrypt_long, privateDecrypt_native, privateKeyToPEM, publicEncrypt, publicEncrypt_long, publicEncrypt_native, publicKeyAndPrivateKeyMatches, readCertificationRequestInfo, readExtension, readNameForCrl, readTbsCertificate, reduceLength, removePadding, removeTrailingLF, rsaLengthPrivateKey, rsaLengthPublicKey, rsaLengthRsaPublicKey, split_der, toPem, toPem2, verifyCertificateChain, verifyCertificateOrClrSignature, verifyCertificateRevocationListSignature, verifyCertificateSignature, verifyChunkSignature, verifyChunkSignatureWithDerivedKeys, verifyMessageChunkSignature };
524
+ export { type AttributeTypeAndValue, type AuthorityKeyIdentifier, type BasicConstraints, Certificate, type CertificateExtension, type CertificateInfo, type CertificateInternals, CertificatePEM, CertificatePurpose, CertificateRevocationList, type CertificateRevocationListInfo, type CertificateSerialNumber, type CertificateSigningRequestInfo, type ComputeDerivedKeysOptions, type CreateSelfSignCertificateOptions, DER, type DerivedKeys, type DirectoryName, type ExtensionRequest, type Extensions, KeyObject, type Name, Nonce, PEM, PaddingAlgorithm, PrivateKey, type PrivateKeyInternals, PrivateKeyPEM, PublicKey, type PublicKeyLength, PublicKeyPEM, RSA_PKCS1_OAEP_PADDING, RSA_PKCS1_PADDING, type RevokedCertificate, Signature, Subject, type SubjectAltName, type SubjectOptions, type SubjectPublicKey, type SubjectPublicKeyInfo, type TBSCertList, type TbsCertificate, type Validity, type VerifyChunkSignatureOptions, type VerifyMessageChunkSignatureOptions, type Version, type X509ExtKeyUsage, type X509KeyUsage, type _VerifyStatus, _coercePrivateKey, asn1, certificateMatchesPrivateKey, coerceCertificate, coerceCertificatePem, coercePEMorDerToPrivateKey, coercePrivateKeyPem, coercePublicKeyPem, coerceRsaPublicKeyPem, combine_der, computeDerivedKeys, computePaddingFooter, convertPEMtoDER, createCertificateSigningRequest, createSelfSignedCertificate, decryptBufferWithDerivedKeys, derToPrivateKey, encryptBufferWithDerivedKeys, exploreAsn1, exploreCertificate, exploreCertificateInfo, exploreCertificateRevocationList, exploreCertificateSigningRequest, explorePrivateKey, extractPublicKeyFromCertificate, extractPublicKeyFromCertificateSync, generateKeyPair, generatePrivateKey, hexDump, identifyPemType, makeMessageChunkSignature, makeMessageChunkSignatureWithDerivedKeys, makePrivateKeyFromPem, makePrivateKeyThumbPrint, makePseudoRandomBuffer, makeSHA1Thumbprint, pemToPrivateKey, privateDecrypt, privateDecrypt_long, privateDecrypt_native, privateKeyToPEM, publicEncrypt, publicEncrypt_long, publicEncrypt_native, publicKeyAndPrivateKeyMatches, readCertificationRequestInfo, readExtension, readNameForCrl, readTbsCertificate, reduceLength, removePadding, removeTrailingLF, rsaLengthPrivateKey, rsaLengthPublicKey, rsaLengthRsaPublicKey, split_der, toPem, toPem2, verifyCertificateChain, verifyCertificateOrClrSignature, verifyCertificateRevocationListSignature, verifyCertificateSignature, verifyChunkSignature, verifyChunkSignatureWithDerivedKeys, verifyMessageChunkSignature };
@@ -1,11 +1,8 @@
1
- import { C as Certificate, P as PrivateKey, d as CertificatePEM, b as PEM, D as DER, f as PublicKeyPEM, S as Signature, K as KeyObject, e as PrivateKeyPEM, a as PublicKey, N as Nonce, g as CertificateRevocationList, h as CertificatePurpose } from '../common-CFr95Map.js';
2
- export { c as createPrivateKeyFromNodeJSCrypto, i as isKeyObject } from '../common-CFr95Map.js';
3
- import { KeyLike } from 'crypto';
1
+ import { C as Certificate, d as CertificatePEM, b as PEM, D as DER, P as PrivateKey, f as PublicKeyPEM, S as Signature, K as KeyObject, e as PrivateKeyPEM, a as PublicKey, N as Nonce, g as CertificateRevocationList, h as CertificatePurpose } from '../common-DxHkx4Pv.js';
2
+ export { c as createPrivateKeyFromNodeJSCrypto, i as isKeyObject } from '../common-DxHkx4Pv.js';
3
+ import { KeyLike } from 'node:crypto';
4
4
  import * as x509 from '@peculiar/x509';
5
5
 
6
- declare function publicKeyAndPrivateKeyMatches(certificate: Certificate, privateKey: PrivateKey): boolean;
7
- declare function certificateMatchesPrivateKey(certificate: Certificate, privateKey: PrivateKey): boolean;
8
-
9
6
  interface DirectoryName {
10
7
  stateOrProvinceName?: string;
11
8
  localityName?: string;
@@ -88,7 +85,7 @@ declare function exploreCertificateInfo(certificate: Certificate | CertificatePE
88
85
  */
89
86
 
90
87
  interface AttributeTypeAndValue {
91
- [key: string]: any;
88
+ [key: string]: unknown;
92
89
  }
93
90
  interface Validity {
94
91
  notBefore: Date;
@@ -124,7 +121,9 @@ declare function readExtension(buffer: Buffer, block: BlockInfo): {
124
121
  oid: string;
125
122
  name: string;
126
123
  };
127
- value: any;
124
+ value: string | X509KeyUsage | X509ExtKeyUsage | AuthorityKeyIdentifier | BasicConstraints | {
125
+ [key: string]: string[];
126
+ };
128
127
  };
129
128
  interface SubjectPublicKeyInfo {
130
129
  algorithm: string;
@@ -148,12 +147,14 @@ interface CertificateExtension {
148
147
  authorityKeyIdentifier?: AuthorityKeyIdentifier;
149
148
  keyUsage?: X509KeyUsage;
150
149
  extKeyUsage?: X509ExtKeyUsage;
151
- subjectAltName?: any;
150
+ subjectAltName?: {
151
+ [key: string]: string[];
152
+ };
152
153
  }
153
154
  interface TbsCertificate {
154
155
  version: number;
155
156
  serialNumber: string;
156
- issuer: any;
157
+ issuer: DirectoryName;
157
158
  signature: AlgorithmIdentifier;
158
159
  validity: Validity;
159
160
  subject: DirectoryName;
@@ -365,10 +366,16 @@ interface CertificateRevocationListInfo {
365
366
  declare function readNameForCrl(buffer: Buffer, block: BlockInfo): DirectoryName;
366
367
  declare function exploreCertificateRevocationList(crl: CertificateRevocationList): CertificateRevocationListInfo;
367
368
 
369
+ interface SubjectAltName {
370
+ uniformResourceIdentifier: string[];
371
+ dNSName: string[];
372
+ iPAddress: string[];
373
+ [key: string]: unknown;
374
+ }
368
375
  interface ExtensionRequest {
369
376
  basicConstraints: BasicConstraints;
370
377
  keyUsage: X509KeyUsage;
371
- subjectAltName: any;
378
+ subjectAltName: SubjectAltName;
372
379
  }
373
380
  interface CertificateSigningRequestInfo {
374
381
  extensionRequest: ExtensionRequest;
@@ -406,7 +413,10 @@ declare function explorePrivateKey(privateKey2: PrivateKey): PrivateKeyInternals
406
413
 
407
414
  declare function makePrivateKeyFromPem(privateKeyInPem: string): PrivateKey;
408
415
 
409
- declare function makePrivateKeyThumbPrint(privateKey: PrivateKey): Buffer;
416
+ declare function makePrivateKeyThumbPrint(_privateKey: PrivateKey): Buffer;
417
+
418
+ declare function publicKeyAndPrivateKeyMatches(certificate: Certificate, privateKey: PrivateKey): boolean;
419
+ declare function certificateMatchesPrivateKey(certificate: Certificate, privateKey: PrivateKey): boolean;
410
420
 
411
421
  interface SubjectOptions {
412
422
  commonName?: string;
@@ -450,7 +460,7 @@ declare function coercePEMorDerToPrivateKey(privateKeyInDerOrPem: string | Buffe
450
460
  *
451
461
  * @private
452
462
  */
453
- declare function _coercePrivateKey(privateKey: any): Promise<KeyObject>;
463
+ declare function _coercePrivateKey(privateKey: unknown): Promise<KeyObject>;
454
464
 
455
465
  interface CreateCertificateSigningRequestOptions {
456
466
  privateKey: CryptoKey;
@@ -503,10 +513,6 @@ declare function createSelfSignedCertificate({ privateKey, notAfter, notBefore,
503
513
  der: x509.X509Certificate;
504
514
  }>;
505
515
 
506
- /**
507
- * @module node_opcua_crypto
508
- */
509
-
510
516
  declare const asn1: {
511
517
  readDirectoryName: typeof readDirectoryName;
512
518
  readTag: typeof readTag;
@@ -515,4 +521,4 @@ declare const asn1: {
515
521
  readSignatureValueBin: typeof readSignatureValueBin;
516
522
  };
517
523
 
518
- export { type AttributeTypeAndValue, type AuthorityKeyIdentifier, type BasicConstraints, Certificate, type CertificateExtension, type CertificateInfo, type CertificateInternals, CertificatePEM, CertificatePurpose, CertificateRevocationList, type CertificateRevocationListInfo, type CertificateSerialNumber, type CertificateSigningRequestInfo, type ComputeDerivedKeysOptions, type CreateSelfSignCertificateOptions, DER, type DerivedKeys, type DirectoryName, type ExtensionRequest, type Extensions, KeyObject, type Name, Nonce, PEM, PaddingAlgorithm, PrivateKey, type PrivateKeyInternals, PrivateKeyPEM, PublicKey, type PublicKeyLength, PublicKeyPEM, RSA_PKCS1_OAEP_PADDING, RSA_PKCS1_PADDING, type RevokedCertificate, Signature, Subject, type SubjectOptions, type SubjectPublicKey, type SubjectPublicKeyInfo, type TBSCertList, type TbsCertificate, type Validity, type VerifyChunkSignatureOptions, type VerifyMessageChunkSignatureOptions, type Version, type X509ExtKeyUsage, type X509KeyUsage, type _VerifyStatus, _coercePrivateKey, asn1, certificateMatchesPrivateKey, coerceCertificate, coerceCertificatePem, coercePEMorDerToPrivateKey, coercePrivateKeyPem, coercePublicKeyPem, coerceRsaPublicKeyPem, combine_der, computeDerivedKeys, computePaddingFooter, convertPEMtoDER, createCertificateSigningRequest, createSelfSignedCertificate, decryptBufferWithDerivedKeys, derToPrivateKey, encryptBufferWithDerivedKeys, exploreAsn1, exploreCertificate, exploreCertificateInfo, exploreCertificateRevocationList, exploreCertificateSigningRequest, explorePrivateKey, extractPublicKeyFromCertificate, extractPublicKeyFromCertificateSync, generateKeyPair, generatePrivateKey, hexDump, identifyPemType, makeMessageChunkSignature, makeMessageChunkSignatureWithDerivedKeys, makePrivateKeyFromPem, makePrivateKeyThumbPrint, makePseudoRandomBuffer, makeSHA1Thumbprint, pemToPrivateKey, privateDecrypt, privateDecrypt_long, privateDecrypt_native, privateKeyToPEM, publicEncrypt, publicEncrypt_long, publicEncrypt_native, publicKeyAndPrivateKeyMatches, readCertificationRequestInfo, readExtension, readNameForCrl, readTbsCertificate, reduceLength, removePadding, removeTrailingLF, rsaLengthPrivateKey, rsaLengthPublicKey, rsaLengthRsaPublicKey, split_der, toPem, toPem2, verifyCertificateChain, verifyCertificateOrClrSignature, verifyCertificateRevocationListSignature, verifyCertificateSignature, verifyChunkSignature, verifyChunkSignatureWithDerivedKeys, verifyMessageChunkSignature };
524
+ export { type AttributeTypeAndValue, type AuthorityKeyIdentifier, type BasicConstraints, Certificate, type CertificateExtension, type CertificateInfo, type CertificateInternals, CertificatePEM, CertificatePurpose, CertificateRevocationList, type CertificateRevocationListInfo, type CertificateSerialNumber, type CertificateSigningRequestInfo, type ComputeDerivedKeysOptions, type CreateSelfSignCertificateOptions, DER, type DerivedKeys, type DirectoryName, type ExtensionRequest, type Extensions, KeyObject, type Name, Nonce, PEM, PaddingAlgorithm, PrivateKey, type PrivateKeyInternals, PrivateKeyPEM, PublicKey, type PublicKeyLength, PublicKeyPEM, RSA_PKCS1_OAEP_PADDING, RSA_PKCS1_PADDING, type RevokedCertificate, Signature, Subject, type SubjectAltName, type SubjectOptions, type SubjectPublicKey, type SubjectPublicKeyInfo, type TBSCertList, type TbsCertificate, type Validity, type VerifyChunkSignatureOptions, type VerifyMessageChunkSignatureOptions, type Version, type X509ExtKeyUsage, type X509KeyUsage, type _VerifyStatus, _coercePrivateKey, asn1, certificateMatchesPrivateKey, coerceCertificate, coerceCertificatePem, coercePEMorDerToPrivateKey, coercePrivateKeyPem, coercePublicKeyPem, coerceRsaPublicKeyPem, combine_der, computeDerivedKeys, computePaddingFooter, convertPEMtoDER, createCertificateSigningRequest, createSelfSignedCertificate, decryptBufferWithDerivedKeys, derToPrivateKey, encryptBufferWithDerivedKeys, exploreAsn1, exploreCertificate, exploreCertificateInfo, exploreCertificateRevocationList, exploreCertificateSigningRequest, explorePrivateKey, extractPublicKeyFromCertificate, extractPublicKeyFromCertificateSync, generateKeyPair, generatePrivateKey, hexDump, identifyPemType, makeMessageChunkSignature, makeMessageChunkSignatureWithDerivedKeys, makePrivateKeyFromPem, makePrivateKeyThumbPrint, makePseudoRandomBuffer, makeSHA1Thumbprint, pemToPrivateKey, privateDecrypt, privateDecrypt_long, privateDecrypt_native, privateKeyToPEM, publicEncrypt, publicEncrypt_long, publicEncrypt_native, publicKeyAndPrivateKeyMatches, readCertificationRequestInfo, readExtension, readNameForCrl, readTbsCertificate, reduceLength, removePadding, removeTrailingLF, rsaLengthPrivateKey, rsaLengthPublicKey, rsaLengthRsaPublicKey, split_der, toPem, toPem2, verifyCertificateChain, verifyCertificateOrClrSignature, verifyCertificateRevocationListSignature, verifyCertificateSignature, verifyChunkSignature, verifyChunkSignatureWithDerivedKeys, verifyMessageChunkSignature };