use of com.github.zhenwei.core.asn1.x509.PolicyInformation in project keystore-explorer by kaikramer.
the class DCertificatePolicies method prepopulateWithValue.
private void prepopulateWithValue(byte[] value) throws IOException {
CertificatePolicies certificatePolicies = CertificatePolicies.getInstance(value);
List<PolicyInformation> accessDescriptionList = new ArrayList<>(Arrays.asList(certificatePolicies.getPolicyInformation()));
jpiCertificatePolicies.setPolicyInformation(accessDescriptionList);
}
use of com.github.zhenwei.core.asn1.x509.PolicyInformation in project keystore-explorer by kaikramer.
the class DCertificatePolicies method okPressed.
private void okPressed() {
List<PolicyInformation> policyInformation = jpiCertificatePolicies.getPolicyInformation();
if (policyInformation.isEmpty()) {
JOptionPane.showMessageDialog(this, res.getString("DCertificatePolicies.ValueReq.message"), getTitle(), JOptionPane.WARNING_MESSAGE);
return;
}
CertificatePolicies certificatePolicies = new CertificatePolicies(policyInformation.toArray(new PolicyInformation[policyInformation.size()]));
try {
value = certificatePolicies.getEncoded(ASN1Encoding.DER);
} catch (IOException e) {
DError.displayError(this, e);
return;
}
closeDialog();
}
use of com.github.zhenwei.core.asn1.x509.PolicyInformation in project keystore-explorer by kaikramer.
the class JPolicyInformation method removeSelectedPolicyInformation.
private void removeSelectedPolicyInformation() {
int selectedRow = jtPolicyInformation.getSelectedRow();
if (selectedRow != -1) {
PolicyInformation policyInfo = (PolicyInformation) jtPolicyInformation.getValueAt(selectedRow, 0);
policyInformation.remove(policyInfo);
reloadPolicyInformationTable();
selectFirstPolicyInformationInTable();
updateButtonControls();
}
}
use of com.github.zhenwei.core.asn1.x509.PolicyInformation in project keystore-explorer by kaikramer.
the class PolicyInformationTableModel method load.
/**
* Load the PolicyInformationTableModel with policy information.
*
* @param policyInformation The policy information
*/
public void load(List<PolicyInformation> policyInformation) {
PolicyInformation[] policyInformationArray = policyInformation.toArray(new PolicyInformation[policyInformation.size()]);
Arrays.sort(policyInformationArray, new PolicyInformationComparator());
data = new Object[policyInformation.size()][1];
int i = 0;
for (PolicyInformation policyInfo : policyInformationArray) {
data[i][0] = policyInfo;
i++;
}
fireTableDataChanged();
}
use of com.github.zhenwei.core.asn1.x509.PolicyInformation in project keystore-explorer by kaikramer.
the class DPolicyInformationChooser method okPressed.
private void okPressed() {
ASN1ObjectIdentifier policyIdentifer = joiPolicyIdentifier.getObjectId();
if (policyIdentifer == null) {
JOptionPane.showMessageDialog(this, res.getString("DPolicyInformationChooser.PolicyIdentifierValueReq.message"), getTitle(), JOptionPane.WARNING_MESSAGE);
return;
}
List<PolicyQualifierInfo> policyQualifierInfo = jpqPolicyQualifiers.getPolicyQualifierInfo();
if (!policyQualifierInfo.isEmpty()) {
ASN1EncodableVector policyQualifiersVec = new ASN1EncodableVector();
for (PolicyQualifierInfo policyQualInfo : policyQualifierInfo) {
try {
policyQualifiersVec.add(policyQualInfo);
} catch (Exception e) {
DError.displayError(this, e);
return;
}
}
DERSequence policyQualifiersSeq = new DERSequence(policyQualifiersVec);
policyInformation = new PolicyInformation(policyIdentifer, policyQualifiersSeq);
} else {
policyInformation = new PolicyInformation(policyIdentifer);
}
closeDialog();
}
Aggregations