public override int BerDecode(IAsn1DecodingBuffer buffer, bool explicitTag = true) { int allLen = 0; Asn1Tag contextTag; allLen += TagBerDecode(buffer, out contextTag); switch (contextTag.TagValue) { case 0: field0 = new LDAPString(); allLen += field0.BerDecodeWithoutUnisersalTag(buffer); SetData(1, field0); break; case 1: field1 = new LDAPString(); allLen += field1.BerDecodeWithoutUnisersalTag(buffer); SetData(2, field1); break; case 2: field2 = new LDAPString(); allLen += field2.BerDecodeWithoutUnisersalTag(buffer); SetData(3, field2); break; default: throw new Asn1DecodingUnexpectedData(ExceptionMessages.DecodingUnexpectedData + " AuthenticationChoice"); } return(allLen); }