public static String decodeIA5String ( ByteBuffer buf ) { DerId id = DerId . decode ( buf ) ; if ( ! id . matches ( DerId . TagClass . UNIVERSAL , DerId . EncodingType . PRIMITIVE , ASN1_IA5STRING_TAG_NUM ) ) { throw new IllegalArgumentException ( "Expected IA5String identifier, received " + id ) ; } int len = DerUtils . decodeLength ( buf ) ; if ( buf . remaining ( ) < len ) { throw new IllegalArgumentException ( "Insufficient content for IA5String" ) ; } byte [ ] dst = new byte [ len ] ; buf . get ( dst ) ; return new String ( dst ) ; }
Decode an ASN . 1 IA5String .