|
|
@ -230,7 +230,6 @@ PayPro.prototype.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')
|
|
|
|
|
|
|
|
if (!Trusted[pem.replace(/\s+/g, '')]) { |
|
|
|
// throw new Error('Unstrusted certificate.');
|
|
|
@ -276,13 +275,11 @@ 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')
|
|
|
|
|
|
|
|
if (!Trusted[pem.replace(/\s+/g, '')]) { |
|
|
|
// throw new Error('Unstrusted certificate.');
|
|
|
|
} |
|
|
|
|
|
|
|
// return verifier.verify(pub, sig);
|
|
|
|
return verifier.verify(pem, sig); |
|
|
|
} else if (pki_type === 'none') { |
|
|
|
return true; |
|
|
|