Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-opcua-crypto

Package Overview
Dependencies
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-opcua-crypto - npm Package Compare versions

Comparing version 1.9.0 to 1.10.0

0

.prettierrc.js

@@ -0,0 +0,0 @@ module.exports = {

export * from "./read";
export * from "./read_certificate_revocation_list";
export * from "./read_certificate_signing_request";

6

dist/source_nodejs/index.js
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

import { CertificateRevocationList } from "../source/common";
export declare function readCertificateRevocationList(filename: string): Promise<CertificateRevocationList>;
/// <reference types="node" />
export declare type CertificateSigningRequest = Buffer;
export declare function readCertificateSigningRequest(filename: string): Promise<CertificateSigningRequest>;

@@ -0,0 +0,0 @@ import { Certificate, CertificatePEM, PrivateKey, PrivateKeyPEM, PublicKey, PublicKeyPEM } from "../source/common";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /// <reference types="node" />

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /// <reference types="node" />

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /// <reference types="node" />

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=common.js.map

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /// <reference types="node" />

2

dist/source/crypto_utils.js

@@ -15,3 +15,3 @@ "use strict";

const jsrsasign = require("jsrsasign");
const PEM_REGEX = /^(-----BEGIN (.*)-----\r?\n([/+=a-zA-Z0-9\r\n]*)\r?\n-----END \2-----\r?\n)/gm;
const PEM_REGEX = /^(-----BEGIN (.*)-----\r?\n([/+=a-zA-Z0-9\r\n]*)\r?\n-----END \2-----\r?\n?)/gm;
const PEM_TYPE_REGEX = /^(-----BEGIN (.*)-----)/m;

@@ -18,0 +18,0 @@ // Copyright 2012 The Obvious Corporation.

@@ -0,0 +0,0 @@ /// <reference types="node" />

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /// <reference types="node" />

@@ -12,24 +12,49 @@ "use strict";

const blocks = (0, asn1_1._readStruct)(buffer, blockInfo);
const version = (0, asn1_1._readIntegerValue)(buffer, blocks[0]);
const signature = (0, asn1_1._readAlgorithmIdentifier)(buffer, blocks[1]);
const issuer = readNameForCrl(buffer, blocks[2]);
const issuerFingerprint = (0, asn1_1.formatBuffer2DigitHexWithColum)((0, crypto_utils_1.makeSHA1Thumbprint)((0, asn1_1._getBlock)(buffer, blocks[2])));
const thisUpdate = (0, asn1_1._readTime)(buffer, blocks[3]);
const nextUpdate = (0, asn1_1._readTime)(buffer, blocks[4]);
const revokedCertificates = [];
if (blocks[5] && blocks[5].tag < 0x80) {
const list = (0, asn1_1._readStruct)(buffer, blocks[5]);
for (const r of list) {
// sometime blocks[5] doesn't exits .. in this case
const rr = (0, asn1_1._readStruct)(buffer, r);
const userCertificate = (0, asn1_1.formatBuffer2DigitHexWithColum)((0, asn1_1._readLongIntegerValue)(buffer, rr[0]));
const revocationDate = (0, asn1_1._readTime)(buffer, rr[1]);
revokedCertificates.push({
revocationDate,
userCertificate,
});
const hasOptionalVersion = blocks[0].tag === asn1_1.TagType.INTEGER;
if (hasOptionalVersion) {
const version = (0, asn1_1._readIntegerValue)(buffer, blocks[0]);
const signature = (0, asn1_1._readAlgorithmIdentifier)(buffer, blocks[1]);
const issuer = readNameForCrl(buffer, blocks[2]);
const issuerFingerprint = (0, asn1_1.formatBuffer2DigitHexWithColum)((0, crypto_utils_1.makeSHA1Thumbprint)((0, asn1_1._getBlock)(buffer, blocks[2])));
const thisUpdate = (0, asn1_1._readTime)(buffer, blocks[3]);
const nextUpdate = (0, asn1_1._readTime)(buffer, blocks[4]);
const revokedCertificates = [];
if (blocks[5] && blocks[5].tag < 0x80) {
const list = (0, asn1_1._readStruct)(buffer, blocks[5]);
for (const r of list) {
// sometime blocks[5] doesn't exits .. in this case
const rr = (0, asn1_1._readStruct)(buffer, r);
const userCertificate = (0, asn1_1.formatBuffer2DigitHexWithColum)((0, asn1_1._readLongIntegerValue)(buffer, rr[0]));
const revocationDate = (0, asn1_1._readTime)(buffer, rr[1]);
revokedCertificates.push({
revocationDate,
userCertificate,
});
}
}
const ext0 = (0, asn1_1._findBlockAtIndex)(blocks, 0);
return { issuer, issuerFingerprint, thisUpdate, nextUpdate, signature, revokedCertificates };
}
const ext0 = (0, asn1_1._findBlockAtIndex)(blocks, 0);
return { issuer, issuerFingerprint, thisUpdate, nextUpdate, signature, revokedCertificates };
else {
const signature = (0, asn1_1._readAlgorithmIdentifier)(buffer, blocks[0]);
const issuer = readNameForCrl(buffer, blocks[1]);
const issuerFingerprint = (0, asn1_1.formatBuffer2DigitHexWithColum)((0, crypto_utils_1.makeSHA1Thumbprint)((0, asn1_1._getBlock)(buffer, blocks[1])));
const thisUpdate = (0, asn1_1._readTime)(buffer, blocks[2]);
const nextUpdate = (0, asn1_1._readTime)(buffer, blocks[3]);
const revokedCertificates = [];
if (blocks[4] && blocks[4].tag < 0x80) {
const list = (0, asn1_1._readStruct)(buffer, blocks[4]);
for (const r of list) {
// sometime blocks[5] doesn't exits .. in this case
const rr = (0, asn1_1._readStruct)(buffer, r);
const userCertificate = (0, asn1_1.formatBuffer2DigitHexWithColum)((0, asn1_1._readLongIntegerValue)(buffer, rr[0]));
const revocationDate = (0, asn1_1._readTime)(buffer, rr[1]);
revokedCertificates.push({
revocationDate,
userCertificate,
});
}
}
return { issuer, issuerFingerprint, thisUpdate, nextUpdate, signature, revokedCertificates };
}
}

@@ -36,0 +61,0 @@ // see https://tools.ietf.org/html/rfc5280

@@ -0,0 +0,0 @@ /// <reference types="node" />

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /// <reference types="node" />

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /**

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

@@ -0,0 +0,0 @@ export declare const oid_map: {

@@ -0,0 +0,0 @@ "use strict";

import { Certificate } from "./common";
import { PrivateKey } from "./common";
export declare function publicKeyAndPrivateKeyMatches(certificate: Certificate, privateKey: PrivateKey): boolean;

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ /// <reference types="node" />

@@ -0,0 +0,0 @@ "use strict";

module.exports = {
...require("./dist/source"),
};
export * from "./dist/source";
export * from "./dist/source_nodejs";

@@ -0,0 +0,0 @@ module.exports = {

{
"name": "node-opcua-crypto",
"version": "1.9.0",
"version": "1.10.0",
"description": "Crypto tools for Node-OPCUA",

@@ -32,22 +32,22 @@ "main": "./index.js",

"@types/mocha": "^9.1.0",
"@types/node": "^17.0.21",
"@typescript-eslint/eslint-plugin": "^5.12.1",
"@typescript-eslint/parser": "^5.12.1",
"eslint": "^8.10.0",
"eslint-config-prettier": "^8.4.0",
"@types/node": "^17.0.23",
"@typescript-eslint/eslint-plugin": "^5.16.0",
"@typescript-eslint/parser": "^5.16.0",
"eslint": "^8.12.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"lorem-ipsum": "^2.0.4",
"mocha": "^9.2.1",
"prettier": "^2.5.1",
"mocha": "^9.2.2",
"prettier": "^2.6.1",
"should": "^13.2.3",
"source-map": "^0.7.3",
"source-map-support": "^0.5.21",
"ts-node": "^10.5.0",
"typescript": "^4.5.5"
"ts-node": "^10.7.0",
"typescript": "^4.6.3"
},
"dependencies": {
"better-assert": "^1.0.2",
"chalk": "^4.1.2",
"chalk": "4.1.2",
"hexy": "0.3.4",
"jsrsasign": "^10.5.8",
"jsrsasign": "^10.5.13",
"sshpk": "^1.17.0"

@@ -54,0 +54,0 @@ },

@@ -0,0 +0,0 @@ # node-opcua-crypto

export * from "./read";
export * from "./read_certificate_revocation_list";
export * from "./read_certificate_signing_request";

@@ -0,0 +0,0 @@ import * as fs from "fs";

@@ -0,0 +0,0 @@ import * as fs from "fs";

@@ -0,0 +0,0 @@ import * as assert from "assert";

@@ -0,0 +0,0 @@ import * as assert from "assert";

@@ -0,0 +0,0 @@ //

@@ -0,0 +0,0 @@ export type Nonce = Buffer;

@@ -15,3 +15,3 @@ // tslint:disabled:no-var-requires

const PEM_REGEX = /^(-----BEGIN (.*)-----\r?\n([/+=a-zA-Z0-9\r\n]*)\r?\n-----END \2-----\r?\n)/gm;
const PEM_REGEX = /^(-----BEGIN (.*)-----\r?\n([/+=a-zA-Z0-9\r\n]*)\r?\n-----END \2-----\r?\n?)/gm;

@@ -18,0 +18,0 @@ const PEM_TYPE_REGEX = /^(-----BEGIN (.*)-----)/m;

@@ -0,0 +0,0 @@ /**

@@ -20,2 +20,3 @@ import {

_readIntegerValue,
TagType,
} from "./asn1";

@@ -57,29 +58,57 @@ import { CertificateRevocationList } from "./common";

const version = _readIntegerValue(buffer, blocks[0]);
const signature = _readAlgorithmIdentifier(buffer, blocks[1]);
const issuer = readNameForCrl(buffer, blocks[2]);
const issuerFingerprint = formatBuffer2DigitHexWithColum(makeSHA1Thumbprint(_getBlock(buffer, blocks[2])));
const hasOptionalVersion = blocks[0].tag === TagType.INTEGER;
const thisUpdate = _readTime(buffer, blocks[3]);
const nextUpdate = _readTime(buffer, blocks[4]);
if (hasOptionalVersion) {
const version = _readIntegerValue(buffer, blocks[0]);
const signature = _readAlgorithmIdentifier(buffer, blocks[1]);
const issuer = readNameForCrl(buffer, blocks[2]);
const issuerFingerprint = formatBuffer2DigitHexWithColum(makeSHA1Thumbprint(_getBlock(buffer, blocks[2])));
const revokedCertificates: RevokedCertificate[] = [];
const thisUpdate = _readTime(buffer, blocks[3]);
const nextUpdate = _readTime(buffer, blocks[4]);
if (blocks[5] && blocks[5].tag < 0x80) {
const list = _readStruct(buffer, blocks[5]);
for (const r of list) {
// sometime blocks[5] doesn't exits .. in this case
const rr = _readStruct(buffer, r);
const userCertificate = formatBuffer2DigitHexWithColum(_readLongIntegerValue(buffer, rr[0]));
const revocationDate = _readTime(buffer, rr[1]);
revokedCertificates.push({
revocationDate,
userCertificate,
});
const revokedCertificates: RevokedCertificate[] = [];
if (blocks[5] && blocks[5].tag < 0x80) {
const list = _readStruct(buffer, blocks[5]);
for (const r of list) {
// sometime blocks[5] doesn't exits .. in this case
const rr = _readStruct(buffer, r);
const userCertificate = formatBuffer2DigitHexWithColum(_readLongIntegerValue(buffer, rr[0]));
const revocationDate = _readTime(buffer, rr[1]);
revokedCertificates.push({
revocationDate,
userCertificate,
});
}
}
}
const ext0 = _findBlockAtIndex(blocks, 0);
const ext0 = _findBlockAtIndex(blocks, 0);
return { issuer, issuerFingerprint, thisUpdate, nextUpdate, signature, revokedCertificates } as TBSCertList;
} else {
return { issuer, issuerFingerprint, thisUpdate, nextUpdate, signature, revokedCertificates } as TBSCertList;
const signature = _readAlgorithmIdentifier(buffer, blocks[0]);
const issuer = readNameForCrl(buffer, blocks[1]);
const issuerFingerprint = formatBuffer2DigitHexWithColum(makeSHA1Thumbprint(_getBlock(buffer, blocks[1])));
const thisUpdate = _readTime(buffer, blocks[2]);
const nextUpdate = _readTime(buffer, blocks[3]);
const revokedCertificates: RevokedCertificate[] = [];
if (blocks[4] && blocks[4].tag < 0x80) {
const list = _readStruct(buffer, blocks[4]);
for (const r of list) {
// sometime blocks[5] doesn't exits .. in this case
const rr = _readStruct(buffer, r);
const userCertificate = formatBuffer2DigitHexWithColum(_readLongIntegerValue(buffer, rr[0]));
const revocationDate = _readTime(buffer, rr[1]);
revokedCertificates.push({
revocationDate,
userCertificate,
});
}
}
return { issuer, issuerFingerprint, thisUpdate, nextUpdate, signature, revokedCertificates } as TBSCertList;
}
}

@@ -86,0 +115,0 @@ // see https://tools.ietf.org/html/rfc5280

@@ -0,0 +0,0 @@ import * as assert from "assert";

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ import * as assert from "assert";

@@ -0,0 +0,0 @@ /**

@@ -0,0 +0,0 @@ // https://github.com/lapo-luchini/asn1js/blob/master/oids.js

@@ -0,0 +0,0 @@ import { exploreCertificate } from ".";

@@ -0,0 +0,0 @@ // tslint:disable: no-console

@@ -0,0 +0,0 @@ // tslint:disable: no-console

@@ -0,0 +0,0 @@ {

@@ -0,0 +0,0 @@ {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc