<commit_before># simplessl
A basic ssl manager


## Installation

```bash
$ npm install simplessl
```

## Features

   * simply create key, csr & crt files for ssl use
   * ... with the three or only one function

## Doc

   * setOpenSSLBinPath(string file) : return this // set a specific path to the OpenSSL software
   * setOpenSSLConfPath(string file) : return this // set a specific path to the OpenSSL configuration
   * createPrivateKey(string keyfile [, string|number keysize]) : return Promise instance
   * createCSR(string keyfile, string csrfile [, string|number keysize]) : return Promise instance
   * createCertificate(string keyfile, string csrfile, string certificatefile [, string|number keysize]) : return Promise instance

"keysize" must be equal to : small | 2048 | medium | 3072 | large | 4096

(small = 2048, medium = 3072, large = 4096)

## Examples

```js

const SimpleSSL = require('simplessl');

var SSL = new SimpleSSL(),

   crtpath = path.join(__dirname, 'crt'),
      serverkey = path.join(crtpath, 'server.key'),
      servercsr = path.join(crtpath, 'server.csr'),
      servercrt = path.join(crtpath, 'server.crt');

// this function will automatically apply SSL.createCSR && SSL.createPrivateKey functions
// if serverkey or servercsr does not exist

SSL.createCertificate(serverkey, servercsr, servercrt).then(function(data) {

   console.log(data);

   try {

      require('https').createServer({
         key: data.privateKey,
         cert: data.certificate
      });

   }
   catch(e) {
      console.log(e);
   }

})
.catch(function(err) {
   console.log(err);
});

```

## Tests

```bash
$ mocha tests/tests.js
```

## License<commit_msg>correction<commit_after># simplessl
A basic ssl manager


## Installation

```bash
$ npm install simplessl
```

## Features

   * simply create key, csr & crt files for ssl use
   * ... with the three or only one function

## Doc

   * setOpenSSLBinPath(string file) : return this // set a specific path to the OpenSSL software
   * setOpenSSLConfPath(string file) : return this // set a specific path to the OpenSSL configuration
   * createPrivateKey(string keyfile [, string|number keysize]) : return Promise instance
   * createCSR(string keyfile, string csrfile [, string|number keysize]) : return Promise instance
   * createCertificate(string keyfile, string csrfile, string certificatefile [, string|number keysize]) : return Promise instance

"keysize" must be equal to : small | 2048 | medium | 3072 | large | 4096

(small = 2048, medium = 3072, large = 4096)

## Examples

```js

const SimpleSSL = require('simplessl');

var SSL = new SimpleSSL(),

   crtpath = path.join(__dirname, 'crt'),
      serverkey = path.join(crtpath, 'server.key'),
      servercsr = path.join(crtpath, 'server.csr'),
      servercrt = path.join(crtpath, 'server.crt');

// this function will automatically apply SSL.createCSR && SSL.createPrivateKey functions
// if serverkey or servercsr does not exist

SSL.createCertificate(serverkey, servercsr, servercrt).then(function(data) {

   console.log(data);

   try {

      require('https').createServer({
         key: data.privateKey,
         cert: data.certificate
      });

   }
   catch(e) {
      console.log(e);
   }

})
.catch(function(err) {
   console.log(err);
});

```

## Tests

```bash
$ gulp
```

## License
{'fraction_non_alphanumeric': 0.12211912601017659, 'fraction_numerical': 0.014366956001197246, 'mean_word_length': 3.6545961002785514, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3643421', 'n_tokens_mistral': 1095, 'n_tokens_neox': 1024, 'n_words': 302}