Skip to content

Commit

Permalink
Export private key file chooser: *.p8 and *.p8e extensions (#449)
Browse files Browse the repository at this point in the history
The default extension for the private key is *.p8 or *.p8e for encrypted private key.

Signed-off-by: Sergey Ponomarev <[email protected]>
  • Loading branch information
stokito authored Oct 12, 2023
1 parent 8dd9210 commit e1b50b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions kse/src/org/kse/gui/FileChooserFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public class FileChooserFactory {
public static final String SPC_EXT = "spc";
public static final String CET_EXT = "cet";
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 PVK_EXT = "pvk";
public static final String OPENSSL_PVK_EXT = "key";
public static final String PUBLIC_KEY_EXT = "pub";
Expand Down Expand Up @@ -90,7 +92,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);
private static final String PKCS8_FILE_DESC = format(res.getString("FileChooserFactory.Pkcs8Files"), PKCS8_EXT, P8_EXT, P8E_EXT);

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

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

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})
FileChooserFactory.Pkcs8Files = PKCS #8 Private Key Files (*.{0};*.{1};*.{2})
FileChooserFactory.PkiPathFiles = PKI Path Certificate Files (*.{0})
FileChooserFactory.PublicKeyFiles = Public Key Files (*.{0})
FileChooserFactory.PvkFiles = PVK Private Key Files (*.{0})
Expand Down

0 comments on commit e1b50b9

Please sign in to comment.