Skip to content

Commit

Permalink
Merge pull request #24 from detj/master
Browse files Browse the repository at this point in the history
getModulus() will now accept Buffers
  • Loading branch information
andris9 committed Nov 28, 2014
2 parents 97c0ecc + 0a14439 commit e23255d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/pem.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ function readCertificateInfo(certificate, callback){
* @param {Function} callback Callback function with an error object and {modulus}
*/
function getModulus(certificate, callback){
certificate = Buffer.isBuffer(certificate) && certificate.toString() || certificate;

var type = "";
if ( certificate.match(/BEGIN(\sNEW)? CERTIFICATE REQUEST/)){
type="req";
Expand Down

0 comments on commit e23255d

Please sign in to comment.