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