node-opcua-crypto 4.6.2 → 4.7.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.
package/LICENSE CHANGED
@@ -1,7 +1,7 @@
1
1
  The MIT License (MIT)
2
2
 
3
3
  Copyright (c) Etienne Rossignon 2015-2022
4
- Copyright (c) Sterfive.com 2022-2023
4
+ Copyright (c) Sterfive.com 2022-2024
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -95,7 +95,7 @@ For more detailed instructions, refer to the CONTRIBUTING.md file.
95
95
 
96
96
  NodeOPCUA Crypto is MIT licensed. See the LICENSE file for full license details.
97
97
 
98
- Copyright © 2023 Sterfive.com.
98
+ Copyright © 2023-2024 Sterfive.com.
99
99
 
100
100
  ## Disclaimer
101
101
 
@@ -6,7 +6,7 @@ import {
6
6
  privateKeyToPEM,
7
7
  removeTrailingLF,
8
8
  toPem
9
- } from "./chunk-KDZI3R4E.mjs";
9
+ } from "./chunk-PET55CDS.mjs";
10
10
 
11
11
  // source_nodejs/read.ts
12
12
  import assert from "assert";
@@ -170,4 +170,4 @@ export {
170
170
  generatePrivateKeyFile,
171
171
  generatePrivateKeyFileAlternate
172
172
  };
173
- //# sourceMappingURL=chunk-QFXQNKGH.mjs.map
173
+ //# sourceMappingURL=chunk-2LYR7MB3.mjs.map
@@ -6253,4 +6253,4 @@ asn1js/build/index.es.js:
6253
6253
  *
6254
6254
  *)
6255
6255
  */
