public static RealSearchControlValue Extract(ICollection <byte> buffer) { var result = new RealSearchControlValue(); result.ExtractTagAndLength(buffer); result.Size = DERInteger.Extract(buffer); result.Cookie = DEROctetString.Extract(buffer); return(result); }
public static LdapPacket Extract(ICollection <byte> buffer) { var ldapPacket = new LdapPacket(); ldapPacket.ExtractTagAndLength(buffer); ldapPacket.MessageId = DERInteger.Extract(buffer); ldapPacket.ProtocolOperation = DERProtocolOperation.Extract(buffer); if (buffer.Count > 0) { ldapPacket.Controls = DERSequence <DERControl> .Extract(buffer); } return(ldapPacket); }
public static SearchRequest Extract(ICollection <byte> buffer) { var searchRequest = new SearchRequest(); searchRequest.BaseObject = DEROctetString.Extract(buffer); searchRequest.Scope = DEREnumerated <SearchRequestScopes> .Extract(buffer); searchRequest.DeferAlias = DEREnumerated <SearchRequestDeferAliases> .Extract(buffer); searchRequest.SizeLimit = DERInteger.Extract(buffer); searchRequest.TimeLimit = DERInteger.Extract(buffer); searchRequest.TypesOnly = DERBoolean.Extract(buffer); searchRequest.Filter = SearchRequestFilter.Extract(buffer); searchRequest.Attributes = DERSequence <DEROctetString> .Extract(buffer); return(searchRequest); }
public static BindRequest Extract(ICollection <byte> buffer) { var result = new BindRequest(); result.Version = DERInteger.Extract(buffer); result.Name = DEROctetString.Extract(buffer); var cloneBuffer = buffer.ToList(); var tag = DERTag.Extract(cloneBuffer); var authMethod = (BindRequestAuthenticationChoices)tag.TagNumber; switch (authMethod) { case BindRequestAuthenticationChoices.SASL: result.Authentication = SASLAuthChoice.Extract(buffer); break; case BindRequestAuthenticationChoices.SIMPLE: result.Authentication = SimpleAuthChoice.Extract(buffer); break; } return(result); }