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

node-opcua-common

Package Overview
Dependencies
Maintainers
1
Versions
219
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-opcua-common - npm Package Compare versions

Comparing version 2.85.0 to 2.86.0

11

dist/opcua_secure_object.d.ts
/// <reference types="node" />
/**
* @module node-opcua-common
*/
import { EventEmitter } from "events";
import { Certificate, PrivateKeyPEM } from "node-opcua-crypto";
import { Certificate, PrivateKey } from "node-opcua-crypto";
export interface ICertificateKeyPairProvider {
getCertificate(): Certificate;
getCertificateChain(): Certificate;
getPrivateKey(): PrivateKeyPEM;
getPrivateKey(): PrivateKey;
}

@@ -15,3 +12,3 @@ export interface ICertificateKeyPairProviderPriv extends ICertificateKeyPairProvider {

$$certificateChain: null | Certificate;
$$privateKeyPEM: null | PrivateKeyPEM;
$$privateKey: null | PrivateKey;
}

@@ -36,3 +33,3 @@ export interface IOPCUASecureObjectOptions {

getCertificateChain(): Certificate;
getPrivateKey(): PrivateKeyPEM;
getPrivateKey(): PrivateKey;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OPCUASecureObject = void 0;
/**
* @module node-opcua-common
*/
const events_1 = require("events");

@@ -15,4 +12,4 @@ const fs = require("fs");

}
function _load_private_key_pem(privateKeyFilename) {
return (0, node_opcua_crypto_1.readKeyPem)(privateKeyFilename);
function _load_private_key(privateKeyFilename) {
return (0, node_opcua_crypto_1.readPrivateKey)(privateKeyFilename);
}

@@ -57,7 +54,7 @@ /**

const priv = this;
if (!priv.$$privateKeyPEM) {
if (!priv.$$privateKey) {
(0, node_opcua_assert_1.assert)(fs.existsSync(this.privateKeyFile), "private file must exist :" + this.privateKeyFile);
priv.$$privateKeyPEM = _load_private_key_pem(this.privateKeyFile);
priv.$$privateKey = _load_private_key(this.privateKeyFile);
}
return priv.$$privateKeyPEM;
return priv.$$privateKey;
}

@@ -64,0 +61,0 @@ }

{
"name": "node-opcua-common",
"version": "2.85.0",
"version": "2.86.0",
"description": "pure nodejs OPCUA SDK - module -common",

@@ -15,4 +15,4 @@ "scripts": {

"node-opcua-assert": "2.77.0",
"node-opcua-crypto": "^1.12.0",
"node-opcua-types": "2.85.0"
"node-opcua-crypto": "^2.1.2",
"node-opcua-types": "2.86.0"
},

@@ -38,3 +38,3 @@ "devDependencies": {

"homepage": "http://node-opcua.github.io/",
"gitHead": "68498fcf7b20ea9f7bd66e8529c546221daf5d52"
"gitHead": "36afc46fe2c91aa5664a8c5418f4db5a354670c3"
}
/**
* @module node-opcua-common
*/
import { createPrivateKey } from "crypto";
import { EventEmitter } from "events";

@@ -8,3 +9,3 @@ import * as fs from "fs";

import { assert } from "node-opcua-assert";
import { Certificate, PrivateKeyPEM, readCertificate, readKeyPem, split_der } from "node-opcua-crypto";
import { Certificate, PrivateKey, readCertificate, readPrivateKey, split_der } from "node-opcua-crypto";

@@ -14,3 +15,3 @@ export interface ICertificateKeyPairProvider {

getCertificateChain(): Certificate;
getPrivateKey(): PrivateKeyPEM;
getPrivateKey(): PrivateKey;
}

@@ -20,3 +21,3 @@ export interface ICertificateKeyPairProviderPriv extends ICertificateKeyPairProvider {

$$certificateChain: null | Certificate;
$$privateKeyPEM: null | PrivateKeyPEM;
$$privateKey: null | PrivateKey;
}

@@ -28,4 +29,4 @@ function _load_certificate(certificateFilename: string): Certificate {

function _load_private_key_pem(privateKeyFilename: string): PrivateKeyPEM {
return readKeyPem(privateKeyFilename);
function _load_private_key(privateKeyFilename: string): PrivateKey {
return readPrivateKey(privateKeyFilename);
}

@@ -81,10 +82,10 @@

public getPrivateKey(): PrivateKeyPEM {
public getPrivateKey(): PrivateKey {
const priv = this as unknown as ICertificateKeyPairProviderPriv;
if (!priv.$$privateKeyPEM) {
if (!priv.$$privateKey) {
assert(fs.existsSync(this.privateKeyFile), "private file must exist :" + this.privateKeyFile);
priv.$$privateKeyPEM = _load_private_key_pem(this.privateKeyFile);
priv.$$privateKey = _load_private_key(this.privateKeyFile);
}
return priv.$$privateKeyPEM;
return priv.$$privateKey;
}
}

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