Search in sources :

Example 6 with NetscapeCertType

use of org.gudy.bouncycastle.asn1.misc.NetscapeCertType in project keystore-explorer by kaikramer.

the class DNetscapeCertificateType method okPressed.

private void okPressed() {
    if (!jcbSslClient.isSelected() && !jcbSslServer.isSelected() && !jcbSmime.isSelected() && !jcbObjectSigning.isSelected() && !jcbReserved.isSelected() && !jcbSslCa.isSelected() && !jcbSmimeCa.isSelected() && !jcbObjectSigningCa.isSelected()) {
        JOptionPane.showMessageDialog(this, res.getString("DNetscapeCertificateType.ValueReq.message"), getTitle(), JOptionPane.WARNING_MESSAGE);
        return;
    }
    int netscapeCertTypeIntValue = 0;
    netscapeCertTypeIntValue |= jcbSslClient.isSelected() ? NetscapeCertType.sslClient : 0;
    netscapeCertTypeIntValue |= jcbSslServer.isSelected() ? NetscapeCertType.sslServer : 0;
    netscapeCertTypeIntValue |= jcbSmime.isSelected() ? NetscapeCertType.smime : 0;
    netscapeCertTypeIntValue |= jcbObjectSigning.isSelected() ? NetscapeCertType.objectSigning : 0;
    netscapeCertTypeIntValue |= jcbReserved.isSelected() ? NetscapeCertType.reserved : 0;
    netscapeCertTypeIntValue |= jcbSslCa.isSelected() ? NetscapeCertType.sslCA : 0;
    netscapeCertTypeIntValue |= jcbSmimeCa.isSelected() ? NetscapeCertType.smimeCA : 0;
    netscapeCertTypeIntValue |= jcbObjectSigningCa.isSelected() ? NetscapeCertType.objectSigningCA : 0;
    NetscapeCertType netscapeCertType = new NetscapeCertType(netscapeCertTypeIntValue);
    try {
        value = netscapeCertType.getEncoded(ASN1Encoding.DER);
    } catch (IOException ex) {
        DError dError = new DError(this, ex);
        dError.setLocationRelativeTo(this);
        dError.setVisible(true);
        return;
    }
    closeDialog();
}
Also used : NetscapeCertType(org.bouncycastle.asn1.misc.NetscapeCertType) IOException(java.io.IOException) DError(org.kse.gui.error.DError)

Aggregations

IOException (java.io.IOException)6 NetscapeCertType (org.bouncycastle.asn1.misc.NetscapeCertType)5 InvalidKeyException (java.security.InvalidKeyException)3 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)3 NoSuchProviderException (java.security.NoSuchProviderException)3 SignatureException (java.security.SignatureException)3 CertificateEncodingException (java.security.cert.CertificateEncodingException)3 CertificateException (java.security.cert.CertificateException)3 CertificateExpiredException (java.security.cert.CertificateExpiredException)3 CertificateNotYetValidException (java.security.cert.CertificateNotYetValidException)3 CertificateParsingException (java.security.cert.CertificateParsingException)3 Enumeration (java.util.Enumeration)3 ASN1InputStream (org.bouncycastle.asn1.ASN1InputStream)3 DERBitString (org.bouncycastle.asn1.DERBitString)3 DERIA5String (org.bouncycastle.asn1.DERIA5String)3 DEROctetString (org.bouncycastle.asn1.DEROctetString)3 NetscapeRevocationURL (org.bouncycastle.asn1.misc.NetscapeRevocationURL)3 VerisignCzagExtension (org.bouncycastle.asn1.misc.VerisignCzagExtension)3 UnknownHostException (java.net.UnknownHostException)2 ASN1ObjectIdentifier (org.bouncycastle.asn1.ASN1ObjectIdentifier)2