6256
- //# sourceMappingURL=chunk-KDZI3R4E.mjs.map
6256
+ //# sourceMappingURL=chunk-PET55CDS.mjs.map
@@ -0,0 +1,44 @@
1
+ import __crypto from 'crypto';
2
+
3
+ declare const createPrivateKeyFromNodeJSCrypto: typeof __crypto.createPrivateKey;
4
+ type KeyFormat = "pem" | "der" | "jwk";
5
+ type KeyObjectType = "secret" | "public" | "private";
6
+ interface KeyExportOptions<T extends KeyFormat> {
7
+ type: "pkcs1" | "spki" | "pkcs8" | "sec1";
8
+ format: T;
9
+ cipher?: string | undefined;
10
+ passphrase?: string | Buffer | undefined;
11
+ }
12
+ interface JwkKeyExportOptions {
13
+ format: "jwk";
14
+ }
15
+ interface KeyObject {
16
+ export(options: KeyExportOptions<"pem">): string | Buffer;
17
+ export(options: KeyExportOptions<"der">): Buffer;
18
+ export(options: JwkKeyExportOptions): JsonWebKey;
19
+ type: KeyObjectType;
20
+ }
21
+ declare function isKeyObject(mayBeKeyObject: any): boolean;
22
+ type PrivateKey = {
23
+ hidden: string;
24
+ } | {
25
+ hidden: KeyObject;
26
+ };
27
+ type PublicKey = KeyObject;
28
+ type Nonce = Buffer;
29
+ type PEM = string;
30
+ type DER = Buffer;
31
+ type Certificate = DER;
32
+ type CertificatePEM = PEM;
33
+ type PrivateKeyPEM = PEM;
34
+ type PublicKeyPEM = PEM;
35
+ type Signature = Buffer;
36
+ type CertificateRevocationList = Buffer;
37
+ declare enum CertificatePurpose {
38
+ NotSpecified = 0,
39
+ ForCertificateAuthority = 1,
40
+ ForApplication = 2,
41
+ ForUserAuthentication = 3
42
+ }
43
+
44
+ export { type Certificate as C, type DER as D, type KeyObject as K, type Nonce as N, type PrivateKey as P, type Signature as S, type PublicKey as a, type PEM as b, createPrivateKeyFromNodeJSCrypto as c, type CertificatePEM as d, type PrivateKeyPEM as e, type PublicKeyPEM as f, type CertificateRevocationList as g, CertificatePurpose as h, isKeyObject as i };
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { C as Certificate, d as CertificatePEM, h as CertificatePurpose, g as CertificateRevocationList, D as DER, K as KeyObject, N as Nonce, b as PEM, P as PrivateKey, e as PrivateKeyPEM, a as PublicKey, f as PublicKeyPEM, S as Signature, c as createPrivateKeyFromNodeJSCrypto, i as isKeyObject } from './common-0xc4gZF8.js';
1
+ export { C as Certificate, d as CertificatePEM, h as CertificatePurpose, g as CertificateRevocationList, D as DER, K as KeyObject, N as Nonce, b as PEM, P as PrivateKey, e as PrivateKeyPEM, a as PublicKey, f as PublicKeyPEM, S as Signature, c as createPrivateKeyFromNodeJSCrypto, i as isKeyObject } from './common-0xc4gZF8.mjs';
2
2
  export { AlgorithmIdentifier, AttributeTypeAndValue, AuthorityKeyIdentifier, BasicConstraints, BitString, BlockInfo, CertificateExtension, CertificateInfo, CertificateInternals, CertificateRevocationListInfo, CertificateSerialNumber, CertificateSigningRequestInfo, ComputeDerivedKeysOptions, CreateSelfSignCertificateOptions, DerivedKeys, DirectoryName, ExtensionRequest, Extensions, Name, PaddingAlgorithm, PrivateKeyInternals, PublicKeyLength, RSA_PKCS1_OAEP_PADDING, RSA_PKCS1_PADDING, RevokedCertificate, SignatureValue, Subject, SubjectOptions, SubjectPublicKey, SubjectPublicKeyInfo, TBSCertList, TagType, TbsCertificate, Validity, VerifyChunkSignatureOptions, VerifyMessageChunkSignatureOptions, Version, X509ExtKeyUsage, X509KeyUsage, _VerifyStatus, _coercePrivateKey, _findBlockAtIndex, _getBlock, _readAlgorithmIdentifier, _readBitString, _readBooleanValue, _readDirectoryName, _readECCAlgorithmIdentifier, _readExtension, _readIntegerAsByteString, _readIntegerValue, _readListOfInteger, _readLongIntegerValue, _readObjectIdentifier, _readOctetString, _readSignatureValue, _readSignatureValueBin, _readStruct, _readTime, _readValue, _readVersionValue, certificateMatchesPrivateKey, coerceCertificate, coerceCertificatePem, coercePEMorDerToPrivateKey, coercePrivateKeyPem, coercePublicKeyPem, coerceRsaPublicKeyPem, combine_der, compactDirectoryName, computeDerivedKeys, computePaddingFooter, convertPEMtoDER, createCertificateSigningRequest, createSelfSignedCertificate, decryptBufferWithDerivedKeys, derToPrivateKey, encryptBufferWithDerivedKeys, exploreCertificate, exploreCertificateInfo, exploreCertificateRevocationList, exploreCertificateSigningRequest, explorePrivateKey, extractPublicKeyFromCertificate, extractPublicKeyFromCertificateSync, formatBuffer2DigitHexWithColum, generateKeyPair, generatePrivateKey, hexDump, identifyPemType, makeMessageChunkSignature, makeMessageChunkSignatureWithDerivedKeys, makePrivateKeyFromPem, makePseudoRandomBuffer, makeSHA1Thumbprint, parseBitString, pemToPrivateKey, privateDecrypt, privateDecrypt_long, privateDecrypt_native, privateKeyToPEM, publicEncrypt, publicEncrypt_long, publicEncrypt_native, publicKeyAndPrivateKeyMatches, readCertificationRequestInfo, readNameForCrl, readTag, readTbsCertificate, reduceLength, removePadding, removeTrailingLF, rsaLengthPrivateKey, rsaLengthPublicKey, rsaLengthRsaPublicKey, split_der, toPem, toPem2, verifyCertificateChain, verifyCertificateOrClrSignature, verifyCertificateRevocationListSignature, verifyCertificateSignature, verifyChunkSignature, verifyChunkSignatureWithDerivedKeys, verifyMessageChunkSignature } from './source/index.mjs';
3
3
  export { CertificateSigningRequest, generatePrivateKeyFile, generatePrivateKeyFileAlternate, getCertificateStore, makePrivateKeyThumbPrint, readCertificate, readCertificatePEM, readCertificateRevocationList, readCertificateSigningRequest, readPrivateKey, readPrivateKeyPEM, readPrivateRsaKey, readPublicKey, readPublicKeyPEM, readPublicRsaKey, setCertificateStore } from './source_nodejs/index.mjs';
4
4
  import 'crypto';
package/dist/index.mjs CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  readPublicKeyPEM,
15
15
  readPublicRsaKey,
16
16
  setCertificateStore
17
- } from "./chunk-QFXQNKGH.mjs";
17
+ } from "./chunk-2LYR7MB3.mjs";
18
18
  import "./chunk-5NV4OKIV.mjs";
