node-opcua-crypto 2.0.1 → 2.1.1
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/.github/workflows/main.yml +96 -22
- package/dist/source/common.d.ts +4 -2
- package/dist/source/crypto_utils.d.ts +11 -15
- package/dist/source/crypto_utils.js +44 -27
- package/dist/source/crypto_utils.js.map +1 -1
- package/dist/source/explore_private_key.d.ts +1 -1
- package/dist/source/explore_private_key.js +4 -3
- package/dist/source/explore_private_key.js.map +1 -1
- package/dist/source/public_private_match.js +1 -2
- package/dist/source/public_private_match.js.map +1 -1
- package/dist/source_nodejs/read.d.ts +2 -8
- package/dist/source_nodejs/read.js +37 -25
- package/dist/source_nodejs/read.js.map +1 -1
- package/package.json +1 -1
- package/source/common.ts +15 -13
- package/source/crypto_utils.ts +376 -359
- package/source/explore_private_key.ts +119 -121
- package/source/public_private_match.ts +37 -41
- package/source_nodejs/read.ts +105 -95
|
@@ -4,29 +4,103 @@ name: CI
|
|
|
4
4
|
|
|
5
5
|
# Controls when the workflow will run
|
|
6
6
|
on:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
# Triggers the workflow on push or pull request events but only for the master branch
|
|
8
|
+
push:
|
|
9
|
+
branches: [master]
|
|
10
|
+
pull_request:
|
|
11
|
+
branches: [master]
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
# Allows you to run this workflow manually from the Actions tab
|
|
14
|
+
workflow_dispatch:
|
|
15
15
|
|
|
16
16
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
17
17
|
jobs:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
# This workflow contains a single job called "build"
|
|
19
|
+
build-new:
|
|
20
|
+
# The type of runner that the job will run on
|
|
21
|
+
strategy:
|
|
22
|
+
matrix:
|
|
23
|
+
node-version: [19.x]
|
|
24
|
+
os: [ubuntu-20.04, ubuntu-latest, macos-latest, windows-latest]
|
|
25
|
+
runs-on: ${{ matrix.os }}
|
|
26
|
+
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
27
|
+
steps:
|
|
28
|
+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
29
|
+
- name: checkout
|
|
30
|
+
uses: actions/checkout@v3
|
|
31
|
+
|
|
32
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
33
|
+
uses: actions/setup-node@v3
|
|
34
|
+
with:
|
|
35
|
+
node-version: ${{ matrix.node-version }}
|
|
36
|
+
|
|
37
|
+
- name: openssl
|
|
38
|
+
run: openssl version
|
|
39
|
+
- name: nodejs
|
|
40
|
+
run: node --version
|
|
41
|
+
|
|
42
|
+
# Runs a set of commands using the runners shell
|
|
43
|
+
- name: build
|
|
44
|
+
run: |
|
|
45
|
+
npm install typescript mocha ts-node @types/node@18 npm -g
|
|
46
|
+
npm install
|
|
47
|
+
npm run test
|
|
48
|
+
build:
|
|
49
|
+
# The type of runner that the job will run on
|
|
50
|
+
strategy:
|
|
51
|
+
matrix:
|
|
52
|
+
node-version: [ 16.x, 18.x]
|
|
53
|
+
os: [ubuntu-20.04, ubuntu-latest, macos-latest, windows-latest]
|
|
54
|
+
runs-on: ${{ matrix.os }}
|
|
55
|
+
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
56
|
+
steps:
|
|
57
|
+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
58
|
+
- name: checkout
|
|
59
|
+
uses: actions/checkout@v3
|
|
60
|
+
|
|
61
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
62
|
+
uses: actions/setup-node@v3
|
|
63
|
+
with:
|
|
64
|
+
node-version: ${{ matrix.node-version }}
|
|
65
|
+
|
|
66
|
+
- name: openssl
|
|
67
|
+
run: openssl version
|
|
68
|
+
- name: nodejs
|
|
69
|
+
run: node --version
|
|
70
|
+
|
|
71
|
+
# Runs a set of commands using the runners shell
|
|
72
|
+
- name: build
|
|
73
|
+
run: |
|
|
74
|
+
npm install npm@9 -g
|
|
75
|
+
npm install typescript mocha ts-node @types/node@${{ matrix.node-version }} -g
|
|
76
|
+
npm install
|
|
77
|
+
npm run test
|
|
78
|
+
build-legacy:
|
|
79
|
+
# The type of runner that the job will run on
|
|
80
|
+
strategy:
|
|
81
|
+
matrix:
|
|
82
|
+
node-version: [12.x, 14.x]
|
|
83
|
+
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-latest, macos-latest, windows-latest]
|
|
84
|
+
runs-on: ${{ matrix.os }}
|
|
85
|
+
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
86
|
+
steps:
|
|
87
|
+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
|
88
|
+
- name: checkout
|
|
89
|
+
uses: actions/checkout@v3
|
|
90
|
+
|
|
91
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
92
|
+
uses: actions/setup-node@v3
|
|
93
|
+
with:
|
|
94
|
+
node-version: ${{ matrix.node-version }}
|
|
95
|
+
|
|
96
|
+
- name: openssl
|
|
97
|
+
run: openssl version
|
|
98
|
+
- name: nodejs
|
|
99
|
+
run: node --version
|
|
100
|
+
|
|
101
|
+
# Runs a set of commands using the runners shell
|
|
102
|
+
- name: build
|
|
103
|
+
run: |
|
|
104
|
+
npm install typescript mocha ts-node @types/node@${{ matrix.node-version }} npm@8 -g
|
|
105
|
+
npm install
|
|
106
|
+
npm run test
|
package/dist/source/common.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { KeyObject } from "node:crypto";
|
|
4
|
+
export type PrivateKey = KeyObject;
|
|
5
|
+
export type PublicKey = KeyObject;
|
|
2
6
|
export type Nonce = Buffer;
|
|
3
7
|
export type PEM = string;
|
|
4
8
|
export type DER = Buffer;
|
|
5
9
|
export type Certificate = DER;
|
|
6
10
|
export type CertificatePEM = PEM;
|
|
7
|
-
export type PrivateKey = DER;
|
|
8
11
|
export type PrivateKeyPEM = PEM;
|
|
9
|
-
export type PublicKey = DER;
|
|
10
12
|
export type PublicKeyPEM = PEM;
|
|
11
13
|
export type Signature = Buffer;
|
|
12
14
|
export type CertificateRevocationList = Buffer;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import * as crypto from "crypto";
|
|
2
4
|
import { Certificate, CertificatePEM, DER, PEM, PrivateKey, PrivateKeyPEM, PublicKey, PublicKeyPEM, Signature } from "./common";
|
|
3
5
|
export declare function identifyPemType(rawKey: Buffer | string): undefined | string;
|
|
4
6
|
export declare function convertPEMtoDER(raw_key: PEM): DER;
|
|
@@ -8,22 +10,13 @@ export declare function convertPEMtoDER(raw_key: PEM): DER;
|
|
|
8
10
|
* @param pem
|
|
9
11
|
* @return
|
|
10
12
|
*/
|
|
11
|
-
export declare function toPem(raw_key: Buffer | string, pem: string): string;
|
|
13
|
+
export declare function toPem(raw_key: Buffer | string | crypto.KeyObject, pem: string): string;
|
|
12
14
|
export declare function hexDump(buffer: Buffer, width?: number): string;
|
|
13
15
|
interface MakeMessageChunkSignatureOptions {
|
|
14
16
|
signatureLength: number;
|
|
15
17
|
algorithm: string;
|
|
16
|
-
privateKey:
|
|
18
|
+
privateKey: PrivateKey;
|
|
17
19
|
}
|
|
18
|
-
/**
|
|
19
|
-
* @method makeMessageChunkSignature
|
|
20
|
-
* @param chunk
|
|
21
|
-
* @param options
|
|
22
|
-
* @param options.signatureLength
|
|
23
|
-
* @param options.algorithm for example "RSA-SHA256"
|
|
24
|
-
* @param options.privateKey
|
|
25
|
-
* @return - the signature
|
|
26
|
-
*/
|
|
27
20
|
export declare function makeMessageChunkSignature(chunk: Buffer, options: MakeMessageChunkSignatureOptions): Buffer;
|
|
28
21
|
export interface VerifyMessageChunkSignatureOptions {
|
|
29
22
|
signatureLength?: number;
|
|
@@ -54,14 +47,16 @@ export declare enum PaddingAlgorithm {
|
|
|
54
47
|
RSA_PKCS1_OAEP_PADDING = 4,
|
|
55
48
|
RSA_PKCS1_PADDING = 1
|
|
56
49
|
}
|
|
57
|
-
export declare function publicEncrypt_native(buffer: Buffer, publicKey:
|
|
58
|
-
export declare function privateDecrypt_native(buffer: Buffer, privateKey:
|
|
50
|
+
export declare function publicEncrypt_native(buffer: Buffer, publicKey: crypto.KeyLike, algorithm?: PaddingAlgorithm): Buffer;
|
|
51
|
+
export declare function privateDecrypt_native(buffer: Buffer, privateKey: crypto.KeyLike, algorithm?: PaddingAlgorithm): Buffer;
|
|
59
52
|
export declare const publicEncrypt: typeof publicEncrypt_native;
|
|
60
53
|
export declare const privateDecrypt: typeof privateDecrypt_native;
|
|
61
|
-
export declare function publicEncrypt_long(buffer: Buffer, publicKey:
|
|
62
|
-
export declare function privateDecrypt_long(buffer: Buffer, privateKey:
|
|
54
|
+
export declare function publicEncrypt_long(buffer: Buffer, publicKey: crypto.KeyLike, blockSize: number, padding: number, paddingAlgorithm?: PaddingAlgorithm): Buffer;
|
|
55
|
+
export declare function privateDecrypt_long(buffer: Buffer, privateKey: crypto.KeyLike, blockSize: number, paddingAlgorithm?: number): Buffer;
|
|
63
56
|
export declare function coerceCertificatePem(certificate: Certificate | CertificatePEM): CertificatePEM;
|
|
64
57
|
export declare function coercePublicKeyPem(publicKey: PublicKey | PublicKeyPEM): PublicKeyPEM;
|
|
58
|
+
export declare function coerceRsaPublicKeyPem(publicKey: PublicKey | PublicKeyPEM): PublicKeyPEM;
|
|
59
|
+
export declare function coercePrivateKey(privateKey: PrivateKey | PrivateKeyPEM): PrivateKey;
|
|
65
60
|
export declare function coercePrivateKeyPem(privateKey: PrivateKey | PrivateKeyPEM): PrivateKeyPEM;
|
|
66
61
|
/***
|
|
67
62
|
* @method rsaLengthPrivateKey
|
|
@@ -71,6 +66,7 @@ export declare function coercePrivateKeyPem(privateKey: PrivateKey | PrivateKeyP
|
|
|
71
66
|
*/
|
|
72
67
|
export declare function rsaLengthPrivateKey(key: PrivateKeyPEM | PrivateKey): number;
|
|
73
68
|
export declare function rsaLengthPublicKey(key: PublicKeyPEM | PublicKey): number;
|
|
69
|
+
export declare function rsaLengthRsaPublicKey(key: PublicKeyPEM | PublicKey): number;
|
|
74
70
|
export declare function extractPublicKeyFromCertificateSync(certificate: Certificate | CertificatePEM): PublicKeyPEM;
|
|
75
71
|
/**
|
|
76
72
|
* extract the publickey from a certificate
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extractPublicKeyFromCertificate = exports.extractPublicKeyFromCertificateSync = exports.rsaLengthPublicKey = exports.rsaLengthPrivateKey = exports.coercePrivateKeyPem = exports.coercePublicKeyPem = exports.coerceCertificatePem = exports.privateDecrypt_long = exports.publicEncrypt_long = exports.privateDecrypt = exports.publicEncrypt = exports.privateDecrypt_native = exports.publicEncrypt_native = exports.PaddingAlgorithm = exports.RSA_PKCS1_PADDING = exports.RSA_PKCS1_OAEP_PADDING = exports.makeSHA1Thumbprint = exports.verifyMessageChunkSignature = exports.makeMessageChunkSignature = exports.hexDump = exports.toPem = exports.convertPEMtoDER = exports.identifyPemType = void 0;
|
|
3
|
+
exports.extractPublicKeyFromCertificate = exports.extractPublicKeyFromCertificateSync = exports.rsaLengthRsaPublicKey = exports.rsaLengthPublicKey = exports.rsaLengthPrivateKey = exports.coercePrivateKeyPem = exports.coercePrivateKey = exports.coerceRsaPublicKeyPem = exports.coercePublicKeyPem = exports.coerceCertificatePem = exports.privateDecrypt_long = exports.publicEncrypt_long = exports.privateDecrypt = exports.publicEncrypt = exports.privateDecrypt_native = exports.publicEncrypt_native = exports.PaddingAlgorithm = exports.RSA_PKCS1_PADDING = exports.RSA_PKCS1_OAEP_PADDING = exports.makeSHA1Thumbprint = exports.verifyMessageChunkSignature = exports.makeMessageChunkSignature = exports.hexDump = exports.toPem = exports.convertPEMtoDER = exports.identifyPemType = void 0;
|
|
4
4
|
// tslint:disabled:no-var-requires
|
|
5
5
|
/**
|
|
6
6
|
* @module node_opcua_crypto
|
|
@@ -55,6 +55,17 @@ exports.convertPEMtoDER = convertPEMtoDER;
|
|
|
55
55
|
function toPem(raw_key, pem) {
|
|
56
56
|
assert(raw_key, "expecting a key");
|
|
57
57
|
assert(typeof pem === "string");
|
|
58
|
+
if (raw_key instanceof crypto.KeyObject) {
|
|
59
|
+
if (pem === "RSA PRIVATE KEY") {
|
|
60
|
+
return raw_key.export({ format: "pem", type: "pkcs1" }).toString();
|
|
61
|
+
}
|
|
62
|
+
else if (pem === "PRIVATE KEY") {
|
|
63
|
+
return raw_key.export({ format: "pem", type: "pkcs8" }).toString();
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
throw new Error("Unsupported case!");
|
|
67
|
+
}
|
|
68
|
+
}
|
|
58
69
|
let pemType = identifyPemType(raw_key);
|
|
59
70
|
if (pemType) {
|
|
60
71
|
return raw_key instanceof Buffer ? raw_key.toString("utf8") : raw_key;
|
|
@@ -88,19 +99,7 @@ function hexDump(buffer, width) {
|
|
|
88
99
|
}
|
|
89
100
|
}
|
|
90
101
|
exports.hexDump = hexDump;
|
|
91
|
-
/**
|
|
92
|
-
* @method makeMessageChunkSignature
|
|
93
|
-
* @param chunk
|
|
94
|
-
* @param options
|
|
95
|
-
* @param options.signatureLength
|
|
96
|
-
* @param options.algorithm for example "RSA-SHA256"
|
|
97
|
-
* @param options.privateKey
|
|
98
|
-
* @return - the signature
|
|
99
|
-
*/
|
|
100
102
|
function makeMessageChunkSignature(chunk, options) {
|
|
101
|
-
assert(Object.prototype.hasOwnProperty.call(options, "algorithm"));
|
|
102
|
-
assert(chunk instanceof Buffer);
|
|
103
|
-
assert(["RSA PRIVATE KEY", "PRIVATE KEY"].indexOf(identifyPemType(options.privateKey)) >= 0);
|
|
104
103
|
// signature length = 128 bytes
|
|
105
104
|
const signer = crypto.createSign(options.algorithm);
|
|
106
105
|
signer.update(chunk);
|
|
@@ -202,6 +201,7 @@ function publicEncrypt_long(buffer, publicKey, blockSize, padding, paddingAlgori
|
|
|
202
201
|
for (let i = 0; i < nbBlocks; i++) {
|
|
203
202
|
const currentBlock = buffer.subarray(chunk_size * i, chunk_size * (i + 1));
|
|
204
203
|
const encrypted_chunk = (0, exports.publicEncrypt)(currentBlock, publicKey, paddingAlgorithm);
|
|
204
|
+
// istanbul ignore next
|
|
205
205
|
if (encrypted_chunk.length !== blockSize) {
|
|
206
206
|
throw new Error(`publicEncrypt_long unexpected chunk length ${encrypted_chunk.length} expecting ${blockSize}`);
|
|
207
207
|
}
|
|
@@ -212,6 +212,7 @@ function publicEncrypt_long(buffer, publicKey, blockSize, padding, paddingAlgori
|
|
|
212
212
|
exports.publicEncrypt_long = publicEncrypt_long;
|
|
213
213
|
function privateDecrypt_long(buffer, privateKey, blockSize, paddingAlgorithm) {
|
|
214
214
|
paddingAlgorithm = paddingAlgorithm || exports.RSA_PKCS1_PADDING;
|
|
215
|
+
// istanbul ignore next
|
|
215
216
|
if (paddingAlgorithm !== exports.RSA_PKCS1_PADDING && paddingAlgorithm !== exports.RSA_PKCS1_OAEP_PADDING) {
|
|
216
217
|
throw new Error("Invalid padding algorithm " + paddingAlgorithm);
|
|
217
218
|
}
|
|
@@ -236,13 +237,28 @@ function coerceCertificatePem(certificate) {
|
|
|
236
237
|
}
|
|
237
238
|
exports.coerceCertificatePem = coerceCertificatePem;
|
|
238
239
|
function coercePublicKeyPem(publicKey) {
|
|
239
|
-
if (publicKey instanceof
|
|
240
|
-
publicKey
|
|
240
|
+
if (publicKey instanceof crypto.KeyObject) {
|
|
241
|
+
return publicKey.export({ format: "pem", type: "pkcs1" }).toString();
|
|
241
242
|
}
|
|
242
243
|
assert(typeof publicKey === "string");
|
|
243
244
|
return publicKey;
|
|
244
245
|
}
|
|
245
246
|
exports.coercePublicKeyPem = coercePublicKeyPem;
|
|
247
|
+
function coerceRsaPublicKeyPem(publicKey) {
|
|
248
|
+
if (publicKey instanceof crypto.KeyObject) {
|
|
249
|
+
return publicKey.export({ format: "pem", type: "spki" }).toString();
|
|
250
|
+
}
|
|
251
|
+
assert(typeof publicKey === "string");
|
|
252
|
+
return publicKey;
|
|
253
|
+
}
|
|
254
|
+
exports.coerceRsaPublicKeyPem = coerceRsaPublicKeyPem;
|
|
255
|
+
function coercePrivateKey(privateKey) {
|
|
256
|
+
if (typeof privateKey === "string") {
|
|
257
|
+
return crypto.createPrivateKey(privateKey);
|
|
258
|
+
}
|
|
259
|
+
return privateKey;
|
|
260
|
+
}
|
|
261
|
+
exports.coercePrivateKey = coercePrivateKey;
|
|
246
262
|
function coercePrivateKeyPem(privateKey) {
|
|
247
263
|
if (privateKey instanceof Buffer) {
|
|
248
264
|
const o = crypto.createPrivateKey({ key: privateKey, format: "der", type: "pkcs1" });
|
|
@@ -260,18 +276,12 @@ exports.coercePrivateKeyPem = coercePrivateKeyPem;
|
|
|
260
276
|
* @return the key length in bytes.
|
|
261
277
|
*/
|
|
262
278
|
function rsaLengthPrivateKey(key) {
|
|
263
|
-
key =
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
// in node <16 :
|
|
270
|
-
const key2 = o.export({ type: "pkcs1", format: "pem" });
|
|
271
|
-
const a = jsrsasign.KEYUTIL.getKey(key2);
|
|
272
|
-
return a.n.toString(16).length / 2;
|
|
273
|
-
}
|
|
274
|
-
const a = jsrsasign.KEYUTIL.getKey(key);
|
|
279
|
+
key = coercePrivateKey(key);
|
|
280
|
+
// in node 16 and above :
|
|
281
|
+
// return o.asymmetricKeyDetails.modulusLength/8
|
|
282
|
+
// in node <16 :
|
|
283
|
+
const key2 = key.export({ type: "pkcs1", format: "pem" }).toString();
|
|
284
|
+
const a = jsrsasign.KEYUTIL.getKey(key2);
|
|
275
285
|
return a.n.toString(16).length / 2;
|
|
276
286
|
}
|
|
277
287
|
exports.rsaLengthPrivateKey = rsaLengthPrivateKey;
|
|
@@ -282,6 +292,13 @@ function rsaLengthPublicKey(key) {
|
|
|
282
292
|
return a.n.toString(16).length / 2;
|
|
283
293
|
}
|
|
284
294
|
exports.rsaLengthPublicKey = rsaLengthPublicKey;
|
|
295
|
+
function rsaLengthRsaPublicKey(key) {
|
|
296
|
+
key = coerceRsaPublicKeyPem(key);
|
|
297
|
+
assert(typeof key === "string");
|
|
298
|
+
const a = jsrsasign.KEYUTIL.getKey(key);
|
|
299
|
+
return a.n.toString(16).length / 2;
|
|
300
|
+
}
|
|
301
|
+
exports.rsaLengthRsaPublicKey = rsaLengthRsaPublicKey;
|
|
285
302
|
function extractPublicKeyFromCertificateSync(certificate) {
|
|
286
303
|
certificate = coerceCertificatePem(certificate);
|
|
287
304
|
const key = jsrsasign.KEYUTIL.getKey(certificate);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto_utils.js","sourceRoot":"","sources":["../../source/crypto_utils.ts"],"names":[],"mappings":";;;AAAA,kCAAkC;AAClC;;GAEG;AACH,uCAAuC;AACvC,iCAAiC;AACjC,iDAA+D;AAE/D,6EAA2D;AAC3D,iCAAiC;AACjC,+BAA4B;AAE5B,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAEvC,MAAM,SAAS,GAAG,gFAAgF,CAAC;AAEnG,MAAM,cAAc,GAAG,0BAA0B,CAAC;AAClD,0CAA0C;AAC1C,kBAAkB;AAElB;;;;GAIG;AACH,SAAgB,eAAe,CAAC,MAAuB;IACnD,IAAI,MAAM,YAAY,MAAM,EAAE;QAC1B,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;KACpC;IACD,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,MAA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QACV,IAAI,GAAG,GAAG,CAAC;KACd;IACD,YAAY,CAAC,GAAG,EAAE;QACd,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACP,CAAC;AAdD,0EAcC"}
|
|
@@ -26,4 +26,4 @@ export interface PrivateKeyInternals {
|
|
|
26
26
|
* otherPrimeInfos OtherPrimeInfos OPTIONAL
|
|
27
27
|
}
|
|
28
28
|
*/
|
|
29
|
-
export declare function explorePrivateKey(
|
|
29
|
+
export declare function explorePrivateKey(privateKey1: PrivateKey): PrivateKeyInternals;
|
|
@@ -22,7 +22,8 @@ const doDebug = !!process.env.DEBUG;
|
|
|
22
22
|
* otherPrimeInfos OtherPrimeInfos OPTIONAL
|
|
23
23
|
}
|
|
24
24
|
*/
|
|
25
|
-
function explorePrivateKey(
|
|
25
|
+
function explorePrivateKey(privateKey1) {
|
|
26
|
+
const privateKey = privateKey1.export({ format: "der", type: "pkcs1" });
|
|
26
27
|
assert(privateKey instanceof Buffer);
|
|
27
28
|
const block_info = (0, asn1_1.readTag)(privateKey, 0);
|
|
28
29
|
const blocks = (0, asn1_1._readStruct)(privateKey, block_info);
|
|
@@ -44,7 +45,7 @@ function explorePrivateKey(privateKey) {
|
|
|
44
45
|
prime1,
|
|
45
46
|
prime2,
|
|
46
47
|
exponent1,
|
|
47
|
-
exponent2
|
|
48
|
+
exponent2,
|
|
48
49
|
};
|
|
49
50
|
}
|
|
50
51
|
/* istanbul ignore next */
|
|
@@ -90,7 +91,7 @@ function explorePrivateKey(privateKey) {
|
|
|
90
91
|
prime1,
|
|
91
92
|
prime2,
|
|
92
93
|
exponent1,
|
|
93
|
-
exponent2
|
|
94
|
+
exponent2,
|
|
94
95
|
};
|
|
95
96
|
}
|
|
96
97
|
exports.explorePrivateKey = explorePrivateKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explore_private_key.js","sourceRoot":"","sources":["../../source/explore_private_key.ts"],"names":[],"mappings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CAAC,CAAC,CAAC;IACpC,MAAM,SAAS,GAAG,CAAC,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAEpC,OAAO;QACH,OAAO;QACP,OAAO;QACP,cAAc;QACd,eAAe;QACf,MAAM;QACN,MAAM;QACN,SAAS;QACT,SAAS;KACZ,CAAC;AACN,CAAC;AAlFD,8CAkFC"}
|
|
@@ -31,8 +31,7 @@ function certificateMatchesPrivateKey(certificate, privateKey) {
|
|
|
31
31
|
const e = (0, explore_private_key_1.explorePrivateKey)(privateKey);
|
|
32
32
|
const blockSize = e.modulus.length;
|
|
33
33
|
const certificatePEM = (0, crypto_utils_1.toPem)(certificate, "CERTIFICATE");
|
|
34
|
-
|
|
35
|
-
return certificateMatchesPrivateKeyPEM(certificatePEM, privateKeyPEM, blockSize);
|
|
34
|
+
return certificateMatchesPrivateKeyPEM(certificatePEM, privateKey, blockSize);
|
|
36
35
|
}
|
|
37
36
|
exports.certificateMatchesPrivateKey = certificateMatchesPrivateKey;
|
|
38
37
|
//# sourceMappingURL=public_private_match.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public_private_match.js","sourceRoot":"","sources":["../../source/public_private_match.ts"],"names":[],"mappings":";;;AAAA,+DAA0D;AAE1D,iDAAgF;AAChF,6EAAkE;AAElE,
|
|
1
|
+
{"version":3,"file":"public_private_match.js","sourceRoot":"","sources":["../../source/public_private_match.ts"],"names":[],"mappings":";;;AAAA,+DAA0D;AAE1D,iDAAgF;AAChF,6EAAkE;AAElE,SAAgB,6BAA6B,CAAC,WAAwB,EAAE,UAAsB;IAC1F,MAAM,CAAC,GAAG,IAAA,+CAAkB,EAAC,WAAW,CAAC,CAAC;IAC1C,MAAM,CAAC,GAAG,IAAA,uCAAiB,EAAC,UAAU,CAAC,CAAC;IAExC,MAAM,QAAQ,GAAG,CAAC,CAAC,cAAc,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,OAAO,CAAC;IAChF,MAAM,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ename
|
|
5
|
-
*/
|
|
6
|
-
export declare function readKeyPem(filename: string): string;
|
|
7
2
|
/**
|
|
8
3
|
* read a DER or PEM certificate from file
|
|
9
4
|
*/
|
|
@@ -20,10 +15,9 @@ export declare function readCertificatePEM(filename: string): CertificatePEM;
|
|
|
20
15
|
export declare function readPublicKeyPEM(filename: string): PublicKeyPEM;
|
|
21
16
|
export declare function readPrivateKeyPEM(filename: string): PrivateKeyPEM;
|
|
22
17
|
export declare function setCertificateStore(store: string): string;
|
|
23
|
-
export declare function read_sshkey_as_pem(filename: string): PublicKeyPEM;
|
|
24
18
|
/**
|
|
25
19
|
*
|
|
26
20
|
* @param filename
|
|
27
21
|
*/
|
|
28
|
-
export declare function readPrivateRsaKey(filename: string):
|
|
29
|
-
export declare function readPublicRsaKey(filename: string):
|
|
22
|
+
export declare function readPrivateRsaKey(filename: string): PrivateKey;
|
|
23
|
+
export declare function readPublicRsaKey(filename: string): PublicKey;
|
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.readPublicRsaKey = exports.readPrivateRsaKey = exports.
|
|
3
|
+
exports.readPublicRsaKey = exports.readPrivateRsaKey = exports.setCertificateStore = exports.readPrivateKeyPEM = exports.readPublicKeyPEM = exports.readCertificatePEM = exports.readPrivateKey = exports.readPublicKey = exports.readCertificate = void 0;
|
|
4
4
|
const assert = require("assert");
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const path = require("path");
|
|
7
|
+
const crypto_1 = require("crypto");
|
|
7
8
|
const crypto_utils_1 = require("../source/crypto_utils");
|
|
8
9
|
const sshpk = require("sshpk");
|
|
9
|
-
/**
|
|
10
|
-
* @method readKeyPem
|
|
11
|
-
* @param filename
|
|
12
|
-
*/
|
|
13
|
-
function readKeyPem(filename) {
|
|
14
|
-
const raw_key = fs.readFileSync(filename, "utf8");
|
|
15
|
-
const pemType = (0, crypto_utils_1.identifyPemType)(raw_key);
|
|
16
|
-
assert(typeof pemType === "string"); // must have a valid pem type
|
|
17
|
-
return raw_key;
|
|
18
|
-
}
|
|
19
|
-
exports.readKeyPem = readKeyPem;
|
|
20
10
|
function _readPemFile(filename) {
|
|
21
11
|
assert(typeof filename === "string");
|
|
22
12
|
return fs.readFileSync(filename, "ascii");
|
|
@@ -39,14 +29,36 @@ exports.readCertificate = readCertificate;
|
|
|
39
29
|
* read a DER or PEM certificate from file
|
|
40
30
|
*/
|
|
41
31
|
function readPublicKey(filename) {
|
|
42
|
-
|
|
32
|
+
if (filename.match(/.*\.der/)) {
|
|
33
|
+
const der = fs.readFileSync(filename);
|
|
34
|
+
return (0, crypto_1.createPublicKey)(der);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
const raw_key = _readPemFile(filename);
|
|
38
|
+
return (0, crypto_1.createPublicKey)(raw_key);
|
|
39
|
+
}
|
|
43
40
|
}
|
|
44
41
|
exports.readPublicKey = readPublicKey;
|
|
42
|
+
function myCreatePrivateKey(rawKey) {
|
|
43
|
+
// see https://askubuntu.com/questions/1409458/openssl-config-cuases-error-in-node-js-crypto-how-should-the-config-be-updated
|
|
44
|
+
const backup = process.env.OPENSSL_CONF;
|
|
45
|
+
process.env.OPENSSL_CONF = "/dev/null";
|
|
46
|
+
const retValue = (0, crypto_1.createPrivateKey)(rawKey);
|
|
47
|
+
process.env.OPENSSL_CONF = backup;
|
|
48
|
+
return retValue;
|
|
49
|
+
}
|
|
45
50
|
/**
|
|
46
51
|
* read a DER or PEM certificate from file
|
|
47
52
|
*/
|
|
48
53
|
function readPrivateKey(filename) {
|
|
49
|
-
|
|
54
|
+
if (filename.match(/.*\.der/)) {
|
|
55
|
+
const der = fs.readFileSync(filename);
|
|
56
|
+
return myCreatePrivateKey(der);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
const raw_key = _readPemFile(filename);
|
|
60
|
+
return myCreatePrivateKey(raw_key);
|
|
61
|
+
}
|
|
50
62
|
}
|
|
51
63
|
exports.readPrivateKey = readPrivateKey;
|
|
52
64
|
function readCertificatePEM(filename) {
|
|
@@ -68,15 +80,6 @@ function setCertificateStore(store) {
|
|
|
68
80
|
return old_store;
|
|
69
81
|
}
|
|
70
82
|
exports.setCertificateStore = setCertificateStore;
|
|
71
|
-
function read_sshkey_as_pem(filename) {
|
|
72
|
-
if (filename.substring(0, 1) !== ".") {
|
|
73
|
-
filename = __certificate_store + filename;
|
|
74
|
-
}
|
|
75
|
-
const key = fs.readFileSync(filename, "ascii");
|
|
76
|
-
const sshKey = sshpk.parseKey(key, "ssh");
|
|
77
|
-
return sshKey.toString("pkcs8");
|
|
78
|
-
}
|
|
79
|
-
exports.read_sshkey_as_pem = read_sshkey_as_pem;
|
|
80
83
|
/**
|
|
81
84
|
*
|
|
82
85
|
* @param filename
|
|
@@ -85,11 +88,20 @@ function readPrivateRsaKey(filename) {
|
|
|
85
88
|
if (filename.substring(0, 1) !== "." && !fs.existsSync(filename)) {
|
|
86
89
|
filename = __certificate_store + filename;
|
|
87
90
|
}
|
|
88
|
-
|
|
91
|
+
const content = fs.readFileSync(filename, "ascii");
|
|
92
|
+
const sshKey = sshpk.parsePrivateKey(content, "auto");
|
|
93
|
+
const key = sshKey.toString("pkcs1");
|
|
94
|
+
return (0, crypto_1.createPrivateKey)({ format: "pem", type: "pkcs1", key });
|
|
89
95
|
}
|
|
90
96
|
exports.readPrivateRsaKey = readPrivateRsaKey;
|
|
91
97
|
function readPublicRsaKey(filename) {
|
|
92
|
-
|
|
98
|
+
if (filename.substring(0, 1) !== "." && !fs.existsSync(filename)) {
|
|
99
|
+
filename = __certificate_store + filename;
|
|
100
|
+
}
|
|
101
|
+
const content = fs.readFileSync(filename, "ascii");
|
|
102
|
+
const sshKey = sshpk.parseKey(content, "ssh");
|
|
103
|
+
const key = sshKey.toString("pkcs1");
|
|
104
|
+
return (0, crypto_1.createPublicKey)({ format: "pem", type: "pkcs1", key });
|
|
93
105
|
}
|
|
94
106
|
exports.readPublicRsaKey = readPublicRsaKey;
|
|
95
107
|
//# sourceMappingURL=read.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../source_nodejs/read.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AACjC,yBAAyB;AACzB,6BAA6B;
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../source_nodejs/read.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AACjC,yBAAyB;AACzB,6BAA6B;AAC7B,mCAA2D;AAE3D,yDAA0E;AAE1E,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAE/B,SAAS,YAAY,CAAC,QAAgB;IAClC,MAAM,CAAC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC;IACrC,OAAO,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,sBAAsB,CAAC,QAAgB;IAC5C,IAAI,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE;QAC3B,OAAO,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAW,CAAC;KAC9C;IACD,MAAM,OAAO,GAAW,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC/C,OAAO,IAAA,8BAAe,EAAC,OAAO,CAAC,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,SAAgB,eAAe,CAAC,QAAgB;IAC5C,OAAO,sBAAsB,CAAC,QAAQ,CAAgB,CAAC;AAC3D,CAAC;AAFD,0CAEC;AAED;;GAEG;AACH,SAAgB,aAAa,CAAC,QAAgB;IAC1C,IAAI,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE;QAC3B,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAW,CAAC;QAChD,OAAO,IAAA,wBAAe,EAAC,GAAG,CAAC,CAAC;KAC/B;SAAM;QACH,MAAM,OAAO,GAAW,YAAY,CAAC,QAA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