use of org.kse.crypto.x509.PolicyMapping in project keystore-explorer by kaikramer.
the class DPolicyMappingChooser method okPressed.
private void okPressed() {
ASN1ObjectIdentifier issuerDomainPolicy = joiIssuerDomainPolicy.getObjectId();
if (issuerDomainPolicy == null) {
JOptionPane.showMessageDialog(this, res.getString("DPolicyMappingChooser.IssuerDomainPolicyValueReq.message"), getTitle(), JOptionPane.WARNING_MESSAGE);
return;
}
ASN1ObjectIdentifier subjectDomainPolicy = joiSubjectDomainPolicy.getObjectId();
if (subjectDomainPolicy == null) {
JOptionPane.showMessageDialog(this, res.getString("DPolicyMappingChooser.SubjectDomainPolicyValueReq.message"), getTitle(), JOptionPane.WARNING_MESSAGE);
return;
}
policyMapping = new PolicyMapping(issuerDomainPolicy, subjectDomainPolicy);
closeDialog();
}
use of org.kse.crypto.x509.PolicyMapping in project keystore-explorer by kaikramer.
the class JPolicyMappings method removeSelectedPolicyMapping.
private void removeSelectedPolicyMapping() {
int selectedRow = jtPolicyMappings.getSelectedRow();
if (selectedRow != -1) {
PolicyMapping policyMapping = (PolicyMapping) jtPolicyMappings.getValueAt(selectedRow, 0);
policyMappings = PolicyMappingsUtil.remove(policyMapping, policyMappings);
reloadPolicyMappingsTable();
selectFirstPolicyMappingInTable();
updateButtonControls();
}
}
use of org.kse.crypto.x509.PolicyMapping in project keystore-explorer by kaikramer.
the class PolicyMappingsTableModel method load.
/**
* Load the PolicyMappingsTableModel with policy mappings.
*
* @param policyMappings
* The policy mappings
*/
public void load(PolicyMappings policyMappings) {
ASN1Sequence policyMappingsSeq = (ASN1Sequence) policyMappings.toASN1Primitive();
// convert and sort
ASN1Encodable[] asn1EncArray = policyMappingsSeq.toArray();
PolicyMapping[] policyMappingsArray = new PolicyMapping[asn1EncArray.length];
for (int i = 0; i < asn1EncArray.length; i++) {
policyMappingsArray[i] = PolicyMapping.getInstance(asn1EncArray[i]);
}
Arrays.sort(policyMappingsArray, new IssuerDomainPolicyComparator());
data = new Object[policyMappingsArray.length][2];
int i = 0;
for (PolicyMapping policyMapping : policyMappingsArray) {
data[i][0] = policyMapping;
data[i][1] = policyMapping;
i++;
}
fireTableDataChanged();
}
use of org.kse.crypto.x509.PolicyMapping in project keystore-explorer by kaikramer.
the class JPolicyMappings method addPressed.
private void addPressed() {
Container container = getTopLevelAncestor();
DPolicyMappingChooser dPolicyMappingChooser = null;
if (container instanceof JDialog) {
dPolicyMappingChooser = new DPolicyMappingChooser((JDialog) container, title, null);
dPolicyMappingChooser.setLocationRelativeTo(container);
dPolicyMappingChooser.setVisible(true);
} else if (container instanceof JFrame) {
dPolicyMappingChooser = new DPolicyMappingChooser((JFrame) container, title, null);
dPolicyMappingChooser.setLocationRelativeTo(container);
dPolicyMappingChooser.setVisible(true);
}
PolicyMapping newPolicyMapping = dPolicyMappingChooser.getPolicyMapping();
if (newPolicyMapping == null) {
return;
}
policyMappings = PolicyMappingsUtil.add(newPolicyMapping, policyMappings);
populate();
selectPolicyMappingInTable(newPolicyMapping);
}
use of org.kse.crypto.x509.PolicyMapping in project keystore-explorer by kaikramer.
the class JPolicyMappings method editSelectedPolicyMapping.
private void editSelectedPolicyMapping() {
int selectedRow = jtPolicyMappings.getSelectedRow();
if (selectedRow != -1) {
PolicyMapping policyMapping = (PolicyMapping) jtPolicyMappings.getValueAt(selectedRow, 0);
Container container = getTopLevelAncestor();
DPolicyMappingChooser dPolicyMappingChooser = null;
if (container instanceof JDialog) {
dPolicyMappingChooser = new DPolicyMappingChooser((JDialog) container, title, policyMapping);
dPolicyMappingChooser.setLocationRelativeTo(container);
dPolicyMappingChooser.setVisible(true);
} else if (container instanceof JFrame) {
dPolicyMappingChooser = new DPolicyMappingChooser((JFrame) container, title, policyMapping);
dPolicyMappingChooser.setLocationRelativeTo(container);
dPolicyMappingChooser.setVisible(true);
}
PolicyMapping newPolicyMapping = dPolicyMappingChooser.getPolicyMapping();
if (newPolicyMapping == null) {
return;
}
policyMappings = PolicyMappingsUtil.remove(policyMapping, policyMappings);
policyMappings = PolicyMappingsUtil.add(newPolicyMapping, policyMappings);
populate();
selectPolicyMappingInTable(newPolicyMapping);
}
}
Aggregations