Example #1
0
 private static bool VerifyTokenInfo(ManagedTokenInfo tokenInfo)
 {
     if (ManagedTokenTypes.FIPS != tokenInfo.Type && tokenInfo.Type != 0)
     {
         return(true);
     }
     if (string.IsNullOrEmpty(tokenInfo.Label) || string.IsNullOrEmpty(tokenInfo.ReaderName) || string.IsNullOrEmpty(tokenInfo.SerialNumber))
     {
         return(false);
     }
     return(true);
 }
Example #2
0
 private static ManagedTokenInfo[] CreateTokenInfoFromModules()
 {
     ManagedTokenInfo[] array = new ManagedTokenInfo[_modules.Length];
     for (int i = 0; i < _modules.Length; i++)
     {
         array[i] = _modules[i].getInformation();
         if (!VerifyTokenInfo(array[i]))
         {
             throw new Exception("Incomplete information");
         }
     }
     return(array);
 }
Example #3
0
        private static Token CreateTokenFromInfo(ManagedTokenInfo info)
        {
            Token token = new Token();

            token.DisplayName = string.Empty;
            token.ReaderName  = info.ReaderName;
            token.Label       = info.Label;
            token.Type        = info.Type;
            //token.TypeIcon = null;
            token.Id = info.SerialNumber;
            token.IsPinChangeNeeded = info.IsPinChangeNeeded;
            token.IsPresent         = false;
            return(token);
        }