Example usage for org.bouncycastle.asn1.x509 PolicyMappings getEncoded

List of usage examples for org.bouncycastle.asn1.x509 PolicyMappings getEncoded

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.x509 PolicyMappings getEncoded.

Prototype

public byte[] getEncoded(String encoding) throws IOException 

Source Link

Document

Return either the default for "BER" or a DER encoding if "DER" is specified.

Usage

From source file:net.sf.keystore_explorer.gui.dialogs.extensions.DPolicyMappings.java

License:Open Source License

private void okPressed() {
    PolicyMappings policyMappings = jpmPolicyMappings.getPolicyMappings();
    ASN1Sequence policyMappingsSeq = (ASN1Sequence) policyMappings.toASN1Primitive();

    if (policyMappingsSeq.size() == 0) {
        JOptionPane.showMessageDialog(this, res.getString("DPolicyMappings.ValueReq.message"), getTitle(),
                JOptionPane.WARNING_MESSAGE);
        return;//from w  w  w. j  a  v  a  2 s.c  o m
    }

    try {
        value = policyMappings.getEncoded(ASN1Encoding.DER);
    } catch (IOException ex) {
        DError dError = new DError(this, ex);
        dError.setLocationRelativeTo(this);
        dError.setVisible(true);
        return;
    }

    closeDialog();
}