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

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

Introduction

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

Prototype

ASN1ObjectIdentifier DATE_OF_BIRTH

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

Click Source Link

Document

RFC 3039 DateOfBirth - GeneralizedTime - YYYYMMDD000000Z

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. j  a v a2s  .c om
            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);
}