Example usage for org.bouncycastle.asn1.x500.style BCStyle T

List of usage examples for org.bouncycastle.asn1.x500.style BCStyle T

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.x500.style BCStyle T.

Prototype

ASN1ObjectIdentifier T

To view the source code for org.bouncycastle.asn1.x500.style BCStyle T.

Click Source Link

Document

Title

Usage

From source file:com.aqnote.shared.cryptology.cert.util.CertificateUtil.java

License:Open Source License

public static String getSubjectTitle(X509Certificate cert) throws CertificateEncodingException {
    if (cert == null)
        return null;
    X500Name x500name = new JcaX509CertificateHolder(cert).getSubject();
    return getValue(x500name.getRDNs(BCStyle.T)[0]);
}

From source file:com.aqnote.shared.cryptology.cert.util.CertificateUtil.java

License:Open Source License

public static String getIssuerTitle(X509Certificate cert) throws CertificateEncodingException {
    if (cert == null)
        return null;
    X500Name x500name = new JcaX509CertificateHolder(cert).getIssuer();
    return getValue(x500name.getRDNs(BCStyle.T)[0]);
}

From source file:com.aqnote.shared.cryptology.cert.util.X500NameUtil.java

License:Open Source License

public static X500Name createClass3EndPrincipal(String cn, String email, String title) {
    X500NameBuilder x500NameBuilder = new X500NameBuilder(BCStyle.INSTANCE);
    x500NameBuilder.addRDN(BCStyle.E, email);
    x500NameBuilder.addRDN(BCStyle.CN, cn);
    x500NameBuilder.addRDN(BCStyle.T, title);
    x500NameBuilder.addRDN(BCStyle.OU, DN_CLASS3_END_OU);
    //        x500NameBuilder.addRDN(BCStyle.O, DN_O);
    //        x500NameBuilder.addRDN(BCStyle.L, DN_L);
    //        x500NameBuilder.addRDN(BCStyle.ST, DN_ST);
    //        x500NameBuilder.addRDN(BCStyle.C, DN_C);
    return x500NameBuilder.build();
}