Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export private key: change default extension to .p8 #450

Merged
merged 1 commit into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions kse/src/org/kse/gui/FileChooserFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public class FileChooserFactory {
public static final String PKCS8_EXT = "pkcs8";
public static final String P8_EXT = "p8";
public static final String P8E_EXT = "p8e";
public static final String PK8_EXT = "pk8";
public static final String PVK_EXT = "pvk";
public static final String OPENSSL_PVK_EXT = "key";
public static final String PUBLIC_KEY_EXT = "pub";
Expand Down Expand Up @@ -92,7 +93,7 @@ public class FileChooserFactory {
private static final String PKCS12_FILE_DESC =
format(res.getString("FileChooserFactory.Pkcs12Files"), PKCS12_KEYSTORE_EXT_1, PKCS12_KEYSTORE_EXT_2);

private static final String PKCS8_FILE_DESC = format(res.getString("FileChooserFactory.Pkcs8Files"), PKCS8_EXT, P8_EXT, P8E_EXT);
private static final String PKCS8_FILE_DESC = format(res.getString("FileChooserFactory.Pkcs8Files"), P8_EXT, P8E_EXT, PKCS8_EXT, PK8_EXT);

private static final String PVK_FILE_DESC = format(res.getString("FileChooserFactory.PvkFiles"), PVK_EXT);

Expand Down Expand Up @@ -270,7 +271,7 @@ public static JFileChooser getPkcs12FileChooser() {
*/
public static JFileChooser getPkcs8FileChooser() {
JFileChooser chooser = getFileChooser();
chooser.setFileFilter(new FileNameExtensionFilter(PKCS8_FILE_DESC, PKCS8_EXT, P8_EXT, P8E_EXT));
chooser.setFileFilter(new FileNameExtensionFilter(PKCS8_FILE_DESC, P8_EXT, P8E_EXT, PKCS8_EXT, PK8_EXT));
return chooser;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public void windowClosing(WindowEvent evt) {
private void populateExportFileName() {
File currentDirectory = CurrentDirectory.get();
String sanitizedAlias = FileNameUtil.cleanFileName(entryAlias);
File csrFile = new File(currentDirectory, sanitizedAlias + "." + FileChooserFactory.PKCS8_EXT);
File csrFile = new File(currentDirectory, sanitizedAlias + "." + FileChooserFactory.P8_EXT);
jtfExportFile.setText(csrFile.getPath());
}

Expand Down
2 changes: 1 addition & 1 deletion kse/src/org/kse/gui/resources.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ FileChooserFactory.PemFiles = PEM Files (*.{0})
FileChooserFactory.Pkcs10CsrFiles = PKCS #10 CSR Files (*.{0};*.{1})
FileChooserFactory.Pkcs12Files = PKCS #12 KeyStore Files (*.{0};*.{1})
FileChooserFactory.Pkcs7Files = PKCS #7 Certificates Files (*.{0};*.{1})
FileChooserFactory.Pkcs8Files = PKCS #8 Private Key Files (*.{0};*.{1};*.{2})
FileChooserFactory.Pkcs8Files = PKCS #8 Private Key Files (*.{0};*.{1};*.{2};*.{3})
FileChooserFactory.PkiPathFiles = PKI Path Certificate Files (*.{0})
FileChooserFactory.PublicKeyFiles = Public Key Files (*.{0})
FileChooserFactory.PvkFiles = PVK Private Key Files (*.{0})
Expand Down
2 changes: 1 addition & 1 deletion kse/src/org/kse/gui/resources_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ FileChooserFactory.PemFiles = PEM Dateien (*.{0})
FileChooserFactory.Pkcs10CsrFiles = PKCS #10 Zertifikatsignierungsanfragen (*.{0})
FileChooserFactory.Pkcs12Files = PKCS #12 Schl\u00FCsselspeicher (*.{0}; *.{1})
FileChooserFactory.Pkcs7Files = PKCS #7 Zertifikate (*.{0}; *.{1})
FileChooserFactory.Pkcs8Files = Private PKCS #8 Schl\u00FCssel (*.{0})
FileChooserFactory.Pkcs8Files = Private PKCS #8 Schl\u00FCssel (*.{0};*.{1};*.{2};*.{3})
FileChooserFactory.PkiPathFiles = PKI Pfad Zertifikate (*.{0})
FileChooserFactory.PublicKeyFiles = \u00D6ffentliche Schl\u00FCssel (*.{0})
FileChooserFactory.PvkFiles = Private PKV Schl\u00FCssel (*.{0})
Expand Down
2 changes: 1 addition & 1 deletion kse/src/org/kse/gui/resources_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ FileChooserFactory.PemFiles = Fichiers PEM (*.{0})
FileChooserFactory.Pkcs10CsrFiles = Demandes de signature de certificats PKCS\u00A0#10 (*.{0}, *.{1})
FileChooserFactory.Pkcs12Files = Magasins de certificats PKCS\u00A0#12 (*.{0};*.{1})
FileChooserFactory.Pkcs7Files = Certificats PKCS\u00A0#7 (*.{0}, *.{1})
FileChooserFactory.Pkcs8Files = Clefs priv\u00E9es PKCS\u00A0#8 (*.{0})
FileChooserFactory.Pkcs8Files = Clefs priv\u00E9es PKCS\u00A0#8 (*.{0};*.{1};*.{2};*.{3})
FileChooserFactory.PkiPathFiles = Cha\u00EEnes de confiance d\u2019infra \u00E0 clefs publiques (*.{0})
FileChooserFactory.PublicKeyFiles = Clefs publiques (*.{0})
FileChooserFactory.PvkFiles = Clefs priv\u00E9es PVK (*.{0})
Expand Down
Loading