[](https://badge.fury.io/js/csr-helper)
npm install csr-helper
npm install csr-helper javascript
var api = require('csr-helper');
`
Example:
` javascript
var api = require('csr-helper');
api.create.keypair(2048).then(function(keypair){
var csr1 = api.create.csr.ServerPass({
CN : 'test.de',
L : 'UnknownCity',
O : 'testOrganization',
C : 'DE'
},keypair.privateKey, keypair.publicKey); console.log(api.export.csr(csr1));
var csr2 = api.create.csr.Email({
O : 'T-Systems',
C : 'DE',
OU1 : 'TeleSecTest-ShortTerm',
OU2 : 'Test-1ke',
OU3 : 'test',
firstname : 'Max',
lastname : 'Example',
emails : [
'test1@example.com',
'test2@example.com',
'test3@example.com',
'test4@example.com'
]
},keypair.privateKey, keypair.publicKey);
console.log(api.export.csr(csr2));
},function(err){
console.error(err);
});
`
Key Generation
* nodejs => local installation of openssl
* browser => web crypto API (http://caniuse.com/#feat=cryptography)API:
* create
* keypair(keylength) : promise.\
* p12(\ privateKey, \ pkcs7, (optional) \ friendlyName, (optional) \ password) : \
* csr
* serverpass(\, \ privateKey, \ publicKey) : \
* email(\, \ privateKey, \ publicKey) : \
* display
* csr(\) : \ ` javascript
keypair = { //
privateKey : ,
publicKey :
}
`` javascript
serverPassData = { //
CN : ,
L : ,
O : ,
C : ,
(optional) OU1 : ,
(optional) OU2 : ,
(optional) OU3 : ,
(optional) OU4 : ,
(optional) OU5 : ,
(optional) streetAddress : ,
(optional) postalCode :
}
`` javascript
emailData = { //
O : ,
C : ,
firstname : ,
lastname : ,
emails : ,
OU1 : ,
OU2 : ,
(optional) OU3 :
}
``\