示例#1
0
 public static LamportScheme GetLamportScheme(User user)
 {
     lock (lamportSchemesLock)
     {
         return(LamportSchemes.FirstOrDefault(a => a.User == user));
     }
 }
示例#2
0
        public static LamportScheme InitLamportScheme(User user, SksClientType clientType)
        {
            lock (lamportSchemesLock)
            {
                if (LamportSchemes.Any(a => a.User == user))
                {
                    return(null);
                }
            }

            var newLamportScheme = new LamportScheme(user);

            lock (akep2sLock)
            {
                LamportSchemes.Add(newLamportScheme);
            }

            return(newLamportScheme);
        }