예제 #1
0
        public UsernameToken(UsernameInfo usernameInfo, string nonce, string created)
        {
            if (usernameInfo == null)
            {
                throw new ArgumentNullException("usernameInfo");
            }

            _usernameInfo = usernameInfo;

            if (nonce != null)
            {
                _nonce = Convert.FromBase64String(nonce);
            }

            if (created != null)
            {
                _created = DateTime.Parse(created);
            }

            // the user name token is not capable of any crypto
            _securityKeys = new ReadOnlyCollection <SecurityKey>(new List <SecurityKey>());
        }
예제 #2
0
 /// <summary>
 /// UsernameToken that allows for time offset corrections in case device time and client time
 /// aren't synchronized.
 /// </summary>
 /// <param name="usernameInfo"></param>
 /// <param name="DeviceTimeOffset">Difference between device UTC time and client UTC time in seconds</param>
 public UsernameToken(UsernameInfo usernameInfo, double DeviceTimeOffset) : this(usernameInfo, null, null)
 {
     _created = DateTime.UtcNow + TimeSpan.FromSeconds(DeviceTimeOffset);
 }
예제 #3
0
 public UsernameToken(UsernameInfo usernameInfo) : this(usernameInfo, null, null)
 {
 }