Skip to content
Snippets Groups Projects
signingUtilities.js 33.2 KiB
Newer Older
  • Learn to ignore specific revisions
  •     const certificates = parseCertificates(signatureBase64);
    
        // Add first certificate in the chain
        certificateChain.push(certificates[0]);
    
        // Go through all certificates to build a chain from first certificate to the root
        certificates.forEach(certificate => {
          if (certificateChain[0].issuer.commonName === certificate.subject.commonName) {
            certificateChain.unshift(certificate);
          }
        });
      } catch (e) {
        console.warn("Error getting certificate data", e);
      }
    
      return certificateChain;
    };