crypto#constants TypeScript Examples

The following examples show how to use crypto#constants. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Rsa4096Pss.ts    From arbundles with Apache License 2.0 5 votes vote down vote up
sign(message: Uint8Array): Uint8Array {
    return createSign("sha256").update(message).sign({
      key: this._key,
      padding: constants.RSA_PKCS1_PSS_PADDING,
    });
  }
Example #2
Source File: crypto.ts    From cloudmusic-vscode with MIT License 5 votes vote down vote up
rsaEncrypt = (buffer: Uint8Array) => {
  return publicEncrypt(
    { key: publicKey, padding: constants.RSA_NO_PADDING },
    Buffer.concat([Buffer.alloc(128 - buffer.length), buffer])
  );
}
Example #3
Source File: httpUtils.ts    From opentelemetry-azure-monitor-js with MIT License 5 votes vote down vote up
tlsRestrictedAgent = new https.Agent(<any>{
  secureOptions:
    // eslint-disable-next-line no-bitwise
    constants.SSL_OP_NO_SSLv2 |
    constants.SSL_OP_NO_SSLv3 |
    constants.SSL_OP_NO_TLSv1 |
    constants.SSL_OP_NO_TLSv1_1,
})