use of org.bouncycastle.asn1.x509.PolicyQualifierInfo in project keystore-explorer by kaikramer.
the class DPolicyInformationChooser method populate.
private void populate(PolicyInformation policyInformation) throws IOException {
if (policyInformation != null) {
joiPolicyIdentifier.setObjectId(policyInformation.getPolicyIdentifier());
ASN1Sequence policyQualifierInfoSeq = policyInformation.getPolicyQualifiers();
if (policyQualifierInfoSeq != null) {
List<PolicyQualifierInfo> policyQualifierInfo = new ArrayList<PolicyQualifierInfo>();
for (int i = 0; i < policyQualifierInfoSeq.size(); i++) {
PolicyQualifierInfo policyQualInfo = PolicyQualifierInfo.getInstance(policyQualifierInfoSeq.getObjectAt(i));
policyQualifierInfo.add(policyQualInfo);
}
jpqPolicyQualifiers.setPolicyQualifierInfo(policyQualifierInfo);
}
}
}
use of org.bouncycastle.asn1.x509.PolicyQualifierInfo in project keystore-explorer by kaikramer.
the class DPolicyQualifierInfoChooser method okPressed.
private void okPressed() {
PolicyQualifierInfo newPolicyQualifierInfo = null;
try {
if (jrbCps.isSelected()) {
String cps = jtfCps.getText().trim();
if (cps.length() == 0) {
JOptionPane.showMessageDialog(this, res.getString("DPolicyQualifierInfoChooser.CpsValueReq.message"), getTitle(), JOptionPane.WARNING_MESSAGE);
return;
}
newPolicyQualifierInfo = new PolicyQualifierInfo(new ASN1ObjectIdentifier(PKIX_CPS_POINTER_QUALIFIER.oid()), (new DERIA5String(cps)).toASN1Primitive());
} else {
UserNotice userNotice = junUserNotice.getUserNotice();
if (userNotice == null) {
JOptionPane.showMessageDialog(this, res.getString("DPolicyQualifierInfoChooser.UserNoticeValueReq.message"), getTitle(), JOptionPane.WARNING_MESSAGE);
return;
}
newPolicyQualifierInfo = new PolicyQualifierInfo(new ASN1ObjectIdentifier(PKIX_USER_NOTICE_QUALIFIER.oid()), userNotice);
}
} catch (Exception ex) {
DError dError = new DError(this, ex);
dError.setLocationRelativeTo(this);
dError.setVisible(true);
return;
}
policyQualifierInfo = newPolicyQualifierInfo;
closeDialog();
}
use of org.bouncycastle.asn1.x509.PolicyQualifierInfo in project keystore-explorer by kaikramer.
the class JPolicyQualifierInfo method addPressed.
private void addPressed() {
Container container = getTopLevelAncestor();
try {
DPolicyQualifierInfoChooser dPolicyQualifierInfoChooser = null;
if (container instanceof JDialog) {
dPolicyQualifierInfoChooser = new DPolicyQualifierInfoChooser((JDialog) container, title, null);
dPolicyQualifierInfoChooser.setLocationRelativeTo(container);
dPolicyQualifierInfoChooser.setVisible(true);
} else if (container instanceof JFrame) {
dPolicyQualifierInfoChooser = new DPolicyQualifierInfoChooser((JFrame) container, title, null);
dPolicyQualifierInfoChooser.setLocationRelativeTo(container);
dPolicyQualifierInfoChooser.setVisible(true);
}
PolicyQualifierInfo newPolicyQualifierInfo = dPolicyQualifierInfoChooser.getPolicyQualifierInfo();
if (newPolicyQualifierInfo == null) {
return;
}
policyQualifierInfo.add(newPolicyQualifierInfo);
populate();
selectPolicyQualifierInfoInTable(newPolicyQualifierInfo);
} catch (IOException ex) {
DError dError = null;
if (container instanceof JDialog) {
dError = new DError((JDialog) container, ex);
} else {
dError = new DError((JFrame) container, ex);
}
dError.setLocationRelativeTo(container);
dError.setVisible(true);
}
}
use of org.bouncycastle.asn1.x509.PolicyQualifierInfo in project keystore-explorer by kaikramer.
the class PolicyQualifierInfoTableModel method load.
/**
* Load the PolicyQualifierInfoTableModel with policy qualifier info.
*
* @param policyQualifierInfo
* The policy qualifier info
*/
public void load(List<PolicyQualifierInfo> policyQualifierInfo) {
PolicyQualifierInfo[] policyQualifierInfoArray = policyQualifierInfo.toArray(new PolicyQualifierInfo[policyQualifierInfo.size()]);
Arrays.sort(policyQualifierInfoArray, new PolicyQualifierInfoComparator());
data = new Object[policyQualifierInfoArray.length][1];
int i = 0;
for (PolicyQualifierInfo policyQualInfo : policyQualifierInfoArray) {
data[i][0] = policyQualInfo;
i++;
}
fireTableDataChanged();
}
Aggregations