Пример #1
0
            public override bool TryParseKeySizeElement(XmlElement element, out int keySize)
            {
                if (element == null)
                {
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("element");
                }

                if (element.LocalName == this.DriverDictionary.KeySize.Value &&
                    element.NamespaceURI == this.DriverDictionary.Namespace.Value)
                {
                    keySize = Int32.Parse(XmlHelper.ReadTextElementAsTrimmedString(element), NumberFormatInfo.InvariantInfo);
                    return(true);
                }

                keySize = 0;
                return(false);
            }
Пример #2
0
 public override byte[] GetAuthenticator(RequestSecurityTokenResponse rstr)
 {
     if (rstr != null && rstr.RequestSecurityTokenResponseXml != null && rstr.RequestSecurityTokenResponseXml.ChildNodes != null)
     {
         for (int i = 0; i < rstr.RequestSecurityTokenResponseXml.ChildNodes.Count; ++i)
         {
             XmlElement element = rstr.RequestSecurityTokenResponseXml.ChildNodes[i] as XmlElement;
             if (element != null)
             {
                 if (element.LocalName == DriverDictionary.Authenticator.Value && element.NamespaceURI == DriverDictionary.Namespace.Value)
                 {
                     XmlElement combinedHashElement = XmlHelper.GetChildElement(element);
                     if (combinedHashElement.LocalName == DriverDictionary.CombinedHash.Value && combinedHashElement.NamespaceURI == DriverDictionary.Namespace.Value)
                     {
                         string authenticatorString = XmlHelper.ReadTextElementAsTrimmedString(combinedHashElement);
                         return(Convert.FromBase64String(authenticatorString));
                     }
                 }
             }
         }
     }
     return(null);
 }
Пример #3
0
 public static UniqueId ReadTextElementAsUniqueId(XmlElement element)
 {
     return(new UniqueId(XmlHelper.ReadTextElementAsTrimmedString(element)));
 }