|
|
@ -97,18 +97,8 @@ PayPro.prototype.x509Verify = function(key) { |
|
|
|
var npem = KJUR.asn1.ASN1Util.getPEMStringFromHex(nder, 'CERTIFICATE'); |
|
|
|
|
|
|
|
//
|
|
|
|
// Get Public Key from next certificate:
|
|
|
|
// Get Public Key from next certificate (via KJUR because it's a mess):
|
|
|
|
//
|
|
|
|
// var ndata = new Buffer(nder, 'hex');
|
|
|
|
// var nc = rfc3280.Certificate.decode(ndata, 'der');
|
|
|
|
// var npubKeyAlg = PayPro.getAlgorithm(
|
|
|
|
// nc.tbsCertificate.subjectPublicKeyInfo.algorithm.algorithm);
|
|
|
|
// var npubKey = nc.tbsCertificate.subjectPublicKeyInfo.subjectPublicKey.data;
|
|
|
|
// // npubKey = self._DERtoPEM(npubKey, npubKeyAlg + ' PUBLIC KEY');
|
|
|
|
// // npubKey = KJUR.asn1.ASN1Util.getPEMStringFromHex(npubKey.toString('hex'), 'PUBLIC KEY');
|
|
|
|
// npubKey = KJUR.asn1.ASN1Util.getPEMStringFromHex(npubKey.toString('hex'), npubKeyAlg + ' PUBLIC KEY');
|
|
|
|
|
|
|
|
// Get public key from next certificate via KJUR since sane methods don't work:
|
|
|
|
var js = new KJUR.crypto.Signature({ |
|
|
|
alg: type + 'withRSA', |
|
|
|
prov: 'cryptojs/jsrsa' |
|
|
|