205 references to Utils
System.Security (205)
system\security\cryptography\bigint.cs (1)
441int size = Utils.GetHexArraySize(hex);
system\security\cryptography\x509\x509utils.cs (1)
102string hexString = Utils.DiscardWhiteSpaces(s);
system\security\cryptography\xml\c14nutil.cs (24)
186if (((CanonicalXmlAttribute) attr).IsInNodeSet || Utils.IsNamespaceNode(attr) || Utils.IsXmlNamespaceNode(attr)) { 187if (Utils.IsNamespaceNode(attr)) { 190else if (Utils.IsXmlNamespaceNode(attr)) { 200if (!Utils.IsCommittedNamespace(this, this.Prefix, this.NamespaceURI)) { 246if (((CanonicalXmlAttribute) attr).IsInNodeSet || Utils.IsNamespaceNode(attr) || Utils.IsXmlNamespaceNode(attr)) { 247if (Utils.IsNamespaceNode(attr)) { 250else if (Utils.IsXmlNamespaceNode(attr)) { 260if (!Utils.IsCommittedNamespace(this, this.Prefix, this.NamespaceURI)) { 315strBuilder.Append(Utils.EscapeAttributeValue(this.Value)); 323rgbData = utf8.GetBytes(Utils.EscapeAttributeValue(this.Value)); 346strBuilder.Append(Utils.EscapeTextData(this.Value)); 352byte[] rgbData = utf8.GetBytes(Utils.EscapeTextData(this.Value)); 374strBuilder.Append(Utils.EscapeWhitespaceData(this.Value)); 380byte[] rgbData = utf8.GetBytes(Utils.EscapeWhitespaceData(this.Value)); 402strBuilder.Append(Utils.EscapeWhitespaceData(this.Value)); 408byte[] rgbData = utf8.GetBytes(Utils.EscapeWhitespaceData(this.Value)); 567strBuilder.Append(Utils.EscapeCData(this.Data)); 573byte[] rgbData = utf8.GetBytes(Utils.EscapeCData(this.Data)); 684bool nodeAdefault = Utils.IsDefaultNamespaceNode(nodeA); 685bool nodeBdefault = Utils.IsDefaultNamespaceNode(nodeB); 703m_rendered.Add(Utils.GetNamespacePrefix(attr), attr); 711m_unrendered.Add(Utils.GetNamespacePrefix(attr), attr);
system\security\cryptography\xml\canonicalxml.cs (16)
34m_c14nDoc.Load(Utils.PreProcessStreamInput(inputStream, resolver, strBaseUri)); 53XmlDocument doc = Utils.GetOwnerDocument(nodeList); 86if (Utils.NodeInList(childNodes[i], nodeList)) { 93if (Utils.NodeInList(attribNodes[j], nodeList)) { 127if (Utils.HasNamespacePrefix((XmlAttribute) a, nsPrefix)) 139if(Utils.IsNonRedundantNamespaceDecl(local, rAncestral)) { 141if (Utils.IsXmlNamespaceNode(local)) 149if (uAncestral != null && uDepth > rDepth && Utils.IsNonRedundantNamespaceDecl(uAncestral, rAncestral)) { 150if(Utils.IsXmlNamespaceNode(uAncestral)) 165XmlAttribute rAncestral = GetNearestRenderedNamespaceWithMatchingPrefix(Utils.GetNamespacePrefix(attrib), out rDepth); 166if(Utils.IsNonRedundantNamespaceDecl(attrib, rAncestral)) { 167nsLocallyDeclared.Remove(Utils.GetNamespacePrefix(attrib)); 168if (Utils.IsXmlNamespaceNode(attrib)) 179GetNamespaceToRender(Utils.GetNamespacePrefix(attrib), attrListToRender, nsListToRender, nsLocallyDeclared); 185nsLocallyDeclared.Add(Utils.GetNamespacePrefix(attr), attr); 189nsLocallyDeclared.Add(Utils.GetNamespacePrefix(attr), attr);
system\security\cryptography\xml\cipherdata.cs (1)
107m_cipherValue = Convert.FromBase64String(Utils.DiscardWhiteSpaces(cipherValueNode.InnerText));
system\security\cryptography\xml\dataobject.cs (3)
134m_id = Utils.GetAttribute(value, "Id", SignedXml.XmlDsigNamespaceUrl); 135m_mimeType = Utils.GetAttribute(value, "MimeType", SignedXml.XmlDsigNamespaceUrl); 136m_encoding = Utils.GetAttribute(value, "Encoding", SignedXml.XmlDsigNamespaceUrl);
system\security\cryptography\xml\encrypteddata.cs (4)
33this.Id = Utils.GetAttribute(value, "Id", EncryptedXml.XmlEncNamespaceUrl); 34this.Type = Utils.GetAttribute(value, "Type", EncryptedXml.XmlEncNamespaceUrl); 35this.MimeType = Utils.GetAttribute(value, "MimeType", EncryptedXml.XmlEncNamespaceUrl); 36this.Encoding = Utils.GetAttribute(value, "Encoding", EncryptedXml.XmlEncNamespaceUrl);
system\security\cryptography\xml\encryptedkey.cs (5)
76this.Id = Utils.GetAttribute(value, "Id", EncryptedXml.XmlEncNamespaceUrl); 77this.Type = Utils.GetAttribute(value, "Type", EncryptedXml.XmlEncNamespaceUrl); 78this.MimeType = Utils.GetAttribute(value, "MimeType", EncryptedXml.XmlEncNamespaceUrl); 79this.Encoding = Utils.GetAttribute(value, "Encoding", EncryptedXml.XmlEncNamespaceUrl); 80this.Recipient = Utils.GetAttribute(value, "Recipient", EncryptedXml.XmlEncNamespaceUrl);
system\security\cryptography\xml\encryptedreference.cs (3)
111this.Uri = Utils.GetAttribute(value, "URI", EncryptedXml.XmlEncNamespaceUrl); 182string uri = Utils.GetAttribute(value, "URI", EncryptedXml.XmlEncNamespaceUrl); 183if (!Utils.GetSkipSignatureAttributeEnforcement() && uri == null) {
system\security\cryptography\xml\encryptedtype.cs (4)
191m_algorithm = Utils.GetAttribute(encryptionMethodElement, "Algorithm", EncryptedXml.XmlEncNamespaceUrl); 195KeySize = Convert.ToInt32(Utils.DiscardWhiteSpaces(keySizeNode.InnerText), null); 270m_id = Utils.GetAttribute(value, "Id", EncryptedXml.XmlEncNamespaceUrl); 271m_target = Utils.GetAttribute(value, "Target", EncryptedXml.XmlEncNamespaceUrl);
system\security\cryptography\xml\encryptedxml.cs (17)
126m_xmlDsigSearchDepth = Utils.GetXmlDsigSearchDepth(); 219if (!Utils.GetLeaveCipherValueUnchecked() && cipherData.CipherReference.Uri == null){ 226if (!Utils.GetLeaveCipherValueUnchecked() && tc == null) { 231string idref = Utils.ExtractIdFromLocalUri(cipherData.CipherReference.Uri); 233if (Utils.GetLeaveCipherValueUnchecked()) { 246if (!Utils.GetLeaveCipherValueUnchecked() && tc == null) { 256Utils.Pump(decInputStream, ms); 373string idref = Utils.ExtractIdFromLocalUri(kiRetrievalMethod.Uri); 398SymmetricAlgorithm symAlg = Utils.CreateFromName<SymmetricAlgorithm>(symmetricAlgorithmUri); 430if (!Utils.GetLeaveCipherValueUnchecked() && (encryptedKey.CipherData == null || encryptedKey.CipherData.CipherValue == null)) { 445X509Certificate2Collection collection = Utils.BuildBagOfCerts(kiX509Data, CertUsageType.Decryption); 449if (!Utils.GetLeaveCipherValueUnchecked() && (encryptedKey.CipherData == null || encryptedKey.CipherData.CipherValue == null)) { 461string idref = Utils.ExtractIdFromLocalUri(kiRetrievalMethod.Uri); 487SymmetricAlgorithm symAlg = Utils.CreateFromName<SymmetricAlgorithm>(encryptedKey.EncryptionMethod.KeyAlgorithm); 492if (!Utils.GetLeaveCipherValueUnchecked() && (encryptedKey.CipherData == null || encryptedKey.CipherData.CipherValue == null)) { 756using (XmlReader xr = XmlReader.Create(sr, Utils.GetSecureXmlReaderSettings(m_xmlResolver))) 813Utils.RemoveAllChildren(inputElement);
system\security\cryptography\xml\exccanonicalxml.cs (12)
29m_c14nDoc.Load(Utils.PreProcessStreamInput(inputStream, resolver, strBaseUri)); 47XmlDocument doc = Utils.GetOwnerDocument(nodeList); 91if (Utils.NodeInList(childNodes[i], nodeList)) { 98if (Utils.NodeInList(attribNodes[j], nodeList)) { 120m_inclusivePrefixSet = Utils.TokenizePrefixListString(inclusiveNamespacesPrefixList); 125string nsPrefix = Utils.GetNamespacePrefix(attr); 127Utils.IsNonRedundantNamespaceDecl(attr, GetNearestRenderedNamespaceWithMatchingPrefix(nsPrefix, out tmp)); 132if (Utils.HasNamespacePrefix((XmlAttribute) a, nsPrefix)) 141if (Utils.IsNonRedundantNamespaceDecl(local, rAncestral)) { 148if (uAncestral != null && uDepth > rDepth && Utils.IsNonRedundantNamespaceDecl(uAncestral, rAncestral)) { 164if(!Utils.IsXmlPrefixDefinitionNode(attr)) { 168nsLocallyDeclared.Add(Utils.GetNamespacePrefix(attr), attr);
system\security\cryptography\xml\keyinfo.cs (10)
75m_id = Utils.GetAttribute(keyInfoElement, "Id", SignedXml.XmlDsigNamespaceUrl); 76if (!Utils.VerifyAttributes(keyInfoElement, "Id")) 87if (!Utils.VerifyAttributes(elem, (string[])null)) { 100KeyInfoClause keyInfoClause = Utils.CreateFromName<KeyInfoClause>(kicString); 284counterElement.AppendChild(xmlDocument.CreateTextNode(Convert.ToBase64String(Utils.ConvertIntToByteArray(dsaParams.Counter)))); 423m_uri = Utils.GetAttribute(value, "URI", SignedXml.XmlDsigNamespaceUrl); 424m_type = Utils.GetAttribute(value, "Type", SignedXml.XmlDsigNamespaceUrl); 731m_CRL = Convert.FromBase64String(Utils.DiscardWhiteSpaces(x509CRLNodes.Item(0).InnerText)); 742AddSubjectKeyId(Convert.FromBase64String(Utils.DiscardWhiteSpaces(node.InnerText))); 750AddCertificate(new X509Certificate2(Convert.FromBase64String(Utils.DiscardWhiteSpaces(node.InnerText))));
system\security\cryptography\xml\reference.cs (34)
210m_id = Utils.GetAttribute(value, "Id", SignedXml.XmlDsigNamespaceUrl); 211m_uri = Utils.GetAttribute(value, "URI", SignedXml.XmlDsigNamespaceUrl); 212m_type = Utils.GetAttribute(value, "Type", SignedXml.XmlDsigNamespaceUrl); 213if (!Utils.VerifyAttributes(value, new string[] { "Id", "URI", "Type" })) 224if (!Utils.GetAllowAdditionalSignatureNodes() && transformsNodes.Count > 1) { 229if (!Utils.VerifyAttributes(transformsElement, (string[])null)) { 235if (!Utils.GetAllowAdditionalSignatureNodes() && (transformNodes.Count != transformsElement.SelectNodes("*").Count)) { 238if (transformNodes.Count > Utils.GetMaxTransformsPerReference()) { 243string algorithm = Utils.GetAttribute(transformElement, "Algorithm", SignedXml.XmlDsigNamespaceUrl); 244if ((algorithm == null && !Utils.GetSkipSignatureAttributeEnforcement()) || !Utils.VerifyAttributes(transformElement, "Algorithm")) { 247Transform transform = Utils.CreateFromName<Transform>(algorithm); 277if (digestMethodNodes == null || digestMethodNodes.Count == 0 || (!Utils.GetAllowAdditionalSignatureNodes() && digestMethodNodes.Count > 1)) 280m_digestMethod = Utils.GetAttribute(digestMethodElement, "Algorithm", SignedXml.XmlDsigNamespaceUrl); 281if ((m_digestMethod == null && !Utils.GetSkipSignatureAttributeEnforcement()) || !Utils.VerifyAttributes(digestMethodElement, "Algorithm")) 286if (digestValueNodes == null || digestValueNodes.Count == 0 || (!Utils.GetAllowAdditionalSignatureNodes() && digestValueNodes.Count > 1)) 289m_digestValue = Convert.FromBase64String(Utils.DiscardWhiteSpaces(digestValueElement.InnerText)); 290if (!Utils.VerifyAttributes(digestValueElement, (string[])null)) 295if (!Utils.GetAllowAdditionalSignatureNodes() && (value.SelectNodes("*").Count != expectedChildNodeCount)) 321m_hashAlgorithm = Utils.CreateFromName<HashAlgorithm>(m_digestMethod); 359XmlDocument docWithNoComments = Utils.DiscardComments(Utils.PreProcessDocumentInput(document, resolver, baseUri)); 365string idref = Utils.GetIdFromLocalUri(m_uri, out discardComments); 373hashInputStream = this.TransformChain.TransformToOctetStream(Utils.PreProcessDocumentInput(document, resolver, baseUri), resolver, baseUri); 379m_namespaces = Utils.GetPropagatedAttributes(elem.ParentNode as XmlElement); 386if ((tempElem != null) && (Utils.HasAttribute(tempElem, "Id", SignedXml.XmlDsigNamespaceUrl)) 387&& (Utils.GetAttribute(tempElem, "Id", SignedXml.XmlDsigNamespaceUrl).Equals(idref))) { 390m_namespaces = Utils.GetPropagatedAttributes(this.m_signedXml.m_context); 400XmlDocument normDocument = Utils.PreProcessElementInput(elem, resolver, baseUri); 402Utils.AddNamespaces(normDocument.DocumentElement, m_namespaces); 407XmlDocument docWithNoComments = Utils.DiscardComments(normDocument); 413} else if (Utils.AllowDetachedSignature()) { 435hashInputStream = this.TransformChain.TransformToOctetStream(Utils.PreProcessElementInput((XmlElement) m_refTarget, resolver, baseUri), resolver, baseUri);
system\security\cryptography\xml\signature.cs (9)
145m_id = Utils.GetAttribute(signatureElement, "Id", SignedXml.XmlDsigNamespaceUrl); 146if (!Utils.VerifyAttributes(signatureElement, "Id")) 155if (signedInfoNodes == null || signedInfoNodes.Count == 0 || (!Utils.GetAllowAdditionalSignatureNodes() && signedInfoNodes.Count > 1)) 165if (signatureValueNodes == null || signatureValueNodes.Count == 0 || (!Utils.GetAllowAdditionalSignatureNodes() && signatureValueNodes.Count > 1)) 169m_signatureValue = Convert.FromBase64String(Utils.DiscardWhiteSpaces(signatureValueElement.InnerText)); 170m_signatureValueId = Utils.GetAttribute(signatureValueElement, "Id", SignedXml.XmlDsigNamespaceUrl); 171if (!Utils.VerifyAttributes(signatureValueElement, "Id")) 178if (!Utils.GetAllowAdditionalSignatureNodes() && keyInfoNodes.Count > 1) { 213if (!Utils.GetAllowAdditionalSignatureNodes() && (signatureElement.SelectNodes("*").Count != expectedChildNodes)) {
system\security\cryptography\xml\signedinfo.cs (13)
96m_canonicalizationMethodTransform = Utils.CreateFromName<Transform>(this.CanonicalizationMethod); 201m_id = Utils.GetAttribute(signedInfoElement, "Id", SignedXml.XmlDsigNamespaceUrl); 202if (!Utils.VerifyAttributes(signedInfoElement, "Id")) 207if (canonicalizationMethodNodes == null || canonicalizationMethodNodes.Count == 0 || (!Utils.GetAllowAdditionalSignatureNodes() && canonicalizationMethodNodes.Count > 1)) 211m_canonicalizationMethod = Utils.GetAttribute(canonicalizationMethodElement, "Algorithm", SignedXml.XmlDsigNamespaceUrl); 212if ((m_canonicalizationMethod == null && !Utils.GetSkipSignatureAttributeEnforcement()) || !Utils.VerifyAttributes(canonicalizationMethodElement, "Algorithm")) 220if (signatureMethodNodes == null || signatureMethodNodes.Count == 0 || (!Utils.GetAllowAdditionalSignatureNodes() && signatureMethodNodes.Count > 1)) 224m_signatureMethod = Utils.GetAttribute(signatureMethodElement, "Algorithm", SignedXml.XmlDsigNamespaceUrl); 225if ((m_signatureMethod == null && !Utils.GetSkipSignatureAttributeEnforcement()) || !Utils.VerifyAttributes(signatureMethodElement, "Algorithm")) 239if (referenceNodes.Count > Utils.GetMaxReferencesPerSignedInfo()) { 252if (!Utils.GetAllowAdditionalSignatureNodes() && (signedInfoElement.SelectNodes("*").Count != expectedChildNodes)) {
system\security\cryptography\xml\signedxml.cs (12)
378SignatureDescription signatureDescription = Utils.CreateFromName<SignatureDescription>(SignedInfo.SignatureMethod); 470m_x509Collection = Utils.BuildBagOfCerts (x509Data, CertUsageType.Verification); 489collection.AddRange(Utils.BuildBagOfCerts(x509Data, CertUsageType.Verification)); 514if (Utils.RequireNCNameIdentifier()) { 530if (!Utils.AllowAmbiguousReferenceTargets()) { 600HMAC hmac = Utils.CreateFromName<HMAC>(SignatureMethod); 767XmlDocument doc = Utils.PreProcessElementInput(SignedInfo.GetXml(), resolver, baseUri); 770CanonicalXmlNodeList namespaces = (m_context == null ? null : Utils.GetPropagatedAttributes(m_context)); 772Utils.AddNamespaces(doc.DocumentElement, namespaces); 797String idref = Utils.ExtractIdFromLocalUri(reference.Uri); 970SignatureDescription signatureDescription = Utils.CreateFromName<SignatureDescription>(SignatureMethod); 1031if (Utils.AllowAmbiguousReferenceTargets()) {
system\security\cryptography\xml\SignedXmlDebugLog.cs (3)
647HashAlgorithm hashAlgorithm = Utils.CreateFromName<HashAlgorithm>(reference.DigestMethod); 772HashAlgorithm hashAlgorithm = Utils.CreateFromName<HashAlgorithm>(reference.DigestMethod); 970HashAlgorithm hashAlgorithm = Utils.CreateFromName<HashAlgorithm>(reference.DigestMethod);
system\security\cryptography\xml\transform.cs (28)
89XmlReader valReader = Utils.PreProcessStreamInput(currentInputStream, resolver, baseUri); 179string algorithm = Utils.GetAttribute(transformElement, "Algorithm", SignedXml.XmlDsigNamespaceUrl); 180Transform transform = Utils.CreateFromName<Transform>(algorithm); 348namespaces = Utils.GetPropagatedAttributes(signedXml.m_context); 392if (!Utils.GetAllowAdditionalSignatureNodes() && nodeList != null && nodeList.Count > 0) 486Utils.HasAttribute(e, "PrefixList", SignedXml.XmlDsigNamespaceUrl)) { 487if (!Utils.VerifyAttributes(e, "PrefixList")) { 490this.InclusiveNamespacesPrefixList = Utils.GetAttribute(e, "PrefixList", SignedXml.XmlDsigNamespaceUrl); 493else if (!Utils.GetAllowAdditionalSignatureNodes()) { 574if (!Utils.GetAllowAdditionalSignatureNodes() && nodeList != null && nodeList.Count > 0) 695if (!Utils.VerifyAttributes(elem, (string)null)) { 712else if (!Utils.GetAllowAdditionalSignatureNodes()) { 762XmlReader valReader = Utils.PreProcessStreamInput(stream, resolver, this.BaseURI); 910settings.MaxCharactersFromEntities = Utils.GetMaxCharactersFromEntities(); 911settings.MaxCharactersInDocument = Utils.GetMaxCharactersInDocument(); 973if (!Utils.GetAllowAdditionalSignatureNodes() && nodeList != null && nodeList.Count > 0) 1001XmlReader xmlReader = Utils.PreProcessStreamInput(stream, resolver, this.BaseURI); 1014_containingDocument = Utils.GetOwnerDocument(nodeList); 1046if (Utils.IsXmlNamespaceNode(node) || Utils.IsNamespaceNode(node)) { 1082_inputNodeList = Utils.AllDescendantNodes(_containingDocument, true); 1177string uri = Utils.GetAttribute(elem, "URI", XmlDecryptionTransformNamespaceUrl); 1180if (!Utils.VerifyAttributes(elem, "URI")) { 1183string idref = Utils.ExtractIdFromLocalUri(uri); 1186else if (!Utils.GetAllowAdditionalSignatureNodes()) { 1220XmlReader xmlReader = Utils.PreProcessStreamInput(stream, resolver, this.BaseURI); 1316Utils.AddNamespaces(m_containingDocument.DocumentElement, this.PropagatedNamespaces); 1435if (!Utils.GetAllowAdditionalSignatureNodes() && nodeList != null && nodeList.Count > 0)
system\security\cryptography\xml\utils.cs (5)
696Utils.SBReplaceCharWithString(sb, (char) 13,"&#xD;"); 776if (!Utils.IsCommittedNamespace(ancestorElement, ancestorElement.Prefix, ancestorElement.NamespaceURI)) { 778if (!Utils.IsRedundantNamespace(ancestorElement, ancestorElement.Prefix, ancestorElement.NamespaceURI)) { 802if (!Utils.IsCommittedNamespace(ancestorElement, attrib.Prefix, attrib.NamespaceURI)) { 804if (!Utils.IsRedundantNamespace(ancestorElement, attrib.Prefix, attrib.NamespaceURI)) {