Skip to content

Commit

Permalink
doc: add tls.parseCertString()
Browse files Browse the repository at this point in the history
  • Loading branch information
XadillaX committed Jul 13, 2017
1 parent 8d1f3da commit d61d561
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions doc/api/tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,37 @@ For example:
console.log(tls.getCiphers()); // ['AES128-SHA', 'AES256-SHA', ...]
```

## tls.parseCertString(str)
<!-- YAML
added: v0.3.3
-->

* `str` {string} A Cert string that joins each key-value pair with `'\n'`.

Returns the parsed object. eg.

```js
tls.parseCertString(`C=US
ST=CA
L=SF
O=Joyent
OU=Node.js
CN=ca1
[email protected]`);
```

This will return

```js
{ C: 'US',
ST: 'CA',
L: 'SF',
O: 'Joyent',
OU: 'Node.js',
CN: 'ca1',
emailAddress: '[email protected]' }
```

## tls.DEFAULT_ECDH_CURVE
<!-- YAML
added: v0.11.13
Expand Down

0 comments on commit d61d561

Please sign in to comment.