use of org.kse.crypto.x509.InhibitAnyPolicy in project keystore-explorer by kaikramer.
the class DInhibitAnyPolicy method prepopulateWithValue.
private void prepopulateWithValue(byte[] value) throws IOException {
InhibitAnyPolicy inhibitAnyPolicy = InhibitAnyPolicy.getInstance(value);
jtfSkipCertificates.setText("" + inhibitAnyPolicy.getSkipCerts());
jtfSkipCertificates.setCaretPosition(0);
}
use of org.kse.crypto.x509.InhibitAnyPolicy in project keystore-explorer by kaikramer.
the class DInhibitAnyPolicy method okPressed.
private void okPressed() {
int skipCertificates = -1;
String skipCertificatesStr = jtfSkipCertificates.getText().trim();
if (skipCertificatesStr.length() == 0) {
JOptionPane.showMessageDialog(this, res.getString("DInhibitAnyPolicy.ValueReq.message"), getTitle(), JOptionPane.WARNING_MESSAGE);
return;
}
try {
skipCertificates = Integer.parseInt(skipCertificatesStr);
} catch (NumberFormatException ex) {
JOptionPane.showMessageDialog(this, res.getString("DInhibitAnyPolicy.InvalidLengthValue.message"), getTitle(), JOptionPane.WARNING_MESSAGE);
return;
}
if (skipCertificates < 0) {
JOptionPane.showMessageDialog(this, res.getString("DInhibitAnyPolicy.InvalidLengthValue.message"), getTitle(), JOptionPane.WARNING_MESSAGE);
return;
}
InhibitAnyPolicy inhibitAnyPolicy = new InhibitAnyPolicy(skipCertificates);
try {
value = inhibitAnyPolicy.getEncoded(ASN1Encoding.DER);
} catch (IOException ex) {
DError dError = new DError(this, ex);
dError.setLocationRelativeTo(this);
dError.setVisible(true);
return;
}
closeDialog();
}
Aggregations