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

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

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.x509 GeneralNames 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.DIssuerAlternativeName.java

License:Open Source License

private void okPressed() {
    GeneralNames issuerAlternativeName = jgnAlternativeName.getGeneralNames();

    if (issuerAlternativeName.getNames().length == 0) {
        JOptionPane.showMessageDialog(this, res.getString("DIssuerAlternativeName.ValueReq.message"),
                getTitle(), JOptionPane.WARNING_MESSAGE);
        return;//  w w  w  . j a  v  a2s  .  c  o  m
    }

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

    closeDialog();
}

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

License:Open Source License

private void okPressed() {
    GeneralNames alternativeName = jgnAlternativeName.getGeneralNames();

    if (alternativeName.getNames().length == 0) {
        JOptionPane.showMessageDialog(this, res.getString("DSubjectAlternativeName.ValueReq.message"),
                getTitle(), JOptionPane.WARNING_MESSAGE);
        return;/*w w w  . j  av a  2  s  . co  m*/
    }

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

    closeDialog();
}