allow der encoding
This commit is contained in:
parent
2e24c43dee
commit
37ebdc0f62
11
lib/csr.js
11
lib/csr.js
@ -14,10 +14,7 @@ var CSR = module.exports = function rsacsr(opts) {
|
||||
opts = CSR._prepare(opts);
|
||||
|
||||
return CSR.create(opts).then(function (bytes) {
|
||||
return PEM.packBlock({
|
||||
type: "CERTIFICATE REQUEST"
|
||||
, bytes: bytes /* { jwk: jwk, domains: opts.domains } */
|
||||
});
|
||||
return CSR._encode(opts, bytes);
|
||||
});
|
||||
};
|
||||
|
||||
@ -75,6 +72,12 @@ CSR._prepare = function (opts) {
|
||||
CSR.sync = function (opts) {
|
||||
opts = CSR._prepare(opts);
|
||||
var bytes = CSR.createSync(opts);
|
||||
return CSR._encode(opts, bytes);
|
||||
};
|
||||
CSR._encode = function (opts, bytes) {
|
||||
if ('der' === (opts.encoding||'').toLowerCase()) {
|
||||
return bytes;
|
||||
}
|
||||
return PEM.packBlock({
|
||||
type: "CERTIFICATE REQUEST"
|
||||
, bytes: bytes /* { jwk: jwk, domains: opts.domains } */
|
||||
|
Loading…
x
Reference in New Issue
Block a user