Giter VIP home page Giter VIP logo

apple-pay-signature-and-decrypt's People

Contributors

kenblair1226 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

apple-pay-signature-and-decrypt's Issues

Validation of signer's certificate failed: No valid certificate paths found

你好,我目前在使用apple pay解密

const publicCert = fs.readFileSync(path.join(__dirname, './ccr_p.pem'), 'utf8') // 使用Payment Processing Certificate file
const privateKey = fs.readFileSync(path.join(__dirname, './ccr.key'), 'utf8') // 使用Payment Processing Certificate private key file

// apple's root CA做verify
const AppleRootCABuffer = fs.readFileSync(
  path.join(__dirname, './AppleRootCA-G3.cer')
);
const AppleRootCAASN1 = asn1js.fromBER(new Uint8Array(AppleRootCABuffer).buffer);
const AppleRootCA = new pkijs.Certificate({ schema: AppleRootCAASN1.result });

由PKIjs報出這個error:No valid certificate paths found,請問我的Certificate還需要先做什麼認證嗎?
不曉得之前你有沒有遇到類似問題?

{
  date: 2022-12-14T02:16:38.670Z,
  code: 5,
  message: "Validation of signer's certificate failed: No valid certificate paths found",
  signatureVerified: null,
  signerCertificate: Certificate {
    tbs: ArrayBuffer {
      [Uint8Contents]: <30 82 03 88 a0 03 02 01 02 02 08 4c 30 41 49 51 9d 54 36 30 0a 06 08 2a 86 48 ce 3d 04 03 02 30 7a 31 2e 30 2c 06 03 55 04 03 0c 25 41 70 70 6c 65 20 41 70 70 6c 69 63 61 74 69 6f 6e 20 49 6e 74 65 67 72 61 74 69 6f 6e 20 43 41 20 2d 20 47 33 31 26 30 24 06 03 55 04 0b 0c 1d 41 70 70 6c 65 20 43 65 ... 808 more bytes>,
      byteLength: 908
    },
    version: 2,
    serialNumber: Integer {
      blockLength: 10,
      error: '',
      warnings: [],
      valueBeforeDecode: [ArrayBuffer],
      idBlock: [LocalIdentificationBlock],
      lenBlock: [LocalLengthBlock],
      valueBlock: [LocalIntegerValueBlock]
    },
    signature: AlgorithmIdentifier { algorithmId: '1.2.840.10045.4.3.2' },
    issuer: RelativeDistinguishedNames {
      typesAndValues: [Array],
      valueBeforeDecode: [ArrayBuffer]
    },
    notBefore: Time { type: 0, value: 2019-05-18T01:32:57.000Z },
    notAfter: Time { type: 0, value: 2024-05-16T01:32:57.000Z },
    subject: RelativeDistinguishedNames {
      typesAndValues: [Array],
      valueBeforeDecode: [ArrayBuffer]
    },
    subjectPublicKeyInfo: PublicKeyInfo {
      algorithm: [AlgorithmIdentifier],
      subjectPublicKey: [BitString],
      parsedKey: [ECPublicKey]
    },
    signatureAlgorithm: AlgorithmIdentifier { algorithmId: '1.2.840.10045.4.3.2' },
    signatureValue: BitString {
      blockLength: 75,
      error: '',
      warnings: [],
      valueBeforeDecode: [ArrayBuffer],
      idBlock: [LocalIdentificationBlock],
      lenBlock: [LocalLengthBlock],
      valueBlock: [LocalBitStringValueBlock]
    },
    extensions: [
      [Extension],
      [Extension],
      [Extension],
      [Extension],
      [Extension],
      [Extension],
      [Extension],
      [Extension]
    ]
  },
  signerCertificateVerified: false
}

我有去PKIjs找尋別人類似問題,
https://github.com/PeculiarVentures/PKI.js/issues?q=No+valid+certificate+paths+found
但試了他們的之後還是有一樣的問題

另外
原本的import Crypto from 'node-webcrypto-ossl';此套件已經不再維護
我改為另一個import { Crypto } from '@peculiar/webcrypto'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.