Exemplo n.º 1
0
        public override bool Add(TicketCacheEntry entry)
        {
            if (entry.Value is KerberosClientCacheEntry cacheEntry)
            {
                var cred = KrbCred.WrapTicket(
                    cacheEntry.KdcResponse.Ticket,
                    new KrbCredInfo
                {
                    Key       = cacheEntry.SessionKey,
                    AuthTime  = cacheEntry.AuthTime,
                    EndTime   = cacheEntry.EndTime,
                    Flags     = cacheEntry.Flags,
                    PName     = cacheEntry.KdcResponse.CName,
                    Realm     = cacheEntry.KdcResponse.CRealm,
                    RenewTill = cacheEntry.RenewTill,
                    SName     = cacheEntry.KdcResponse.Ticket.SName,
                    SRealm    = cacheEntry.KdcResponse.Ticket.Realm,
                    StartTime = cacheEntry.StartTime
                }
                    );

                lsa.ImportCredential(cred);
            }

            return(true);
        }