How to use the node-opcua-crypto.makeMessageChunkSignature function in node-opcua-crypto

To help you get started, we’ve selected a few node-opcua-crypto 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-secure-channel / test_helpers / signature_helpers.ts View on Github external
return (chunk: Buffer) => {
        const options = {
            algorithm: "RSA-SHA256",
            privateKey,
            signatureLength: 128,
        };
        const buf = makeMessageChunkSignature(chunk, options); // Buffer
        assert(buf instanceof Buffer, "expecting a Buffer");
        return buf;
    };
}
github node-opcua / node-opcua / packages / node-opcua-secure-channel / test_helpers / signature_helpers.js View on Github external
return function (chunk) {
        const options = {
            algorithm: "RSA-SHA256",
            signatureLength: 128,
            privateKey: privateKey
        };
        const buf = crypto_utils.makeMessageChunkSignature(chunk, options); // Buffer
        assert(buf instanceof Buffer, "expecting a Buffer");
        return buf;
    };
}
github node-opcua / node-opcua / packages / node-opcua-secure-channel / source / security_policy.ts View on Github external
function RSAPKCS1V15SHA256_Sign(buffer: Buffer, privateKey: PrivateKeyPEM): Buffer {

// xx    if (privateKey instanceof Buffer) {
// xx        privateKey = toPem(privateKey, "RSA PRIVATE KEY");
// xx   }
    const params = {
        algorithm: "RSA-SHA256",
        privateKey,
        signatureLength: rsa_length(privateKey),
    };
    return makeMessageChunkSignature(buffer, params);
}
github node-opcua / node-opcua / packages / node-opcua-secure-channel / test_helpers / fake_message_chunk_factory.ts View on Github external
        signBufferFunc: (chunk: Buffer) => makeMessageChunkSignature(chunk, params),
        signatureLength: 128,
github node-opcua / node-opcua / packages / node-opcua-secure-channel / test_helpers / fake_message_chunk_factory.js View on Github external
signingFunc: function (chunk) {
            return crypto_utils.makeMessageChunkSignature(chunk, params);
        }
    };
github node-opcua / node-opcua / packages / node-opcua-secure-channel / source / security_policy.ts View on Github external
function RSAPKCS1V15SHA1_Sign(buffer: Buffer, privateKey: PrivateKeyPEM): Buffer {

    assert(!((privateKey as any) instanceof Buffer), "privateKey should not be a Buffer but a PEM");
    const params = {
        algorithm: "RSA-SHA1",
        privateKey,
        signatureLength: rsa_length(privateKey),
    };
    return makeMessageChunkSignature(buffer, params);
}
github node-opcua / node-opcua / packages / node-opcua-secure-channel / src / security_policy.js View on Github external
function RSAPKCS1V15SHA1_Sign(buffer, privateKey) {

    if (privateKey instanceof Buffer) {
        privateKey = crypto_utils.toPem(privateKey, "RSA PRIVATE KEY");
    }
    const params = {
        signatureLength: crypto_utils.rsa_length(privateKey),
        algorithm: "RSA-SHA1",
        privateKey: privateKey
    };
    return crypto_utils.makeMessageChunkSignature(buffer, params);
}
github node-opcua / node-opcua / packages / node-opcua-secure-channel / src / security_policy.js View on Github external
function RSAPKCS1V15SHA256_Sign(buffer, privateKey) {

    if (privateKey instanceof Buffer) {
        privateKey = crypto_utils.toPem(privateKey, "RSA PRIVATE KEY");
    }
    const params = {
        signatureLength: crypto_utils.rsa_length(privateKey),
        algorithm: "RSA-SHA256",
        privateKey: privateKey
    };
    return crypto_utils.makeMessageChunkSignature(buffer, params);
}