163 references to Utils
System.Security.Cryptography.Xml (163)
System\Security\Cryptography\Xml\C14NAncestralNamespaceContextManager.cs (12)
19if (Utils.HasNamespacePrefix((XmlAttribute)a, nsPrefix)) 33if (Utils.IsNonRedundantNamespaceDecl(local, rAncestral)) 36if (Utils.IsXmlNamespaceNode(local)) 46if (uAncestral != null && uDepth > rDepth && Utils.IsNonRedundantNamespaceDecl(uAncestral, rAncestral)) 48if (Utils.IsXmlNamespaceNode(uAncestral)) 65XmlAttribute? rAncestral = GetNearestRenderedNamespaceWithMatchingPrefix(Utils.GetNamespacePrefix(attrib), out rDepth); 66if (Utils.IsNonRedundantNamespaceDecl(attrib, rAncestral)) 68nsLocallyDeclared.Remove(Utils.GetNamespacePrefix(attrib)); 69if (Utils.IsXmlNamespaceNode(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 (4)
24_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 (10)
38if (((CanonicalXmlAttribute)attr).IsInNodeSet || Utils.IsNamespaceNode(attr) || Utils.IsXmlNamespaceNode(attr)) 40if (Utils.IsNamespaceNode(attr)) 44else if (Utils.IsXmlNamespaceNode(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)) 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)
115_cipherValue = Convert.FromBase64String(Utils.DiscardWhiteSpaces(cipherValueNode.InnerText));
System\Security\Cryptography\Xml\CipherReference.cs (1)
79string? uri = Utils.GetAttribute(value, "URI", EncryptedXml.XmlEncNamespaceUrl);
System\Security\Cryptography\Xml\DataObject.cs (3)
145_id = Utils.GetAttribute(value, "Id", SignedXml.XmlDsigNamespaceUrl); 146_mimeType = Utils.GetAttribute(value, "MimeType", SignedXml.XmlDsigNamespaceUrl); 147_encoding = Utils.GetAttribute(value, "Encoding", SignedXml.XmlDsigNamespaceUrl);
System\Security\Cryptography\Xml\DSAKeyValue.cs (2)
130counterElement.AppendChild(xmlDocument.CreateTextNode(Convert.ToBase64String(Utils.ConvertIntToByteArray(dsaParams.Counter)))); 206Counter = (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)
63Id = Utils.GetAttribute(value, "Id", EncryptedXml.XmlEncNamespaceUrl); 64Type = Utils.GetAttribute(value, "Type", EncryptedXml.XmlEncNamespaceUrl); 65MimeType = Utils.GetAttribute(value, "MimeType", EncryptedXml.XmlEncNamespaceUrl); 66Encoding = Utils.GetAttribute(value, "Encoding", EncryptedXml.XmlEncNamespaceUrl); 67Recipient = Utils.GetAttribute(value, "Recipient", EncryptedXml.XmlEncNamespaceUrl);
System\Security\Cryptography\Xml\EncryptedReference.cs (1)
116string? uri = Utils.GetAttribute(value, "URI", EncryptedXml.XmlEncNamespaceUrl);
System\Security\Cryptography\Xml\EncryptedXml.cs (8)
101_xmlDsigSearchDepth = Utils.XmlDsigSearchDepth; 219string idref = Utils.ExtractIdFromLocalUri(cipherData.CipherReference.Uri); 243Utils.Pump(decInputStream, ms); 357string idref = Utils.ExtractIdFromLocalUri(kiRetrievalMethod.Uri!); 444X509Certificate2Collection collection = Utils.BuildBagOfCerts(kiX509Data, CertUsageType.Decryption); 465string idref = Utils.ExtractIdFromLocalUri(kiRetrievalMethod.Uri!); 836using (XmlReader xr = XmlReader.Create(sr, Utils.GetSecureXmlReaderSettings(_xmlResolver))) 904Utils.RemoveAllChildren(inputElement);
System\Security\Cryptography\Xml\EncryptionMethod.cs (2)
93_algorithm = Utils.GetAttribute(encryptionMethodElement, "Algorithm", EncryptedXml.XmlEncNamespaceUrl); 98KeySize = Convert.ToInt32(Utils.DiscardWhiteSpaces(keySizeNode.InnerText), null);
System\Security\Cryptography\Xml\EncryptionProperty.cs (2)
94_id = Utils.GetAttribute(value, "Id", EncryptedXml.XmlEncNamespaceUrl); 95_target = Utils.GetAttribute(value, "Target", EncryptedXml.XmlEncNamespaceUrl);
System\Security\Cryptography\Xml\ExcAncestralNamespaceContextManager.cs (7)
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)) 51if (uAncestral != null && uDepth > rDepth && Utils.IsNonRedundantNamespaceDecl(uAncestral, rAncestral)) 74nsLocallyDeclared.Add(Utils.GetNamespacePrefix(attr), attr);
System\Security\Cryptography\Xml\ExcCanonicalXml.cs (4)
24_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)
73_uri = Utils.GetAttribute(value, "URI", SignedXml.XmlDsigNamespaceUrl); 74_type = Utils.GetAttribute(value, "Type", SignedXml.XmlDsigNamespaceUrl);
System\Security\Cryptography\Xml\KeyInfoX509Data.cs (7)
67for (int index = 0; index < (Utils.IsSelfSigned(chain) ? 1 : elements.Count - 1); index++) 132_subjectKeyIds.Add(Utils.DecodeHexString(subjectKeyId)); 173_issuerSerials.Add(Utils.CreateX509IssuerSerial(issuerName, h.ToString())); 180_issuerSerials.Add(Utils.CreateX509IssuerSerial(issuerName, serialNumber)); 296_CRL = Convert.FromBase64String(Utils.DiscardWhiteSpaces(x509CRLNodes.Item(0)!.InnerText)); 309AddSubjectKeyId(Convert.FromBase64String(Utils.DiscardWhiteSpaces(node.InnerText))); 319AddCertificate(new X509Certificate2(Convert.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)
216_id = Utils.GetAttribute(value, "Id", SignedXml.XmlDsigNamespaceUrl); 217_uri = Utils.GetAttribute(value, "URI", SignedXml.XmlDsigNamespaceUrl); 218_type = Utils.GetAttribute(value, "Type", SignedXml.XmlDsigNamespaceUrl); 219if (!Utils.VerifyAttributes(value, s_expectedAttrNames)) 237if (!Utils.VerifyAttributes(transformsElement, (string[]?)null)) 248if (transformNodes.Count > Utils.MaxTransformsPerReference) 255string? algorithm = Utils.GetAttribute(transformElement, "Algorithm", SignedXml.XmlDsigNamespaceUrl); 256if (algorithm == null || !Utils.VerifyAttributes(transformElement, "Algorithm")) 284string idref = Utils.ExtractIdFromLocalUri(_uri); 319_digestMethod = Utils.GetAttribute(digestMethodElement, "Algorithm", SignedXml.XmlDsigNamespaceUrl)!; 320if (_digestMethod == null || !Utils.VerifyAttributes(digestMethodElement, "Algorithm")) 329_digestValue = Convert.FromBase64String(Utils.DiscardWhiteSpaces(digestValueElement.InnerText)); 330if (!Utils.VerifyAttributes(digestValueElement, (string[]?)null)) 407XmlDocument docWithNoComments = Utils.DiscardComments(Utils.PreProcessDocumentInput(document, resolver!, baseUri)); 414string idref = Utils.GetIdFromLocalUri(_uri, out bool discardComments); 423hashInputStream = TransformChain.TransformToOctetStream(Utils.PreProcessDocumentInput(document, resolver!, baseUri), resolver, baseUri); 429_namespaces = Utils.GetPropagatedAttributes(elem.ParentNode as XmlElement); 439if ((tempElem != null) && (Utils.HasAttribute(tempElem, "Id", SignedXml.XmlDsigNamespaceUrl)) 440&& (Utils.GetAttribute(tempElem, "Id", SignedXml.XmlDsigNamespaceUrl)!.Equals(idref))) 444_namespaces = Utils.GetPropagatedAttributes(_signedXml._context); 454XmlDocument normDocument = Utils.PreProcessElementInput(elem, resolver!, baseUri); 456Utils.AddNamespaces(normDocument.DocumentElement!, _namespaces); 462XmlDocument docWithNoComments = Utils.DiscardComments(normDocument); 479hashInputStream = TransformChain.TransformToOctetStream(Utils.PreProcessElementInput((XmlElement)_refTarget!, resolver!, baseUri), resolver, baseUri);
System\Security\Cryptography\Xml\Signature.cs (5)
147_id = Utils.GetAttribute(signatureElement, "Id", SignedXml.XmlDsigNamespaceUrl); 148if (!Utils.VerifyAttributes(signatureElement, "Id")) 171_signatureValue = Convert.FromBase64String(Utils.DiscardWhiteSpaces(signatureValueElement.InnerText)); 172_signatureValueId = Utils.GetAttribute(signatureValueElement, "Id", SignedXml.XmlDsigNamespaceUrl); 173if (!Utils.VerifyAttributes(signatureValueElement, "Id"))
System\Security\Cryptography\Xml\SignedInfo.cs (7)
222_id = Utils.GetAttribute(signedInfoElement, "Id", SignedXml.XmlDsigNamespaceUrl); 223if (!Utils.VerifyAttributes(signedInfoElement, "Id")) 232_canonicalizationMethod = Utils.GetAttribute(canonicalizationMethodElement, "Algorithm", SignedXml.XmlDsigNamespaceUrl); 233if (_canonicalizationMethod == null || !Utils.VerifyAttributes(canonicalizationMethodElement, "Algorithm")) 245_signatureMethod = Utils.GetAttribute(signatureMethodElement, "Algorithm", SignedXml.XmlDsigNamespaceUrl); 246if (_signatureMethod == null || !Utils.VerifyAttributes(signatureMethodElement, "Algorithm")) 261if (referenceNodes.Count > Utils.MaxReferencesPerSignedInfo)
System\Security\Cryptography\Xml\SignedXml.cs (8)
377using (AsymmetricAlgorithm? publicKey = Utils.GetAnyPublicKey(certificate)) 508_x509Collection = Utils.BuildBagOfCerts(x509Data, CertUsageType.Verification); 532collection.AddRange(Utils.BuildBagOfCerts(x509Data, CertUsageType.Verification)); 546return Utils.GetAnyPublicKey(certificate); 799XmlDocument doc = Utils.PreProcessElementInput(SignedInfo!.GetXml(), resolver!, baseUri); 802CanonicalXmlNodeList? namespaces = (_context == null ? null : Utils.GetPropagatedAttributes(_context)); 804Utils.AddNamespaces(doc.DocumentElement!, namespaces); 835string idref = Utils.ExtractIdFromLocalUri(reference.Uri);
System\Security\Cryptography\Xml\Transform.cs (1)
202namespaces = Utils.GetPropagatedAttributes(signedXml._context);
System\Security\Cryptography\Xml\TransformChain.cs (2)
86XmlReader valReader = Utils.PreProcessStreamInput(currentInputStream, resolver, baseUri); 190string? algorithm = Utils.GetAttribute(transformElement, "Algorithm", SignedXml.XmlDsigNamespaceUrl);
System\Security\Cryptography\Xml\Utils.cs (6)
427Utils.SBReplaceCharWithString(sb, (char)13, "&#xD;"); 518if (!Utils.IsCommittedNamespace(ancestorElement, ancestorElement.Prefix, ancestorElement.NamespaceURI)) 521if (!Utils.IsRedundantNamespace(ancestorElement, ancestorElement.Prefix, ancestorElement.NamespaceURI)) 551if (!Utils.IsCommittedNamespace(ancestorElement, attrib.Prefix, attrib.NamespaceURI)) 554if (!Utils.IsRedundantNamespace(ancestorElement, attrib.Prefix, attrib.NamespaceURI)) 737string hexString = Utils.DiscardWhiteSpaces(s);
System\Security\Cryptography\Xml\XmlDecryptionTransform.cs (5)
102string? uri = Utils.GetAttribute(elem, "URI", Consts.XmlDecryptionTransformNamespaceUrl); 105if (!Utils.VerifyAttributes(elem, "URI")) 109string idref = Utils.ExtractIdFromLocalUri(uri); 154XmlReader xmlReader = Utils.PreProcessStreamInput(stream, resolver, BaseURI!); 269Utils.AddNamespaces(_containingDocument!.DocumentElement!, PropagatedNamespaces);
System\Security\Cryptography\Xml\XmlDsigEnvelopedSignatureTransform.cs (5)
83XmlReader xmlReader = Utils.PreProcessStreamInput(stream, resolver, BaseURI!); 99_containingDocument = Utils.GetOwnerDocument(nodeList); 138if (Utils.IsXmlNamespaceNode(node) || Utils.IsNamespaceNode(node)) 182_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 (2)
54if (!Utils.VerifyAttributes(elem, (string?)null)) 137XmlReader valReader = Utils.PreProcessStreamInput(stream, resolver, BaseURI!);
System\Security\Cryptography\Xml\XmlDsigXsltTransform.cs (2)
121settings.MaxCharactersFromEntities = Utils.MaxCharactersFromEntities; 122settings.MaxCharactersInDocument = Utils.MaxCharactersInDocument;