Search in sources :

Example 31 with AccessDescription

use of com.github.zhenwei.core.asn1.x509.AccessDescription in project keystore-explorer by kaikramer.

the class DAuthorityInformationAccess method okPressed.

private void okPressed() {
    List<AccessDescription> accessDescriptions = jadAccessDescriptions.getAccessDescriptions();
    if (accessDescriptions.isEmpty()) {
        JOptionPane.showMessageDialog(this, res.getString("DAuthorityInformationAccess.ValueReq.message"), getTitle(), JOptionPane.WARNING_MESSAGE);
        return;
    }
    ASN1EncodableVector vec = new ASN1EncodableVector();
    for (AccessDescription accessDescription : accessDescriptions) {
        vec.add(accessDescription);
    }
    AuthorityInformationAccess authorityInformationAccess = AuthorityInformationAccess.getInstance(new DERSequence(vec));
    try {
        value = authorityInformationAccess.getEncoded(ASN1Encoding.DER);
    } catch (IOException e) {
        DError.displayError(this, e);
        return;
    }
    closeDialog();
}
Also used : AuthorityInformationAccess(org.bouncycastle.asn1.x509.AuthorityInformationAccess) DERSequence(org.bouncycastle.asn1.DERSequence) AccessDescription(org.bouncycastle.asn1.x509.AccessDescription) ASN1EncodableVector(org.bouncycastle.asn1.ASN1EncodableVector) IOException(java.io.IOException)

Example 32 with AccessDescription

use of com.github.zhenwei.core.asn1.x509.AccessDescription in project keystore-explorer by kaikramer.

the class AccessDescriptionsTableModel method load.

/**
 * Load the AccessDescriptionsTableModel with access descriptions.
 *
 * @param accessDescriptions The access descriptions
 */
public void load(List<AccessDescription> accessDescriptions) {
    AccessDescription[] accessDescriptionsArray = accessDescriptions.toArray(new AccessDescription[accessDescriptions.size()]);
    Arrays.sort(accessDescriptionsArray, new AccessDescriptionMethodComparator());
    data = new Object[accessDescriptionsArray.length][2];
    int i = 0;
    for (AccessDescription accessDescription : accessDescriptionsArray) {
        data[i][0] = accessDescription;
        data[i][1] = accessDescription;
        i++;
    }
    fireTableDataChanged();
}
Also used : AccessDescription(org.bouncycastle.asn1.x509.AccessDescription)

Example 33 with AccessDescription

use of com.github.zhenwei.core.asn1.x509.AccessDescription in project keystore-explorer by kaikramer.

the class DAccessDescriptionChooser method okPressed.

private void okPressed() {
    ASN1ObjectIdentifier accessMethod = joiAccessMethod.getObjectId();
    if (accessMethod == null) {
        JOptionPane.showMessageDialog(this, res.getString("DAccessDescriptionChooser.AccessMethodValueReq.message"), getTitle(), JOptionPane.WARNING_MESSAGE);
        return;
    }
    GeneralName accessLocation = jgnAccessLocation.getGeneralName();
    if (accessLocation == null) {
        JOptionPane.showMessageDialog(this, res.getString("DAccessDescriptionChooser.AccessLocationValueReq.message"), getTitle(), JOptionPane.WARNING_MESSAGE);
        return;
    }
    accessDescription = new AccessDescription(accessMethod, accessLocation);
    closeDialog();
}
Also used : AccessDescription(org.bouncycastle.asn1.x509.AccessDescription) JGeneralName(org.kse.gui.crypto.generalname.JGeneralName) GeneralName(org.bouncycastle.asn1.x509.GeneralName) ASN1ObjectIdentifier(org.bouncycastle.asn1.ASN1ObjectIdentifier)

Example 34 with AccessDescription

use of com.github.zhenwei.core.asn1.x509.AccessDescription in project keystore-explorer by kaikramer.

the class JAccessDescriptions method addPressed.

private void addPressed() {
    Container container = getTopLevelAncestor();
    DAccessDescriptionChooser dAccessDescriptionChooser = null;
    if (container instanceof JDialog) {
        dAccessDescriptionChooser = new DAccessDescriptionChooser((JDialog) container, title, null);
    } else {
        dAccessDescriptionChooser = new DAccessDescriptionChooser((JFrame) container, title, null);
    }
    dAccessDescriptionChooser.setLocationRelativeTo(container);
    dAccessDescriptionChooser.setVisible(true);
    AccessDescription newAccessDescription = dAccessDescriptionChooser.getAccessDescription();
    if (newAccessDescription == null) {
        return;
    }
    accessDescriptions.add(newAccessDescription);
    populate();
    selectAccessDescriptionInTable(newAccessDescription);
}
Also used : Container(java.awt.Container) JFrame(javax.swing.JFrame) AccessDescription(org.bouncycastle.asn1.x509.AccessDescription) JDialog(javax.swing.JDialog)

Example 35 with AccessDescription

use of com.github.zhenwei.core.asn1.x509.AccessDescription in project keystore-explorer by kaikramer.

the class JAccessDescriptions method removeSelectedAccessDescription.

private void removeSelectedAccessDescription() {
    int selectedRow = jtAccessDescriptions.getSelectedRow();
    if (selectedRow != -1) {
        AccessDescription accessDescription = (AccessDescription) jtAccessDescriptions.getValueAt(selectedRow, 0);
        accessDescriptions.remove(accessDescription);
        reloadAccessDescriptionsTable();
        selectFirstAccessDescriptionInTable();
        updateButtonControls();
    }
}
Also used : AccessDescription(org.bouncycastle.asn1.x509.AccessDescription) Point(java.awt.Point)

Aggregations

AccessDescription (org.bouncycastle.asn1.x509.AccessDescription)30 AuthorityInformationAccess (org.bouncycastle.asn1.x509.AuthorityInformationAccess)16 GeneralName (org.bouncycastle.asn1.x509.GeneralName)15 IOException (java.io.IOException)8 DERIA5String (org.bouncycastle.asn1.DERIA5String)8 ArrayList (java.util.ArrayList)7 DEROctetString (org.bouncycastle.asn1.DEROctetString)6 AccessDescription (sun.security.x509.AccessDescription)6 ASN1ObjectIdentifier (org.bouncycastle.asn1.ASN1ObjectIdentifier)5 ASN1Primitive (org.bouncycastle.asn1.ASN1Primitive)5 CRLDistPoint (org.bouncycastle.asn1.x509.CRLDistPoint)5 X509Certificate (java.security.cert.X509Certificate)4 ASN1OctetString (org.bouncycastle.asn1.ASN1OctetString)4 DistributionPoint (org.bouncycastle.asn1.x509.DistributionPoint)4 CertStore (java.security.cert.CertStore)3 CertStoreException (java.security.cert.CertStoreException)3 ASN1String (org.bouncycastle.asn1.ASN1String)3 DERSequence (org.bouncycastle.asn1.DERSequence)3 AccessDescription (com.github.zhenwei.core.asn1.x509.AccessDescription)2 GeneralName (com.github.zhenwei.core.asn1.x509.GeneralName)2