public DERObject getConvertedValue ( DERObjectIdentifier oid , String value ) { if ( value . length ( ) != 0 && value . charAt ( 0 ) == ' ' ) { try { return convertHexEncoded ( value , 1 ) ; } catch ( IOException e ) { throw new RuntimeException ( "can't recode value for oid " + oid . getId ( ) , e ) ; } } else if ( oid . equals ( X509Name . EmailAddress ) ) { return new DERIA5String ( value ) ; } else if ( canBePrintable ( value ) ) { return new DERPrintableString ( value ) ; } else if ( canBeUTF8 ( value ) ) { return new DERUTF8String ( value ) ; } return new DERBMPString ( value ) ; }
Apply default coversion for the given value depending on the oid and the character range of the value .