Example usage for org.bouncycastle.asn1.x509 X509Name DN_QUALIFIER

List of usage examples for org.bouncycastle.asn1.x509 X509Name DN_QUALIFIER

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.x509 X509Name DN_QUALIFIER.

Prototype

ASN1ObjectIdentifier DN_QUALIFIER

To view the source code for org.bouncycastle.asn1.x509 X509Name DN_QUALIFIER.

Click Source Link

Document

dnQualifier - DirectoryString(SIZE(1..64)

Usage

From source file:net.java.bd.tools.security.X509BDJEntryConverter.java

License:Open Source License

public DERObject getConvertedValue(DERObjectIdentifier oid, String value) {

    if (value.length() != 0 && value.charAt(0) == '#') {
        try {// w  w  w. ja  v  a 2  s .  co  m
            return convertHexEncoded(value, 1);
        } catch (IOException e) {
            throw new RuntimeException("can't recode value for oid " + oid.getId());
        }
    } else if (oid.equals(X509Name.EmailAddress) || oid.equals(X509Name.DC)) {
        return new DERIA5String(value);
    } else if (oid.equals(X509Name.DATE_OF_BIRTH)) {
        return new DERGeneralizedTime(value);
        //} else if (oid.equals(X509Name.C) || oid.equals(X509Name.SN) || oid.equals(X509Name.DN_QUALIFIER)){
        // Blu-ray Specific, require UTF8String.  MHP 12.5.6.
    } else if (oid.equals(X509Name.SN) || oid.equals(X509Name.DN_QUALIFIER)) {
        return new DERPrintableString(value);
    }

    return new DERUTF8String(value);
}