private static void BuildTicket(Ticket ticket, Asn1Node asn1Node) { Asn1Node childNode1 = asn1Node.GetChildNode(0).GetChildNode(0); for (int index = 0; (long)index < childNode1.ChildNodeCount; ++index) { Asn1Node childNode2 = childNode1.GetChildNode(index); switch (KerberosAuthorizeMessageBuilder.GetContextNumber(childNode2)) { case 0: ticket.TicketVersionNumber = (int)Asn1Util.BytesToLong(childNode2.GetChildNode(0).Data); break; case 1: ticket.Realm = childNode2.GetChildNode(0).GetDataStr(false); break; case 2: ticket.ServiceName = new PrincipalName(); KerberosAuthorizeMessageBuilder.BuildPrincipleName(ticket.ServiceName, childNode2); break; case 3: ticket.EncPart = new EncryptedData(); KerberosAuthorizeMessageBuilder.BuildEncryptedData(ticket.EncPart, childNode2); break; } } }
private static void BuildKrbApReq(KrbApReq krbApReq, Asn1Node asn1Node) { Asn1Node childNode1 = asn1Node.GetChildNode(0); for (int index = 0; (long)index < childNode1.ChildNodeCount; ++index) { Asn1Node childNode2 = childNode1.GetChildNode(index); switch (KerberosAuthorizeMessageBuilder.GetContextNumber(childNode2)) { case 0: krbApReq.ProtocolVersionNumber = (int)Asn1Util.BytesToLong(childNode2.GetChildNode(0).Data); break; case 1: krbApReq.MessageType = (MessageType)Asn1Util.BytesToLong(childNode2.GetChildNode(0).Data); break; case 2: krbApReq.APOptions = (APOptions)Asn1Util.BytesToLong(childNode2.GetChildNode(0).Data); break; case 3: krbApReq.Ticket = new Ticket(); KerberosAuthorizeMessageBuilder.BuildTicket(krbApReq.Ticket, childNode2); break; case 4: krbApReq.Authenticator = new EncryptedData(); KerberosAuthorizeMessageBuilder.BuildEncryptedData(krbApReq.Authenticator, childNode2); break; } } }