diff --git a/lib/PayPro.js b/lib/PayPro.js index d35bbbe..6d64bb8 100644 --- a/lib/PayPro.js +++ b/lib/PayPro.js @@ -254,10 +254,10 @@ PayPro.prototype.verify = function() { var der = pki_data.toString('hex'); var pem = KJUR.asn1.ASN1Util.getPEMStringFromHex(der, 'CERTIFICATE'); - var pub = KJUR.KEYUTIL.getHexFromPEM(pem, 'PUBLIC KEY') - // var pub = KJUR.X509.getPublicKeyFromCertPEM(pem); + // var pub = KJUR.KEYUTIL.getHexFromPEM(pem, 'PUBLIC KEY') - return verifier.verify(pub, sig); + // return verifier.verify(pub, sig); + return verifier.verify(pem, sig); } else if (pki_type === 'none') { return true; } diff --git a/lib/browser/PayPro.js b/lib/browser/PayPro.js index 0fa4508..6cfcefd 100644 --- a/lib/browser/PayPro.js +++ b/lib/browser/PayPro.js @@ -35,8 +35,7 @@ PayPro.sign = function(key) { var der = pki_data.toString('hex'); var pem = KJUR.asn1.ASN1Util.getPEMStringFromHex(der, 'CERTIFICATE'); - var pub = KJUR.KEYUTIL.getHexFromPEM(pem, 'PUBLIC KEY') - // var pub = KJUR.X509.getPublicKeyFromCertPEM(pem); + // var pub = KJUR.KEYUTIL.getHexFromPEM(pem, 'PUBLIC KEY') var jsrsaSig = new KJUR.crypto.Signature({ alg: type + 'withRSA', @@ -83,8 +82,7 @@ PayPro.verify = function() { var der = pki_data.toString('hex'); var pem = KJUR.asn1.ASN1Util.getPEMStringFromHex(der, 'CERTIFICATE'); - var pub = KJUR.KEYUTIL.getHexFromPEM(pem, 'PUBLIC KEY') - // var pub = KJUR.X509.getPublicKeyFromCertPEM(pem); + // var pub = KJUR.KEYUTIL.getHexFromPEM(pem, 'PUBLIC KEY') jsrsaSig.initVerifyByCertificatePEM(pem);