How to use the pem.createDhparam 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 / types / pem / pem-tests.ts View on Github external
'Create 2048bit dhparam key': (test: any) => {
    pem.createDhparam(2048, (error: any, data: any) => {
      const dhparam = (data && data.dhparam || '').toString();
      test.ifError(error);
      test.ok(dhparam);
      test.ok(dhparam.match(/^\n*\-\-\-\-\-BEGIN DH PARAMETERS\-\-\-\-\-\n/));
      test.ok(dhparam.match(/\n\-\-\-\-\-END DH PARAMETERS\-\-\-\-\-\n*$/));
      test.ok(dhparam.trim().length > 420 && dhparam.trim().length < 430);
      // test.ok(fs.readdirSync('./tmp').length === 0);
      test.done();
    });
  },
github DefinitelyTyped / DefinitelyTyped / pem / pem-tests.ts View on Github external
'Create 2048bit dhparam key': (test: any) => {
    pem.createDhparam(2048, (error: any, data: any) => {
      var dhparam = (data && data.dhparam || '').toString();
      test.ifError(error);
      test.ok(dhparam);
      test.ok(dhparam.match(/^\n*\-\-\-\-\-BEGIN DH PARAMETERS\-\-\-\-\-\n/));
      test.ok(dhparam.match(/\n\-\-\-\-\-END DH PARAMETERS\-\-\-\-\-\n*$/));
      test.ok(dhparam.trim().length > 420 && dhparam.trim().length < 430);
      // test.ok(fs.readdirSync('./tmp').length === 0);
      test.done();
    });
  },