Search in sources :

Example 31 with AccessDescription

use of sun.security.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);
        dAccessDescriptionChooser.setLocationRelativeTo(container);
        dAccessDescriptionChooser.setVisible(true);
    } else if (container instanceof JFrame) {
        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 32 with AccessDescription

use of sun.security.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 sun.security.x509.AccessDescription in project keystore-explorer by kaikramer.

the class DAuthorityInformationAccess method okPressed.

private void okPressed() {
    List<AccessDescription> accessDescriptions = jadAccessDescriptions.getAccessDescriptions();
    if (accessDescriptions.size() == 0) {
        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 ex) {
        DError dError = new DError(this, ex);
        dError.setLocationRelativeTo(this);
        dError.setVisible(true);
        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) DError(org.kse.gui.error.DError)

Example 34 with AccessDescription

use of sun.security.x509.AccessDescription in project keystore-explorer by kaikramer.

the class DSubjectInformationAccess method okPressed.

private void okPressed() {
    List<AccessDescription> accessDescriptions = jadAccessDescriptions.getAccessDescriptions();
    if (accessDescriptions.size() == 0) {
        JOptionPane.showMessageDialog(this, res.getString("DSubjectInformationAccess.ValueReq.message"), getTitle(), JOptionPane.WARNING_MESSAGE);
        return;
    }
    SubjectInfoAccess subjectInformationAccess = new SubjectInfoAccess(accessDescriptions);
    try {
        value = subjectInformationAccess.getEncoded(ASN1Encoding.DER);
    } catch (IOException ex) {
        DError dError = new DError(this, ex);
        dError.setLocationRelativeTo(this);
        dError.setVisible(true);
        return;
    }
    closeDialog();
}
Also used : AccessDescription(org.bouncycastle.asn1.x509.AccessDescription) SubjectInfoAccess(org.kse.crypto.x509.SubjectInfoAccess) IOException(java.io.IOException) DError(org.kse.gui.error.DError)

Aggregations

AccessDescription (org.bouncycastle.asn1.x509.AccessDescription)24 GeneralName (org.bouncycastle.asn1.x509.GeneralName)13 AuthorityInformationAccess (org.bouncycastle.asn1.x509.AuthorityInformationAccess)9 IOException (java.io.IOException)8 CertStoreException (java.security.cert.CertStoreException)7 ArrayList (java.util.ArrayList)6 ASN1ObjectIdentifier (org.bouncycastle.asn1.ASN1ObjectIdentifier)6 AccessDescription (sun.security.x509.AccessDescription)6 URIName (sun.security.x509.URIName)6 DERIA5String (org.bouncycastle.asn1.DERIA5String)5 CRLDistPoint (org.bouncycastle.asn1.x509.CRLDistPoint)5 URI (java.net.URI)4 CertificateException (java.security.cert.CertificateException)4 X509Certificate (java.security.cert.X509Certificate)4 ASN1OctetString (org.bouncycastle.asn1.ASN1OctetString)4 DirectoryString (org.bouncycastle.asn1.x500.DirectoryString)4 DistributionPoint (org.bouncycastle.asn1.x509.DistributionPoint)4 InvalidAlgorithmParameterException (java.security.InvalidAlgorithmParameterException)3 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)3 CRLException (java.security.cert.CRLException)3