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\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\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\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\Utils.cs (6)
684Utils.SBReplaceCharWithString(sb, (char)13, "
");
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);