19
19
  import {
20
20
  CertificatePurpose,
@@ -110,7 +110,7 @@ import {
110
110
  verifyChunkSignature,
111
111
  verifyChunkSignatureWithDerivedKeys,
112
112
  verifyMessageChunkSignature
113
- } from "./chunk-KDZI3R4E.mjs";
113
+ } from "./chunk-PET55CDS.mjs";
114
114
  export {
115
115
  CertificatePurpose,
116
116
  PaddingAlgorithm,
@@ -1,4 +1,4 @@
1
- export { C as Certificate, d as CertificatePEM, h as CertificatePurpose, g as CertificateRevocationList, D as DER, K as KeyObject, N as Nonce, b as PEM, P as PrivateKey, e as PrivateKeyPEM, a as PublicKey, f as PublicKeyPEM, S as Signature, c as createPrivateKeyFromNodeJSCrypto, i as isKeyObject } from './common-0xc4gZF8.js';
1
+ export { C as Certificate, d as CertificatePEM, h as CertificatePurpose, g as CertificateRevocationList, D as DER, K as KeyObject, N as Nonce, b as PEM, P as PrivateKey, e as PrivateKeyPEM, a as PublicKey, f as PublicKeyPEM, S as Signature, c as createPrivateKeyFromNodeJSCrypto, i as isKeyObject } from './common-0xc4gZF8.mjs';
2
2
  export { AlgorithmIdentifier, AttributeTypeAndValue, AuthorityKeyIdentifier, BasicConstraints, BitString, BlockInfo, CertificateExtension, CertificateInfo, CertificateInternals, CertificateRevocationListInfo, CertificateSerialNumber, CertificateSigningRequestInfo, ComputeDerivedKeysOptions, CreateSelfSignCertificateOptions, DerivedKeys, DirectoryName, ExtensionRequest, Extensions, Name, PaddingAlgorithm, PrivateKeyInternals, PublicKeyLength, RSA_PKCS1_OAEP_PADDING, RSA_PKCS1_PADDING, RevokedCertificate, SignatureValue, Subject, SubjectOptions, SubjectPublicKey, SubjectPublicKeyInfo, TBSCertList, TagType, TbsCertificate, Validity, VerifyChunkSignatureOptions, VerifyMessageChunkSignatureOptions, Version, X509ExtKeyUsage, X509KeyUsage, _VerifyStatus, _coercePrivateKey, _findBlockAtIndex, _getBlock, _readAlgorithmIdentifier, _readBitString, _readBooleanValue, _readDirectoryName, _readECCAlgorithmIdentifier, _readExtension, _readIntegerAsByteString, _readIntegerValue, _readListOfInteger, _readLongIntegerValue, _readObjectIdentifier, _readOctetString, _readSignatureValue, _readSignatureValueBin, _readStruct, _readTime, _readValue, _readVersionValue, certificateMatchesPrivateKey, coerceCertificate, coerceCertificatePem, coercePEMorDerToPrivateKey, coercePrivateKeyPem, coercePublicKeyPem, coerceRsaPublicKeyPem, combine_der, compactDirectoryName, computeDerivedKeys, computePaddingFooter, convertPEMtoDER, createCertificateSigningRequest, createSelfSignedCertificate, decryptBufferWithDerivedKeys, derToPrivateKey, encryptBufferWithDerivedKeys, exploreCertificate, exploreCertificateInfo, exploreCertificateRevocationList, exploreCertificateSigningRequest, explorePrivateKey, extractPublicKeyFromCertificate, extractPublicKeyFromCertificateSync, formatBuffer2DigitHexWithColum, generateKeyPair, generatePrivateKey, hexDump, identifyPemType, makeMessageChunkSignature, makeMessageChunkSignatureWithDerivedKeys, makePrivateKeyFromPem, makePseudoRandomBuffer, makeSHA1Thumbprint, parseBitString, pemToPrivateKey, privateDecrypt, privateDecrypt_long, privateDecrypt_native, privateKeyToPEM, publicEncrypt, publicEncrypt_long, publicEncrypt_native, publicKeyAndPrivateKeyMatches, readCertificationRequestInfo, readNameForCrl, readTag, readTbsCertificate, reduceLength, removePadding, removeTrailingLF, rsaLengthPrivateKey, rsaLengthPublicKey, rsaLengthRsaPublicKey, split_der, toPem, toPem2, verifyCertificateChain, verifyCertificateOrClrSignature, verifyCertificateRevocationListSignature, verifyCertificateSignature, verifyChunkSignature, verifyChunkSignatureWithDerivedKeys, verifyMessageChunkSignature } from './source/index.mjs';
3
3
  import 'crypto';
4
4
  import '@peculiar/x509';
@@ -93,7 +93,7 @@ import {
93
93
  verifyChunkSignature,
94
94
  verifyChunkSignatureWithDerivedKeys,
95
95
  verifyMessageChunkSignature
96
- } from "./chunk-KDZI3R4E.mjs";
96
+ } from "./chunk-PET55CDS.mjs";
97
97
  export {
98
98
  CertificatePurpose,
99
99
  PaddingAlgorithm,
@@ -1,5 +1,5 @@
1
- import { b as PEM, D as DER, f as PublicKeyPEM, S as Signature, P as PrivateKey, C as Certificate, d as CertificatePEM, N as Nonce, K as KeyObject, e as PrivateKeyPEM, a as PublicKey, g as CertificateRevocationList, h as CertificatePurpose } from '../common-0xc4gZF8.js';
2
- export { c as createPrivateKeyFromNodeJSCrypto, i as isKeyObject } from '../common-0xc4gZF8.js';
1
+ import { b as PEM, D as DER, f as PublicKeyPEM, S as Signature, P as PrivateKey, C as Certificate, d as CertificatePEM, N as Nonce, K as KeyObject, e as PrivateKeyPEM, a as PublicKey, g as CertificateRevocationList, h as CertificatePurpose } from '../common-0xc4gZF8.mjs';
2
+ export { c as createPrivateKeyFromNodeJSCrypto, i as isKeyObject } from '../common-0xc4gZF8.mjs';
3
3
  import { KeyLike } from 'crypto';
4
4
  import * as x509 from '@peculiar/x509';
5
5
 
@@ -93,7 +93,7 @@ import {
93
93
  verifyChunkSignature,
94
94
  verifyChunkSignatureWithDerivedKeys,
95
95
  verifyMessageChunkSignature
96
- } from "../chunk-KDZI3R4E.mjs";
96
+ } from "../chunk-PET55CDS.mjs";
97
97
  export {
98
98
  CertificatePurpose,
99
99
  PaddingAlgorithm,
@@ -1,4 +1,4 @@
1
- export { C as Certificate, d as CertificatePEM, h as CertificatePurpose, g as CertificateRevocationList, D as DER, K as KeyObject, N as Nonce, b as PEM, P as PrivateKey, e as PrivateKeyPEM, a as PublicKey, f as PublicKeyPEM, S as Signature, c as createPrivateKeyFromNodeJSCrypto, i as isKeyObject } from '../common-0xc4gZF8.js';
1
+ export { C as Certificate, d as CertificatePEM, h as CertificatePurpose, g as CertificateRevocationList, D as DER, K as KeyObject, N as Nonce, b as PEM, P as PrivateKey, e as PrivateKeyPEM, a as PublicKey, f as PublicKeyPEM, S as Signature, c as createPrivateKeyFromNodeJSCrypto, i as isKeyObject } from '../common-0xc4gZF8.mjs';
2
2
  export { AlgorithmIdentifier, AttributeTypeAndValue, AuthorityKeyIdentifier, BasicConstraints, BitString, BlockInfo, CertificateExtension, CertificateInfo, CertificateInternals, CertificateRevocationListInfo, CertificateSerialNumber, CertificateSigningRequestInfo, ComputeDerivedKeysOptions, CreateSelfSignCertificateOptions, DerivedKeys, DirectoryName, ExtensionRequest, Extensions, Name, PaddingAlgorithm, PrivateKeyInternals, PublicKeyLength, RSA_PKCS1_OAEP_PADDING, RSA_PKCS1_PADDING, RevokedCertificate, SignatureValue, Subject, SubjectOptions, SubjectPublicKey, SubjectPublicKeyInfo, TBSCertList, TagType, TbsCertificate, Validity, VerifyChunkSignatureOptions, VerifyMessageChunkSignatureOptions, Version, X509ExtKeyUsage, X509KeyUsage, _VerifyStatus, _coercePrivateKey, _findBlockAtIndex, _getBlock, _readAlgorithmIdentifier, _readBitString, _readBooleanValue, _readDirectoryName, _readECCAlgorithmIdentifier, _readExtension, _readIntegerAsByteString, _readIntegerValue, _readListOfInteger, _readLongIntegerValue, _readObjectIdentifier, _readOctetString, _readSignatureValue, _readSignatureValueBin, _readStruct, _readTime, _readValue, _readVersionValue, certificateMatchesPrivateKey, coerceCertificate, coerceCertificatePem, coercePEMorDerToPrivateKey, coercePrivateKeyPem, coercePublicKeyPem, coerceRsaPublicKeyPem, combine_der, compactDirectoryName, computeDerivedKeys, computePaddingFooter, convertPEMtoDER, createCertificateSigningRequest, createSelfSignedCertificate, decryptBufferWithDerivedKeys, derToPrivateKey, encryptBufferWithDerivedKeys, exploreCertificate, exploreCertificateInfo, exploreCertificateRevocationList, exploreCertificateSigningRequest, explorePrivateKey, extractPublicKeyFromCertificate, extractPublicKeyFromCertificateSync, formatBuffer2DigitHexWithColum, generateKeyPair, generatePrivateKey, hexDump, identifyPemType, makeMessageChunkSignature, makeMessageChunkSignatureWithDerivedKeys, makePrivateKeyFromPem, makePseudoRandomBuffer, makeSHA1Thumbprint, parseBitString, pemToPrivateKey, privateDecrypt, privateDecrypt_long, privateDecrypt_native, privateKeyToPEM, publicEncrypt, publicEncrypt_long, publicEncrypt_native, publicKeyAndPrivateKeyMatches, readCertificationRequestInfo, readNameForCrl, readTag, readTbsCertificate, reduceLength, removePadding, removeTrailingLF, rsaLengthPrivateKey, rsaLengthPublicKey, rsaLengthRsaPublicKey, split_der, toPem, toPem2, verifyCertificateChain, verifyCertificateOrClrSignature, verifyCertificateRevocationListSignature, verifyCertificateSignature, verifyChunkSignature, verifyChunkSignatureWithDerivedKeys, verifyMessageChunkSignature } from './index.mjs';
3
3
  import 'crypto';
4
4
  import '@peculiar/x509';
@@ -92,7 +92,7 @@ import {
92
92
  verifyChunkSignature,
93
93
  verifyChunkSignatureWithDerivedKeys,
94
94
  verifyMessageChunkSignature
95
- } from "../chunk-KDZI3R4E.mjs";
95
+ } from "../chunk-PET55CDS.mjs";
96
96
  export {
97
97
  CertificatePurpose,
98
98
  PaddingAlgorithm,
@@ -1,4 +1,4 @@
1
- import { C as Certificate, a as PublicKey, P as PrivateKey, d as CertificatePEM, f as PublicKeyPEM, e as PrivateKeyPEM, g as CertificateRevocationList } from '../common-0xc4gZF8.js';
1
+ import { C as Certificate, a as PublicKey, P as PrivateKey, d as CertificatePEM, f as PublicKeyPEM, e as PrivateKeyPEM, g as CertificateRevocationList } from '../common-0xc4gZF8.mjs';
2
2
  import 'crypto';
3
3
 
4
4
  /**
@@ -14,9 +14,9 @@ import {
14
14
  readPublicKeyPEM,
15
15
  readPublicRsaKey,
16
16
  setCertificateStore
17
- } from "../chunk-QFXQNKGH.mjs";
17
+ } from "../chunk-2LYR7MB3.mjs";
18
18
  import "../chunk-5NV4OKIV.mjs";
19
- import "../chunk-KDZI3R4E.mjs";
19
+ import "../chunk-PET55CDS.mjs";
20
20
  export {
21
21
  generatePrivateKeyFile,
22
22
  generatePrivateKeyFileAlternate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-opcua-crypto",
3
- "version": "4.6.2",
3
+ "version": "4.7.0",
4
4
  "description": "Crypto tools for Node-OPCUA",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -46,18 +46,18 @@
46
46
  "node": ">15.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@types/node": "^20.9.1",
49
+ "@types/node": "^20.11.5",
50
50
  "lorem-ipsum": "^2.0.8"
51
51
  },
52
52
  "dependencies": {
53
- "@peculiar/webcrypto": "^1.4.3",
54
- "@peculiar/x509": "^1.9.5",
53
+ "@peculiar/webcrypto": "^1.4.4",
54
+ "@peculiar/x509": "^1.9.6",
55
55
  "@types/jsrsasign": "^10.5.12",
56
56
  "@types/sshpk": "^1.17.4",
57
57
  "assert": "^2.1.0",
58
58
  "chalk": "^4.1.2",
59
59
  "hexy": "0.3.5",
60
- "jsrsasign": "^10.8.6",
60
+ "jsrsasign": "^11.0.0",
61
61
  "sshpk": "^1.18.0"
62
62
  },
63
63
  "repository": {
@@ -67,5 +67,5 @@
67
67
  "bugs": {
68
68
  "url": "https://github.com/node-opcua/node-opcua-crypto/issues"
69
69
  },
70
- "gitHead": "60bdb60eb82e4c0ac411ec7add89b05bc1a41354"
70
+ "gitHead": "24f9357d755a84a70fee9e516ff682f4bbb66c3c"
71
71
  }