Example usage for org.bouncycastle.asn1.x500 X500Name getEncoded

List of usage examples for org.bouncycastle.asn1.x500 X500Name getEncoded

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.x500 X500Name 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:mitm.common.security.certificate.X500PrincipalUtils.java

License:Open Source License

/**
 * Converts the X500Name to X500Principal. 
 *///from   w  w  w  . j  a va  2s .c  om
public static X500Principal fromX500Name(X500Name name) throws IOException {
    if (name == null) {
        return null;
    }

    return new X500Principal(name.getEncoded(ASN1Encoding.DER));
}

From source file:org.jmrtd.lds.SODFile.java

License:Open Source License

/**
 * Gets the issuer of the document signing certificate.
 *
 * @return a certificate issuer/* www . j a v  a 2 s  .c om*/
 */
public X500Principal getIssuerX500Principal() {
    try {
        IssuerAndSerialNumber issuerAndSerialNumber = SignedDataUtil.getIssuerAndSerialNumber(signedData);
        X500Name name = issuerAndSerialNumber.getName();
        X500Principal x500Principal = new X500Principal(name.getEncoded(ASN1Encoding.DER));
        return x500Principal;
    } catch (IOException ioe) {
        LOGGER.severe("Could not get issuer: " + ioe.getMessage());
        return null;
    }
}

From source file:org.signserver.module.mrtdsodsigner.jmrtd.SODFile.java

License:Open Source License

public X500Principal getIssuerX500Principal() throws IOException {
    IssuerAndSerialNumber issuerAndSerialNumber = getIssuerAndSerialNumber();
    X500Name name = issuerAndSerialNumber.getName();

    return new X500Principal(name.getEncoded(ASN1Encoding.DER));
}