Skip to content

Commit

Permalink
Fix certificate import (#217)
Browse files Browse the repository at this point in the history
* Fix import algorithm

* Fix CertificateImportDialog

* Change version

* Fix mimes

---------

Co-authored-by: alex-slobodian <[email protected]>
  • Loading branch information
OleksandrSPV and aleksandr-slobodian authored Oct 30, 2024
1 parent 695e317 commit 31218b0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@peculiar/fortify-tools",
"homepage": "https://tools.fortifyapp.com",
"version": "2.0.5",
"version": "2.0.6",
"author": "PeculiarVentures Team",
"license": "MIT",
"private": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@

.text_area textarea {
height: 340px;
font-family: monospace;
}

.buttons_group {
Expand Down
2 changes: 1 addition & 1 deletion src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const APP_FORTIFY_DOWLOAD_APP_URL = "https://fortifyapp.com";
// https://www.iana.org/assignments/media-types/media-types.xhtml
export const APP_CERTIFICATE_ALLOWED_MIMES = {
"application/pem-certificate-chain": [".pem"],
"application/pkix-cert": [".cer"],
"application/pkix-cert": [".cer", ".der"],
"application/x-x509-ca-cert": [".crt"],
"application/pkcs10": [".csr"],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ export function useCertificateImportDialog(
const cert = await provider.certStorage.importCert(
certificateType.current === "csr" ? "request" : "x509",
certificate.current.rawData,
certificate.current.signatureAlgorithm,
{
...certificate.current.publicKey.algorithm,
...certificate.current.signatureAlgorithm,
},
["verify"]
);

Expand Down
2 changes: 1 addition & 1 deletion src/i18n/locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"invalid-data": "Certificate is invalid. Please check your data and try again."
}
},
"divider-label": "Or paste certificate in Base64 format below",
"divider-label": "Or paste certificate in PEM format below",
"loading-text": "Importing certificate...",
"success-message": "Certificate imported.",
"failure-message": "Failed to import certificate because of error. Please try again."
Expand Down

0 comments on commit 31218b0

Please sign in to comment.