Search in sources :

Example 76 with CryptoException

use of org.kse.crypto.CryptoException in project keystore-explorer by kaikramer.

the class DProperties method createTrustedCertificateNodes.

private void createTrustedCertificateNodes(DefaultMutableTreeNode parentNode, String alias) throws CryptoException {
    try {
        KeyStore keyStore = currentState.getKeyStore();
        DefaultMutableTreeNode trustedCertificateNode = new DefaultMutableTreeNode(alias);
        parentNode.add(trustedCertificateNode);
        createLastModifiedNode(trustedCertificateNode, alias);
        X509Certificate trustedCertificate = X509CertUtil.convertCertificate(keyStore.getCertificate(alias));
        populateCertificateNode(trustedCertificateNode, trustedCertificate);
    } catch (KeyStoreException ex) {
        throw new CryptoException(res.getString("DProperties.NoGetProperties.exception.message"), ex);
    }
}
Also used : DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) KeyStoreException(java.security.KeyStoreException) CryptoException(org.kse.crypto.CryptoException) KeyStore(java.security.KeyStore) X509Certificate(java.security.cert.X509Certificate)

Example 77 with CryptoException

use of org.kse.crypto.CryptoException in project keystore-explorer by kaikramer.

the class DViewCertificate method pemEncodingPressed.

private void pemEncodingPressed() {
    X509Certificate cert = getSelectedCertificate();
    try {
        DViewPem dViewCertPem = new DViewPem(this, res.getString("DViewCertificate.Pem.Title"), cert);
        dViewCertPem.setLocationRelativeTo(this);
        dViewCertPem.setVisible(true);
    } catch (CryptoException ex) {
        DError dError = new DError(this, ex);
        dError.setLocationRelativeTo(this);
        dError.setVisible(true);
    }
}
Also used : CryptoException(org.kse.crypto.CryptoException) X509Certificate(java.security.cert.X509Certificate) DError(org.kse.gui.error.DError)

Example 78 with CryptoException

use of org.kse.crypto.CryptoException in project keystore-explorer by kaikramer.

the class DViewCertificate method pubKeyDetailsPressed.

private void pubKeyDetailsPressed() {
    try {
        X509Certificate cert = getSelectedCertificate();
        DViewPublicKey dViewPublicKey = new DViewPublicKey(this, res.getString("DViewCertificate.PubKeyDetails.Title"), cert.getPublicKey());
        dViewPublicKey.setLocationRelativeTo(this);
        dViewPublicKey.setVisible(true);
    } catch (CryptoException ex) {
        DError dError = new DError(this, ex);
        dError.setLocationRelativeTo(this);
        dError.setVisible(true);
    }
}
Also used : CryptoException(org.kse.crypto.CryptoException) X509Certificate(java.security.cert.X509Certificate) DError(org.kse.gui.error.DError)

Example 79 with CryptoException

use of org.kse.crypto.CryptoException in project keystore-explorer by kaikramer.

the class DViewCsr method pemEncodingPressed.

private void pemEncodingPressed() {
    try {
        DViewPem dViewCsrPem = new DViewPem(this, res.getString("DViewCsr.Pem.Title"), pkcs10Csr);
        dViewCsrPem.setLocationRelativeTo(this);
        dViewCsrPem.setVisible(true);
    } catch (CryptoException ex) {
        DError dError = new DError(this, ex);
        dError.setLocationRelativeTo(this);
        dError.setVisible(true);
    }
}
Also used : CryptoException(org.kse.crypto.CryptoException) DError(org.kse.gui.error.DError)

Example 80 with CryptoException

use of org.kse.crypto.CryptoException in project keystore-explorer by kaikramer.

the class DViewPublicKey method pemEncodingPressed.

private void pemEncodingPressed() {
    try {
        DViewPem dViewCsrPem = new DViewPem(this, res.getString("DViewPublicKey.Pem.Title"), publicKey);
        dViewCsrPem.setLocationRelativeTo(this);
        dViewCsrPem.setVisible(true);
    } catch (CryptoException ex) {
        DError dError = new DError(this, ex);
        dError.setLocationRelativeTo(this);
        dError.setVisible(true);
    }
}
Also used : CryptoException(org.kse.crypto.CryptoException) DError(org.kse.gui.error.DError)

Aggregations

CryptoException (org.kse.crypto.CryptoException)80 GeneralSecurityException (java.security.GeneralSecurityException)22 IOException (java.io.IOException)21 X509Certificate (java.security.cert.X509Certificate)21 KeyStore (java.security.KeyStore)16 KeyStoreException (java.security.KeyStoreException)13 BigInteger (java.math.BigInteger)11 DError (org.kse.gui.error.DError)10 ByteArrayInputStream (java.io.ByteArrayInputStream)9 File (java.io.File)9 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)9 ByteBuffer (java.nio.ByteBuffer)8 CertificateException (java.security.cert.CertificateException)8 PrivateKey (java.security.PrivateKey)7 KeyFactory (java.security.KeyFactory)6 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)6 CertificateFactory (java.security.cert.CertificateFactory)6 DSAPrivateKey (java.security.interfaces.DSAPrivateKey)6 RSAPrivateCrtKey (java.security.interfaces.RSAPrivateCrtKey)6 Cipher (javax.crypto.Cipher)6