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();
}
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();
}
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();
}
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);
}
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();
}
}
Aggregations