use of org.kse.crypto.CryptoException in project keystore-explorer by kaikramer.
the class ExportKeyPairCertificateChainAction method getCertificateChain.
private X509Certificate[] getCertificateChain(String alias) throws CryptoException {
try {
KeyStoreHistory history = kseFrame.getActiveKeyStoreHistory();
KeyStore keyStore = history.getCurrentState().getKeyStore();
X509Certificate[] certChain = X509CertUtil.convertCertificates(keyStore.getCertificateChain(alias));
return certChain;
} catch (KeyStoreException ex) {
String message = MessageFormat.format(res.getString("ExportKeyPairCertificateChainAction.NoAccessEntry.message"), alias);
throw new CryptoException(message, ex);
}
}
use of org.kse.crypto.CryptoException in project keystore-explorer by kaikramer.
the class DImportKeyPairOpenSsl method privateKeyDetailsPressed.
private void privateKeyDetailsPressed() {
try {
String path = new File(jtfPrivateKeyPath.getText()).getName();
PrivateKey privateKey = loadPrivateKey();
if (privateKey != null) {
DViewPrivateKey dViewPrivateKey = new DViewPrivateKey(this, MessageFormat.format(res.getString("DImportKeyPairOpenSsl.ViewPrivateKeyDetails.Title"), path), privateKey, new BouncyCastleProvider());
dViewPrivateKey.setLocationRelativeTo(this);
dViewPrivateKey.setVisible(true);
}
} catch (CryptoException ex) {
DError.displayError(this, ex);
}
}
use of org.kse.crypto.CryptoException in project keystore-explorer by kaikramer.
the class DImportKeyPairOpenSsl method certificateDetailsPressed.
private void certificateDetailsPressed() {
try {
X509Certificate[] certs = loadCertificates();
if ((certs != null) && (certs.length != 0)) {
String path = new File(jtfCertificatePath.getText()).getName();
DViewCertificate dViewCertificate = new DViewCertificate(this, MessageFormat.format(res.getString("DImportKeyPairOpenSsl.ViewCertificateDetails.Title"), path), certs, null, DViewCertificate.NONE);
dViewCertificate.setLocationRelativeTo(this);
dViewCertificate.setVisible(true);
}
} catch (CryptoException ex) {
DError.displayError(this, ex);
}
}
use of org.kse.crypto.CryptoException in project keystore-explorer by kaikramer.
the class DImportKeyPairPkcs8 method privateKeyDetailsPressed.
private void privateKeyDetailsPressed() {
try {
String path = new File(jtfPrivateKeyPath.getText()).getName();
PrivateKey privateKey = loadPrivateKey();
if (privateKey != null) {
DViewPrivateKey dViewPrivateKey = new DViewPrivateKey(this, MessageFormat.format(res.getString("DImportKeyPairPkcs8.ViewPrivateKeyDetails.Title"), path), privateKey, new BouncyCastleProvider());
dViewPrivateKey.setLocationRelativeTo(this);
dViewPrivateKey.setVisible(true);
}
} catch (CryptoException ex) {
DError.displayError(this, ex);
}
}
use of org.kse.crypto.CryptoException in project keystore-explorer by kaikramer.
the class DImportKeyPairPvk method certificateDetailsPressed.
private void certificateDetailsPressed() {
try {
X509Certificate[] certs = loadCertificates();
if ((certs != null) && (certs.length != 0)) {
String path = new File(jtfCertificatePath.getText()).getName();
DViewCertificate dViewCertificate = new DViewCertificate(this, MessageFormat.format(res.getString("DImportKeyPairPvk.ViewCertificateDetails.Title"), path), certs, null, DViewCertificate.NONE);
dViewCertificate.setLocationRelativeTo(this);
dViewCertificate.setVisible(true);
}
} catch (CryptoException ex) {
DError.displayError(this, ex);
}
}
Aggregations