How to use the pem.getDhparamInfo function in pem

To help you get started, we’ve selected a few pem 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 DefinitelyTyped / DefinitelyTyped / pem / pem-tests.ts View on Github external
'Get DH param info': (test: any) => {
    var dh = ''; // fs.readFileSync('./test/fixtures/test.dh').toString();

    pem.getDhparamInfo(dh, (error: any, data: any) => {
      var size = data && data.size || 0;
      var prime = (data && data.prime || '').toString();
      test.ifError(error);
      test.equal(size, 1024);
      test.ok(prime);
      // test.ok(fs.readdirSync('./tmp').length === 0);
      test.equal(typeof size, 'number');
      test.ok(/([0-9a-f][0-9a-f]:)+[0-9a-f][0-9a-f]$/g.test(prime));
      test.done();
    });
  },
github DefinitelyTyped / DefinitelyTyped / types / pem / pem-tests.ts View on Github external
'Get DH param info': (test: any) => {
    const dh = ''; // fs.readFileSync('./test/fixtures/test.dh').toString();

    pem.getDhparamInfo(dh, (error: any, data: any) => {
      const size = data && data.size || 0;
      const prime = (data && data.prime || '').toString();
      test.ifError(error);
      test.equal(size, 1024);
      test.ok(prime);
      // test.ok(fs.readdirSync('./tmp').length === 0);
      test.equal(typeof size, 'number');
      test.ok(/([0-9a-f][0-9a-f]:)+[0-9a-f][0-9a-f]$/g.test(prime));
      test.done();
    });
  },