Search in sources :

Example 1 with InhibitAnyPolicy

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);
}
Also used : InhibitAnyPolicy(org.kse.crypto.x509.InhibitAnyPolicy)

Example 2 with InhibitAnyPolicy

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();
}
Also used : InhibitAnyPolicy(org.kse.crypto.x509.InhibitAnyPolicy) IOException(java.io.IOException) DError(org.kse.gui.error.DError)

Aggregations

InhibitAnyPolicy (org.kse.crypto.x509.InhibitAnyPolicy)2 IOException (java.io.IOException)1 DError (org.kse.gui.error.DError)1