* KeyInfo.cs: Changed some protected declaration to private.
* KeyInfoName.cs: Changed some protected declaration to private.
* KeyInfoNode.cs: Changed some protected declaration to private.
* KeyInfoRetrievalMethod.cs: Changed some protected declaration to private.
* KeyInfoX509Data.cs: Changed some protected declaration to private.
* Transform.cs: Changed some protected declaration to private.
* XmlDsigBase64Transform.cs: Changed some protected declaration to private.
* XmlDsigC14NTransform.cs: Changed some protected declaration to private.
* XmlDsigC14NWithCommentsTransform.cs: Changed some protected declaration to private.
* XmlDsigEnvelopedSignatureTransform.cs: Changed some protected declaration to private.
* XmlDsigXPathTransform.cs: Changed some protected declaration to private.
* XmlDsigXsltTransform.cs: Changed some protected declaration to private.
svn path=/trunk/mcs/; revision=10636
+2003-01-17 Sebastien Pouliot <spouliot@videotron.ca>
+
+ * KeyInfo.cs: Changed some protected declaration to private.
+ * KeyInfoName.cs: Changed some protected declaration to private.
+ * KeyInfoNode.cs: Changed some protected declaration to private.
+ * KeyInfoRetrievalMethod.cs: Changed some protected declaration to private.
+ * KeyInfoX509Data.cs: Changed some protected declaration to private.
+ * Transform.cs: Changed some protected declaration to private.
+ * XmlDsigBase64Transform.cs: Changed some protected declaration to private.
+ * XmlDsigC14NTransform.cs: Changed some protected declaration to private.
+ * XmlDsigC14NWithCommentsTransform.cs: Changed some protected declaration to private.
+ * XmlDsigEnvelopedSignatureTransform.cs: Changed some protected declaration to private.
+ * XmlDsigXPathTransform.cs: Changed some protected declaration to private.
+ * XmlDsigXsltTransform.cs: Changed some protected declaration to private.
+
2002-11-28 Sebastien Pouliot <spouliot@videotron.ca>
* TODOAttribute.cs: New. Still much to do ;-)
static private string xmldsig = "http://www.w3.org/2000/09/xmldsig#";
- protected ArrayList Info;
- protected string id;
+ private ArrayList Info;
+ private string id;
public KeyInfo()
{
public class KeyInfoName : KeyInfoClause {
- protected string Name;
+ private string Name;
public KeyInfoName() {}
public class KeyInfoNode : KeyInfoClause {
- protected XmlElement Node;
+ private XmlElement Node;
public KeyInfoNode () {}
public class KeyInfoRetrievalMethod : KeyInfoClause {
- protected string URI;
+ private string URI;
public KeyInfoRetrievalMethod () {}
public class KeyInfoX509Data : KeyInfoClause {
- protected byte[] x509crl;
- protected ArrayList IssuerSerialList;
- protected ArrayList SubjectKeyIdList;
- protected ArrayList SubjectNameList;
- protected ArrayList X509CertificateList;
+ private byte[] x509crl;
+ private ArrayList IssuerSerialList;
+ private ArrayList SubjectKeyIdList;
+ private ArrayList SubjectNameList;
+ private ArrayList X509CertificateList;
public KeyInfoX509Data ()
{
return doc.DocumentElement;
}
- public override void LoadXml (XmlElement value)
+ public override void LoadXml (XmlElement element)
{
- if (value == null)
- throw new ArgumentNullException ();
+ if (element == null)
+ throw new ArgumentNullException ("element");
IssuerSerialList.Clear ();
SubjectKeyIdList.Clear ();
x509crl = null;
string ns = "http://www.w3.org/2000/09/xmldsig#";
- if ((value.LocalName == "X509Data") && (value.NamespaceURI == ns)) {
+ if ((element.LocalName == "X509Data") && (element.NamespaceURI == ns)) {
XmlNodeList xnl = null;
// <X509IssuerSerial>
- xnl = value.GetElementsByTagName ("X509IssuerSerial", ns);
+ xnl = element.GetElementsByTagName ("X509IssuerSerial", ns);
if (xnl != null) {
for (int i=0; i < xnl.Count; i++) {
XmlElement xel = (XmlElement) xnl[i];
}
}
// <X509SKI>
- xnl = value.GetElementsByTagName ("X509SKI", ns);
+ xnl = element.GetElementsByTagName ("X509SKI", ns);
if (xnl != null) {
for (int i=0; i < xnl.Count; i++) {
byte[] skid = Convert.FromBase64String (xnl[i].InnerXml);
}
}
// <X509SubjectName>
- xnl = value.GetElementsByTagName ("X509SubjectName", ns);
+ xnl = element.GetElementsByTagName ("X509SubjectName", ns);
if (xnl != null) {
for (int i=0; i < xnl.Count; i++) {
AddSubjectName (xnl[i].InnerXml);
}
}
// <X509Certificate>
- xnl = value.GetElementsByTagName ("X509Certificate", ns);
+ xnl = element.GetElementsByTagName ("X509Certificate", ns);
if (xnl != null) {
for (int i=0; i < xnl.Count; i++) {
byte[] cert = Convert.FromBase64String (xnl[i].InnerXml);
}
}
// only one <X509CRL>
- xnl = value.GetElementsByTagName ("X509CRL", ns);
+ xnl = element.GetElementsByTagName ("X509CRL", ns);
if ((xnl != null) && (xnl.Count > 0)) {
x509crl = Convert.FromBase64String (xnl[0].InnerXml);
}
}
else
- throw new CryptographicException ("value");
+ throw new CryptographicException ("element");
}
}
public abstract class Transform {
- protected string algo;
- protected Type[] input;
- protected Type[] output;
+ private string algo;
public Transform () {}
// http://www.w3.org/2000/09/xmldsig#base64
public class XmlDsigBase64Transform : Transform {
+ private Type[] input;
+ private Type[] output;
private CryptoStream cs;
public XmlDsigBase64Transform ()
{
- algo = "http://www.w3.org/2000/09/xmldsig#base64";
+ Algorithm = "http://www.w3.org/2000/09/xmldsig#base64";
}
public override Type[] InputTypes {
//
using System.IO;
+using System.Text;
using System.Xml;
namespace System.Security.Cryptography.Xml {
public class XmlDsigC14NTransform : Transform {
- protected bool comments;
+ private Type[] input;
+ private Type[] output;
+ private bool comments;
+ private Stream s;
public XmlDsigC14NTransform ()
{
+ Algorithm = "http://www.w3.org/TR/2001/REC-xml-c14n-20010315";
comments = false;
}
public override object GetOutput ()
{
-// return (object) new Stream ();
- return null;
+ return (object) s;
}
public override object GetOutput (Type type)
public override void LoadInnerXml (XmlNodeList nodeList)
{
- // NO CHANGE
+ // documented as not changing the state of the transform
}
public override void LoadInput (object obj)
{
- // if (type.Equals (Stream.GetType ())
+ XmlNodeList xnl = null;
+
+ if (obj is Stream)
+ s = (obj as Stream);
+ else if (obj is XmlDocument)
+ xnl = (obj as XmlDocument).ChildNodes;
+ else if (obj is XmlNodeList)
+ xnl = (XmlNodeList) obj;
+
+ if (xnl != null) {
+ StringBuilder sb = new StringBuilder ();
+ foreach (XmlNode xn in xnl)
+ sb.Append (xn.InnerText);
+
+ UTF8Encoding utf8 = new UTF8Encoding ();
+ byte[] data = utf8.GetBytes (sb.ToString ());
+ s = new MemoryStream (data);
+ }
+
+ // note: there is no default are other types won't throw an exception
}
}
public class XmlDsigEnvelopedSignatureTransform : Transform {
- protected bool comments;
+ private Type[] input;
+ private Type[] output;
+ private bool comments;
public XmlDsigEnvelopedSignatureTransform ()
{
// see Section 6.6.3 of the XMLDSIG specification
public class XmlDsigXPathTransform : Transform {
+ private Type[] input;
+ private Type[] output;
private XmlNodeList xnl;
private XmlNodeList xpathNodes;
public class XmlDsigXsltTransform : Transform {
+ private Type[] input;
+ private Type[] output;
private bool comments;
private XmlNodeList xnl;
private CryptoStream cs;
public XmlDsigXsltTransform (bool includeComments)
{
comments = includeComments;
- algo = "http://www.w3.org/TR/1999/REC-xslt-19991116";
+ Algorithm = "http://www.w3.org/TR/1999/REC-xslt-19991116";
}
public override Type[] InputTypes {