188 references to Utils
System.Security.Cryptography.Xml (188)
System\Security\Cryptography\Xml\C14NAncestralNamespaceContextManager.cs (18)
19if (Utils.HasNamespacePrefix((XmlAttribute)a, nsPrefix)) 33if (Utils.IsNonRedundantNamespaceDecl(local, rAncestral)) 36if (Utils.IsXmlNamespaceNode(local)) 37Utils.AddToRenderList(attrListToRender, local); 39Utils.AddToRenderList(nsListToRender, local); 46if (uAncestral != null && uDepth > rDepth && Utils.IsNonRedundantNamespaceDecl(uAncestral, rAncestral)) 48if (Utils.IsXmlNamespaceNode(uAncestral)) 49Utils.AddToRenderList(attrListToRender, uAncestral); 51Utils.AddToRenderList(nsListToRender, uAncestral); 65XmlAttribute? rAncestral = GetNearestRenderedNamespaceWithMatchingPrefix(Utils.GetNamespacePrefix(attrib), out rDepth); 66if (Utils.IsNonRedundantNamespaceDecl(attrib, rAncestral)) 68nsLocallyDeclared.Remove(Utils.GetNamespacePrefix(attrib)); 69if (Utils.IsXmlNamespaceNode(attrib)) 70Utils.AddToRenderList(attrListToRender, attrib); 72Utils.AddToRenderList(nsListToRender, attrib); 82GetNamespaceToRender(Utils.GetNamespacePrefix(attrib), attrListToRender, nsListToRender, nsLocallyDeclared); 89nsLocallyDeclared.Add(Utils.GetNamespacePrefix(attr), attr); 94nsLocallyDeclared.Add(Utils.GetNamespacePrefix(attr), attr);
System\Security\Cryptography\Xml\CanonicalXml.cs (6)
24Utils.LoadXmlDocumentWithMaxDepthCheck(_c14nDoc, Utils.PreProcessStreamInput(inputStream, resolver, strBaseUri), maxDepth); 28_c14nDoc.Load(Utils.PreProcessStreamInput(inputStream, resolver, strBaseUri)); 49XmlDocument? doc = Utils.GetOwnerDocument(nodeList); 86if (Utils.NodeInList(childNodes[i], nodeList)) 96if (Utils.NodeInList(attribNodes[j], nodeList))
System\Security\Cryptography\Xml\CanonicalXmlAttribute.cs (2)
29strBuilder.Append(Utils.EscapeAttributeValue(Value)); 37rgbData = Encoding.UTF8.GetBytes(Utils.EscapeAttributeValue(Value));
System\Security\Cryptography\Xml\CanonicalXmlCDataSection.cs (2)
27strBuilder.Append(Utils.EscapeCData(Data)); 34byte[] rgbData = Encoding.UTF8.GetBytes(Utils.EscapeCData(Data));
System\Security\Cryptography\Xml\CanonicalXmlElement.cs (12)
38if (((CanonicalXmlAttribute)attr).IsInNodeSet || Utils.IsNamespaceNode(attr) || Utils.IsXmlNamespaceNode(attr)) 40if (Utils.IsNamespaceNode(attr)) 44else if (Utils.IsXmlNamespaceNode(attr)) 50Utils.AddToRenderList(attrListToRender, attr); 56if (!Utils.IsCommittedNamespace(this, Prefix, NamespaceURI)) 110if (((CanonicalXmlAttribute)attr).IsInNodeSet || Utils.IsNamespaceNode(attr) || Utils.IsXmlNamespaceNode(attr)) 112if (Utils.IsNamespaceNode(attr)) 116else if (Utils.IsXmlNamespaceNode(attr)) 122Utils.AddToRenderList(attrListToRender, attr); 128if (!Utils.IsCommittedNamespace(this, Prefix, NamespaceURI))
System\Security\Cryptography\Xml\CanonicalXmlSignificantWhitespace.cs (2)
29strBuilder.Append(Utils.EscapeWhitespaceData(Value)); 36byte[] rgbData = Encoding.UTF8.GetBytes(Utils.EscapeWhitespaceData(Value));
System\Security\Cryptography\Xml\CanonicalXmlText.cs (2)
29strBuilder.Append(Utils.EscapeTextData(Value)); 36byte[] rgbData = Encoding.UTF8.GetBytes(Utils.EscapeTextData(Value));
System\Security\Cryptography\Xml\CanonicalXmlWhitespace.cs (2)
29strBuilder.Append(Utils.EscapeWhitespaceData(Value)); 36byte[] rgbData = Encoding.UTF8.GetBytes(Utils.EscapeWhitespaceData(Value));
System\Security\Cryptography\Xml\CipherData.cs (1)
112_cipherValue = Convert.FromBase64String(Utils.DiscardWhiteSpaces(cipherValueNode.InnerText));
System\Security\Cryptography\Xml\CipherReference.cs (1)
76string? uri = Utils.GetAttribute(value, "URI", EncryptedXml.XmlEncNamespaceUrl);
System\Security\Cryptography\Xml\DataObject.cs (3)
139_id = Utils.GetAttribute(value, "Id", SignedXml.XmlDsigNamespaceUrl); 140_mimeType = Utils.GetAttribute(value, "MimeType", SignedXml.XmlDsigNamespaceUrl); 141_encoding = Utils.GetAttribute(value, "Encoding", SignedXml.XmlDsigNamespaceUrl);
System\Security\Cryptography\Xml\DSAKeyValue.cs (2)
124counterElement.AppendChild(xmlDocument.CreateTextNode(Convert.ToBase64String(Utils.ConvertIntToByteArray(dsaParams.Counter)))); 197Counter = (pgenCounterNode != null) ? Utils.ConvertByteArrayToInt(Convert.FromBase64String(pgenCounterNode.InnerText)) : 0
System\Security\Cryptography\Xml\EncryptedData.cs (4)
24Id = Utils.GetAttribute(value, "Id", EncryptedXml.XmlEncNamespaceUrl); 25Type = Utils.GetAttribute(value, "Type", EncryptedXml.XmlEncNamespaceUrl); 26MimeType = Utils.GetAttribute(value, "MimeType", EncryptedXml.XmlEncNamespaceUrl); 27Encoding = Utils.GetAttribute(value, "Encoding", EncryptedXml.XmlEncNamespaceUrl);
System\Security\Cryptography\Xml\EncryptedKey.cs (5)
59Id = Utils.GetAttribute(value, "Id", EncryptedXml.XmlEncNamespaceUrl); 60Type = Utils.GetAttribute(value, "Type", EncryptedXml.XmlEncNamespaceUrl); 61MimeType = Utils.GetAttribute(value, "MimeType", EncryptedXml.XmlEncNamespaceUrl); 62Encoding = Utils.GetAttribute(value, "Encoding", EncryptedXml.XmlEncNamespaceUrl); 63Recipient = Utils.GetAttribute(value, "Recipient", EncryptedXml.XmlEncNamespaceUrl);
System\Security\Cryptography\Xml\EncryptedReference.cs (1)
112string? uri = Utils.GetAttribute(value, "URI", EncryptedXml.XmlEncNamespaceUrl);
System\Security\Cryptography\Xml\EncryptedXml.cs (10)
129_xmlDsigSearchDepth = Utils.XmlDsigSearchDepth; 249string idref = Utils.ExtractIdFromLocalUri(cipherData.CipherReference.Uri); 278Utils.Pump(decInputStream, ms); 409string idref = Utils.ExtractIdFromLocalUri(kiRetrievalMethod.Uri!); 509X509Certificate2Collection collection = Utils.BuildBagOfCerts(kiX509Data, CertUsageType.Decryption); 530string idref = Utils.ExtractIdFromLocalUri(kiRetrievalMethod.Uri!); 878using (XmlReader xr = XmlReader.Create(sr, Utils.GetSecureXmlReaderSettings(_xmlResolver))) 883Utils.LoadXmlDocumentWithMaxDepthCheck(importDocument, xr, maxDepth); 912Utils.ValidateInputXmlMaxDepth(dummy, decryptedString, maxDepth, allowDtdProcessing); 956Utils.RemoveAllChildren(inputElement);
System\Security\Cryptography\Xml\EncryptionMethod.cs (2)
90_algorithm = Utils.GetAttribute(encryptionMethodElement, "Algorithm", EncryptedXml.XmlEncNamespaceUrl); 95KeySize = Convert.ToInt32(Utils.DiscardWhiteSpaces(keySizeNode.InnerText), null);
System\Security\Cryptography\Xml\EncryptionProperty.cs (2)
88_id = Utils.GetAttribute(value, "Id", EncryptedXml.XmlEncNamespaceUrl); 89_target = Utils.GetAttribute(value, "Target", EncryptedXml.XmlEncNamespaceUrl);
System\Security\Cryptography\Xml\ExcAncestralNamespaceContextManager.cs (11)
17_inclusivePrefixSet = Utils.TokenizePrefixListString(inclusiveNamespacesPrefixList); 22string nsPrefix = Utils.GetNamespacePrefix(attr); 24Utils.IsNonRedundantNamespaceDecl(attr, GetNearestRenderedNamespaceWithMatchingPrefix(nsPrefix, out _)); 31if (Utils.HasNamespacePrefix((XmlAttribute)a, nsPrefix)) 41if (Utils.IsNonRedundantNamespaceDecl(local, rAncestral)) 44Utils.AddToRenderList(nsListToRender, local); 51if (uAncestral != null && uDepth > rDepth && Utils.IsNonRedundantNamespaceDecl(uAncestral, rAncestral)) 53Utils.AddToRenderList(nsListToRender, uAncestral); 72Utils.AddToRenderList(nsListToRender, attr); 74nsLocallyDeclared.Add(Utils.GetNamespacePrefix(attr), attr); 80Utils.AddToRenderList(attrListToRender, attr);
System\Security\Cryptography\Xml\ExcCanonicalXml.cs (6)
24Utils.LoadXmlDocumentWithMaxDepthCheck(_c14nDoc, Utils.PreProcessStreamInput(inputStream, resolver, strBaseUri), maxDepth); 28_c14nDoc.Load(Utils.PreProcessStreamInput(inputStream, resolver, strBaseUri)); 48XmlDocument? doc = Utils.GetOwnerDocument(nodeList); 96if (Utils.NodeInList(childNodes[i], nodeList)) 106if (Utils.NodeInList(attribNodes[j], nodeList))
System\Security\Cryptography\Xml\KeyInfo.cs (3)
71_id = Utils.GetAttribute(keyInfoElement, "Id", SignedXml.XmlDsigNamespaceUrl); 72if (!Utils.VerifyAttributes(keyInfoElement, "Id")) 86if (!Utils.VerifyAttributes(elem, (string[]?)null))
System\Security\Cryptography\Xml\KeyInfoRetrievalMethod.cs (2)
70_uri = Utils.GetAttribute(value, "URI", SignedXml.XmlDsigNamespaceUrl); 71_type = Utils.GetAttribute(value, "Type", SignedXml.XmlDsigNamespaceUrl);
System\Security\Cryptography\Xml\KeyInfoX509Data.cs (7)
72for (int index = 0; index < (Utils.IsSelfSigned(chain) ? 1 : elements.Count - 1); index++) 134_subjectKeyIds.Add(Utils.DecodeHexString(subjectKeyId)); 175_issuerSerials.Add(Utils.CreateX509IssuerSerial(issuerName, h.ToString())); 182_issuerSerials.Add(Utils.CreateX509IssuerSerial(issuerName, serialNumber)); 295_CRL = Convert.FromBase64String(Utils.DiscardWhiteSpaces(x509CRLNodes.Item(0)!.InnerText)); 308AddSubjectKeyId(Convert.FromBase64String(Utils.DiscardWhiteSpaces(node.InnerText))); 320Convert.FromBase64String(Utils.DiscardWhiteSpaces(node.InnerText))));
System\Security\Cryptography\Xml\NamespaceFrame.cs (2)
21_rendered.Add(Utils.GetNamespacePrefix(attr), attr); 31_unrendered.Add(Utils.GetNamespacePrefix(attr), attr);
System\Security\Cryptography\Xml\NamespaceSortOrder.cs (2)
19bool nodeAdefault = Utils.IsDefaultNamespaceNode(nodeA); 20bool nodeBdefault = Utils.IsDefaultNamespaceNode(nodeB);
System\Security\Cryptography\Xml\Reference.cs (25)
213_id = Utils.GetAttribute(value, "Id", SignedXml.XmlDsigNamespaceUrl); 214_uri = Utils.GetAttribute(value, "URI", SignedXml.XmlDsigNamespaceUrl); 215_type = Utils.GetAttribute(value, "Type", SignedXml.XmlDsigNamespaceUrl); 216if (!Utils.VerifyAttributes(value, s_expectedAttrNames)) 234if (!Utils.VerifyAttributes(transformsElement, (string[]?)null)) 245if (transformNodes.Count > Utils.MaxTransformsPerReference) 252string? algorithm = Utils.GetAttribute(transformElement, "Algorithm", SignedXml.XmlDsigNamespaceUrl); 253if (algorithm == null || !Utils.VerifyAttributes(transformElement, "Algorithm")) 281string idref = Utils.ExtractIdFromLocalUri(_uri); 316_digestMethod = Utils.GetAttribute(digestMethodElement, "Algorithm", SignedXml.XmlDsigNamespaceUrl)!; 317if (_digestMethod == null || !Utils.VerifyAttributes(digestMethodElement, "Algorithm")) 326_digestValue = Convert.FromBase64String(Utils.DiscardWhiteSpaces(digestValueElement.InnerText)); 327if (!Utils.VerifyAttributes(digestValueElement, (string[]?)null)) 401XmlDocument docWithNoComments = Utils.DiscardComments(Utils.PreProcessDocumentInput(document, resolver!, baseUri)); 408string idref = Utils.GetIdFromLocalUri(_uri, out bool discardComments); 417hashInputStream = TransformChain.TransformToOctetStream(Utils.PreProcessDocumentInput(document, resolver!, baseUri), resolver, baseUri); 423_namespaces = Utils.GetPropagatedAttributes(elem.ParentNode as XmlElement); 433if ((tempElem != null) && (Utils.HasAttribute(tempElem, "Id", SignedXml.XmlDsigNamespaceUrl)) 434&& (Utils.GetAttribute(tempElem, "Id", SignedXml.XmlDsigNamespaceUrl)!.Equals(idref))) 438_namespaces = Utils.GetPropagatedAttributes(_signedXml._context); 448XmlDocument normDocument = Utils.PreProcessElementInput(elem, resolver!, baseUri); 450Utils.AddNamespaces(normDocument.DocumentElement!, _namespaces); 456XmlDocument docWithNoComments = Utils.DiscardComments(normDocument); 473hashInputStream = TransformChain.TransformToOctetStream(Utils.PreProcessElementInput((XmlElement)_refTarget!, resolver!, baseUri), resolver, baseUri);
System\Security\Cryptography\Xml\Signature.cs (5)
144_id = Utils.GetAttribute(signatureElement, "Id", SignedXml.XmlDsigNamespaceUrl); 145if (!Utils.VerifyAttributes(signatureElement, "Id")) 168_signatureValue = Convert.FromBase64String(Utils.DiscardWhiteSpaces(signatureValueElement.InnerText)); 169_signatureValueId = Utils.GetAttribute(signatureValueElement, "Id", SignedXml.XmlDsigNamespaceUrl); 170if (!Utils.VerifyAttributes(signatureValueElement, "Id"))
System\Security\Cryptography\Xml\SignedInfo.cs (6)
219_id = Utils.GetAttribute(signedInfoElement, "Id", SignedXml.XmlDsigNamespaceUrl); 220if (!Utils.VerifyAttributes(signedInfoElement, "Id")) 229_canonicalizationMethod = Utils.GetAttribute(canonicalizationMethodElement, "Algorithm", SignedXml.XmlDsigNamespaceUrl); 230if (_canonicalizationMethod == null || !Utils.VerifyAttributes(canonicalizationMethodElement, "Algorithm")) 242_signatureMethod = Utils.GetAttribute(signatureMethodElement, "Algorithm", SignedXml.XmlDsigNamespaceUrl); 243if (_signatureMethod == null || !Utils.VerifyAttributes(signatureMethodElement, "Algorithm"))
System\Security\Cryptography\Xml\SignedXml.cs (10)
123Utils.ValidateInputXmlMaxDepth(element, maxDepth); 239Utils.ValidateInputXmlMaxDepth(value, maxDepth); 417using (AsymmetricAlgorithm? publicKey = Utils.GetAnyPublicKey(certificate)) 566_x509Collection = Utils.BuildBagOfCerts(x509Data, CertUsageType.Verification); 590collection.AddRange(Utils.BuildBagOfCerts(x509Data, CertUsageType.Verification)); 604return Utils.GetAnyPublicKey(certificate); 857XmlDocument doc = Utils.PreProcessElementInput(SignedInfo!.GetXml(), resolver!, baseUri); 860CanonicalXmlNodeList? namespaces = (_context == null ? null : Utils.GetPropagatedAttributes(_context)); 862Utils.AddNamespaces(doc.DocumentElement!, namespaces); 893string idref = Utils.ExtractIdFromLocalUri(reference.Uri);
System\Security\Cryptography\Xml\Transform.cs (1)
214namespaces = Utils.GetPropagatedAttributes(signedXml._context);
System\Security\Cryptography\Xml\TransformChain.cs (3)
87XmlReader valReader = Utils.PreProcessStreamInput(currentInputStream, resolver, baseUri); 91Utils.LoadXmlDocumentWithMaxDepthCheck(doc, valReader, maxDepth); 204string? algorithm = Utils.GetAttribute(transformElement, "Algorithm", SignedXml.XmlDsigNamespaceUrl);
System\Security\Cryptography\Xml\Utils.cs (6)
684Utils.SBReplaceCharWithString(sb, (char)13, "&#xD;"); 775if (!Utils.IsCommittedNamespace(ancestorElement, ancestorElement.Prefix, ancestorElement.NamespaceURI)) 778if (!Utils.IsRedundantNamespace(ancestorElement, ancestorElement.Prefix, ancestorElement.NamespaceURI)) 808if (!Utils.IsCommittedNamespace(ancestorElement, attrib.Prefix, attrib.NamespaceURI)) 811if (!Utils.IsRedundantNamespace(ancestorElement, attrib.Prefix, attrib.NamespaceURI)) 994string hexString = Utils.DiscardWhiteSpaces(s);
System\Security\Cryptography\Xml\XmlDecryptionTransform.cs (7)
100string? uri = Utils.GetAttribute(elem, "URI", Consts.XmlDecryptionTransformNamespaceUrl); 103if (!Utils.VerifyAttributes(elem, "URI")) 107string idref = Utils.ExtractIdFromLocalUri(uri); 152XmlReader xmlReader = Utils.PreProcessStreamInput(stream, resolver, BaseURI!); 156Utils.LoadXmlDocumentWithMaxDepthCheck(document, xmlReader, maxDepth); 197Utils.ValidateInputXmlMaxDepth(parent, decryptedString, maxDepth, allowDtdProcessing); 292Utils.AddNamespaces(_containingDocument!.DocumentElement!, PropagatedNamespaces);
System\Security\Cryptography\Xml\XmlDsigEnvelopedSignatureTransform.cs (6)
83XmlReader xmlReader = Utils.PreProcessStreamInput(stream, resolver, BaseURI!); 87Utils.LoadXmlDocumentWithMaxDepthCheck(doc, xmlReader, maxDepth); 105_containingDocument = Utils.GetOwnerDocument(nodeList); 141if (Utils.IsXmlNamespaceNode(node) || Utils.IsNamespaceNode(node)) 185_inputNodeList ??= Utils.AllDescendantNodes(_containingDocument!, true);
System\Security\Cryptography\Xml\XmlDsigExcC14NTransform.cs (3)
57Utils.HasAttribute(e, "PrefixList", SignedXml.XmlDsigNamespaceUrl)) 59if (!Utils.VerifyAttributes(e, "PrefixList")) 63this.InclusiveNamespacesPrefixList = Utils.GetAttribute(e, "PrefixList", SignedXml.XmlDsigNamespaceUrl);
System\Security\Cryptography\Xml\XmlDsigXPathTransform.cs (3)
54if (!Utils.VerifyAttributes(elem, (string?)null)) 137XmlReader valReader = Utils.PreProcessStreamInput(stream, resolver, BaseURI!); 143Utils.LoadXmlDocumentWithMaxDepthCheck(_document, valReader, maxDepth);
System\Security\Cryptography\Xml\XmlDsigXsltTransform.cs (2)
121settings.MaxCharactersFromEntities = Utils.MaxCharactersFromEntities; 122settings.MaxCharactersInDocument = Utils.MaxCharactersInDocument;
System\Security\Cryptography\Xml\XmlLicenseTransform.cs (1)
94Utils.ValidateInputXmlMaxDepth(