diff --git a/doc/api/tls.md b/doc/api/tls.md index 80cd2e87263566..7c46f114565091 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -1149,6 +1149,37 @@ For example: console.log(tls.getCiphers()); // ['AES128-SHA', 'AES256-SHA', ...] ``` +## tls.parseCertString(str) + + +* `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 +emailAddress=ry@clouds.org`); +``` + +This will return + +```js +{ C: 'US', + ST: 'CA', + L: 'SF', + O: 'Joyent', + OU: 'Node.js', + CN: 'ca1', + emailAddress: 'ry@clouds.org' } +``` + ## tls.DEFAULT_ECDH_CURVE