mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-18 03:51:19 -10:00
* KeyInfo.cs : Fixed LoadXml() to skip text nodes as MS.NET does. Uncommented out RSAKeyValue. * Signature.cs : Fixed LoadXml(). Don't use GetElementsByTagName() that incorrectly acquires descendants. Throw CryptographicException if required elements were not found. * Transform.cs : added internal GetResolver(). * XmlDsigXPathTransform.cs, XmlDsigXsltTransform.cs : use XmlResolver. svn path=/trunk/mcs/; revision=23711
75 lines
1.5 KiB
C#
75 lines
1.5 KiB
C#
//
|
|
// Transform.cs - Transform implementation for XML Signature
|
|
//
|
|
// Author:
|
|
// Sebastien Pouliot <[email protected]>
|
|
//
|
|
// (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
|
|
// (C) 2004 Novell (http://www.novell.com)
|
|
//
|
|
|
|
using System.Runtime.InteropServices;
|
|
using System.Xml;
|
|
|
|
namespace System.Security.Cryptography.Xml {
|
|
|
|
public abstract class Transform {
|
|
|
|
private string algo;
|
|
|
|
public Transform () {}
|
|
|
|
public string Algorithm {
|
|
get { return algo; }
|
|
set { algo = value; }
|
|
}
|
|
|
|
public abstract Type[] InputTypes {
|
|
get;
|
|
}
|
|
|
|
public abstract Type[] OutputTypes {
|
|
get;
|
|
}
|
|
|
|
protected abstract XmlNodeList GetInnerXml ();
|
|
|
|
public abstract object GetOutput ();
|
|
|
|
public abstract object GetOutput (Type type);
|
|
|
|
public XmlElement GetXml ()
|
|
{
|
|
XmlDocument document = new XmlDocument ();
|
|
XmlElement xel = document.CreateElement (XmlSignature.ElementNames.Transform, XmlSignature.NamespaceURI);
|
|
xel.SetAttribute (XmlSignature.AttributeNames.Algorithm, algo);
|
|
XmlNodeList xnl = this.GetInnerXml ();
|
|
if (xnl != null) {
|
|
foreach (XmlNode xn in xnl) {
|
|
XmlNode importedNode = document.ImportNode (xn, true);
|
|
xel.AppendChild (importedNode);
|
|
}
|
|
}
|
|
return xel;
|
|
}
|
|
|
|
public abstract void LoadInnerXml (XmlNodeList nodeList);
|
|
|
|
public abstract void LoadInput (object obj);
|
|
|
|
#if ! NET_1_0
|
|
private XmlResolver xmlResolver;
|
|
|
|
[ComVisible(false)]
|
|
public XmlResolver Resolver {
|
|
set { xmlResolver = value; }
|
|
}
|
|
|
|
internal XmlResolver GetResolver ()
|
|
{
|
|
return xmlResolver;
|
|
}
|
|
#endif
|
|
}
|
|
}
|