Issue 21 fix#27
Open
andreihaiducu wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace
jsrsasignwithpkijs+asn1js+ Web Crypto APIWhy
jsrsasignis end-of-life (no maintenance / security fixes since April 2026). Migrate theweb-uito a maintained PKI stack built on the browser's native Web Crypto API.What changed
web-ui/package.json): removedjsrsasign; addedpkijs,asn1js,pvutils.web-ui/src/utils/pkiHelpers.js: centralizes PEM ↔ DER conversion, OID → friendly-name maps, RDN/DN rendering, SAN and KeyUsage decoding, fingerprint hashing, and Web Crypto key import (PKCS#8, PKCS#1 RSA, SEC1 EC).web-ui/src/utils/certificateUtils.js:parseCertificateandparseCertificateChainFromPemare nowasync;base64ToPem/base64ToPrivateKeyPemare now idempotent (won't re-wrap input that is already PEM).web-ui/src/utils/verificationUtils.js:validateCertificateChainusespkijsCertificate.verify(issuer)plus subject/issuer matching;validatePrivateKeyis a Web Crypto sign + verify round-trip against the certificate's public key;getFingerprintandverifyCertificateareasync.awaitthe new async helpers:CertificateDetailsDialog.jsx,ImportCertificateChainDialogContent.jsx,useCertificateImport.js.web-ui/specs.mddocumenting the migration, the lenient PEM contract, the async API, and the DSA decision.Behavioral changes worth calling out
pemToDerstrips every-----BEGIN/END …-----marker line, and thebase64ToPemhelpers no longer re-wrap input that already contains-----BEGIN. This was needed because the backend returns full PEM strings, andjsrsasignsilently tolerated double-wrapped input while the strictpkijsparser did not — without this, the Certificate Details dialog reported "Invalid certificate. Make sure the file is a .pem." for valid backend certificates.async; consumers mustawait.Test plan
npm run buildsucceeds;npm run lintshows no new errors introduced by this change.jsrsasign-based build.