How to use the node-opcua-common.OPCUASecureObject.call function in node-opcua-common

To help you get started, we’ve selected a few node-opcua-common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-opcua / node-opcua / packages / node-opcua-client / src / client_base.js View on Github external
options.certificateFile = options.certificateFile || path.join(__dirname, "../certificates/client_selfsigned_cert_2048.pem");

    options.privateKeyFile = options.privateKeyFile || path.join(__dirname, "../certificates/PKI/own/private/private_key.pem");

    // istanbul ignore next
    if (!fs.existsSync(options.certificateFile)) {
        throw new Error(" cannot locate certificate file " + options.certificateFile);
    }

    // istanbul ignore next
    if (!fs.existsSync(options.privateKeyFile)) {
        throw new Error(" cannot locate private key file " + options.privateKeyFile);
    }

    OPCUASecureObject.call(this, options);

    // must be ZERO with Spec 1.0.2
    this.protocolVersion = 0;

    this._sessions = [];


    this._server_endpoints = [];
    this._secureChannel = null;

    this.defaultSecureTokenLifetime = options.defaultSecureTokenLifetime || 600000;
    this.tokenRenewalInterval = options.tokenRenewalInterval || 0;
    assert(_.isFinite(this.tokenRenewalInterval) && this.tokenRenewalInterval >= 0);
    /**
     * @property securityMode
     * @type MessageSecurityMode