2005-04-26 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Tue, 26 Apr 2005 18:52:43 +0000 (18:52 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Tue, 26 Apr 2005 18:52:43 +0000 (18:52 -0000)
* AlgorithmIdentifier.cs: Removed FIXME - seems "by design".
* ContentInfo.cs: Applied fix for ArgumentNullException (was fixed in
beta2).
* Pkcs9ContentType.cs: Added new override for CopyFrom.
* Pkcs9DocumentDescription.cs: Added new override for CopyFrom.
Applied fix for ArgumentNullException (was fixed in beta2).
* Pkcs9DocumentName.cs: Added new override for CopyFrom.
Applied fix for ArgumentNullException (was fixed in beta2).
* Pkcs9MessageDigest.cs: Added new override for CopyFrom.
* Pkcs9SigningTime.cs: Added new override for CopyFrom.

svn path=/trunk/mcs/; revision=43615

mcs/class/System.Security/System.Security.Cryptography.Pkcs/AlgorithmIdentifier.cs
mcs/class/System.Security/System.Security.Cryptography.Pkcs/ChangeLog
mcs/class/System.Security/System.Security.Cryptography.Pkcs/ContentInfo.cs
mcs/class/System.Security/System.Security.Cryptography.Pkcs/Pkcs9ContentType.cs
mcs/class/System.Security/System.Security.Cryptography.Pkcs/Pkcs9DocumentDescription.cs
mcs/class/System.Security/System.Security.Cryptography.Pkcs/Pkcs9DocumentName.cs
mcs/class/System.Security/System.Security.Cryptography.Pkcs/Pkcs9MessageDigest.cs
mcs/class/System.Security/System.Security.Cryptography.Pkcs/Pkcs9SigningTime.cs

index 44b4eaaa97a2f3db8c7c8f59f25b855dc531a370..62ebcb640f8b3223f9da8984d6acbd0645f8f0b7 100755 (executable)
@@ -5,7 +5,7 @@
 //     Sebastien Pouliot  <sebastien@ximian.com>
 //
 // (C) 2003 Motus Technologies Inc. (http://www.motus.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -29,8 +29,6 @@
 
 #if NET_2_0
 
-using System;
-
 namespace System.Security.Cryptography.Pkcs {
 
        public sealed class AlgorithmIdentifier {
@@ -41,16 +39,20 @@ namespace System.Security.Cryptography.Pkcs {
 
                // constructors
 
-               public AlgorithmIdentifier () : this (new Oid ("1.2.840.113549.3.7", "3des")) {}
+               public AlgorithmIdentifier ()
+               {
+                       _oid = new Oid ("1.2.840.113549.3.7", "3des");
+                       _params = new byte [0];
+               }
 
-               public AlgorithmIdentifier (Oid algorithm) : this (algorithm, 0) {}
+               public AlgorithmIdentifier (Oid algorithm)
+               {
+                       _oid = algorithm;
+                       _params = new byte [0];
+               }
 
                public AlgorithmIdentifier (Oid algorithm, int keyLength)
                {
-// FIXME: compatibility with fx 1.2.3400.0
-//                     if (algorithm == null)
-//                             throw new ArgumentNullException ("algorithm");
-
                        _oid = algorithm;
                        _length = keyLength;
                        _params = new byte [0];
index 6cba928700cf118029595cf48d08b2d56ccd350c..3dcf83637ca06092bab99ee16bc911546e156b86 100755 (executable)
@@ -1,3 +1,16 @@
+2005-04-26  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * AlgorithmIdentifier.cs: Removed FIXME - seems "by design".
+       * ContentInfo.cs: Applied fix for ArgumentNullException (was fixed in 
+       beta2).
+       * Pkcs9ContentType.cs: Added new override for CopyFrom.
+       * Pkcs9DocumentDescription.cs: Added new override for CopyFrom. 
+       Applied fix for ArgumentNullException (was fixed in beta2).
+       * Pkcs9DocumentName.cs: Added new override for CopyFrom. 
+       Applied fix for ArgumentNullException (was fixed in beta2).
+       * Pkcs9MessageDigest.cs: Added new override for CopyFrom.
+       * Pkcs9SigningTime.cs: Added new override for CopyFrom.
+
 2005-04-25  Sebastien Pouliot  <sebastien@ximian.com>
 
        * SignedCms.cs: Fix compiler warning (unused variable).
index b5e9d25162e797f50d32ed135d11a5e0ab70b7a5..66e111bd9a4fa856e3cc6136041dbb1be1f4a72f 100755 (executable)
@@ -86,10 +86,9 @@ namespace System.Security.Cryptography.Pkcs {
                [MonoTODO("Incomplete OID support")]
                public static Oid GetContentType (byte[] encodedMessage)
                {
-// FIXME: compatibility with fx 1.2.3400.0
                        if (encodedMessage == null)
-                               throw new NullReferenceException ();
-//                             throw new ArgumentNullException ("algorithm");
+                               throw new ArgumentNullException ("algorithm");
+
                        try {
                                PKCS7.ContentInfo ci = new PKCS7.ContentInfo (encodedMessage);
                                switch (ci.ContentType) {
index 7cf9b2b416ce28a5869cbdbcbcd54f5a28ce96c5..015164ab671d08e1330ba9ab758d425032053c3b 100755 (executable)
@@ -71,6 +71,14 @@ namespace System.Security.Cryptography.Pkcs {
                        get { return _contentType; }
                }
 
+               // methods
+
+               public override void CopyFrom (AsnEncodedData asnEncodedData)
+               {
+                       base.CopyFrom (asnEncodedData);
+                       Decode (this.RawData);
+               }
+
                // internal stuff
 
                internal void Decode (byte[] attribute)
index b52e42e453938416e6f858399f08f2ad5394b199..5fa64fe964d1772072dec544126dd1553bfeda0e 100755 (executable)
@@ -51,8 +51,7 @@ namespace System.Security.Cryptography.Pkcs {
                public Pkcs9DocumentDescription (string documentDescription)
                {
                        if (documentDescription == null)
-                               throw new NullReferenceException ("documentName");
-// match MS                    throw new ArgumentNullException ("documentName");
+                               throw new ArgumentNullException ("documentName");
 
                        (this as AsnEncodedData).Oid = new Oid (oid, friendlyName);
                        _desc = documentDescription;
@@ -73,6 +72,12 @@ namespace System.Security.Cryptography.Pkcs {
                        get { return _desc; }
                }
 
+               public override void CopyFrom (AsnEncodedData asnEncodedData)
+               {
+                       base.CopyFrom (asnEncodedData);
+                       Decode (this.RawData);
+               }
+
                // internal stuff
 
                internal void Decode (byte[] attribute)
index b083067d31523fb0fcdd9bb174f02ff45cd88190..0d8b910205acd87f1abe574d6f2898f46b2916f5 100755 (executable)
@@ -51,8 +51,7 @@ namespace System.Security.Cryptography.Pkcs {
                public Pkcs9DocumentName (string documentName) 
                {
                        if (documentName == null)
-                               throw new NullReferenceException ("documentName");
-// match MS                    throw new ArgumentNullException ("documentName");
+                               throw new ArgumentNullException ("documentName");
 
                        (this as AsnEncodedData).Oid = new Oid (oid, friendlyName);
                        _name = documentName;
@@ -73,6 +72,12 @@ namespace System.Security.Cryptography.Pkcs {
                        get { return _name; }
                }
 
+               public override void CopyFrom (AsnEncodedData asnEncodedData)
+               {
+                       base.CopyFrom (asnEncodedData);
+                       Decode (this.RawData);
+               }
+
                // internal stuff
 
                internal void Decode (byte[] attribute)
index 1307c920b75e1c033456914f91d526f60a86dcbb..eef1f7f36021130b6764ae964bbb84774b7b6c54 100755 (executable)
@@ -70,6 +70,14 @@ namespace System.Security.Cryptography.Pkcs {
                        get { return _messageDigest; }
                }
 
+               // methods
+
+               public override void CopyFrom (AsnEncodedData asnEncodedData)
+               {
+                       base.CopyFrom (asnEncodedData);
+                       Decode (this.RawData);
+               }
+
                // internal stuff
 
                internal void Decode (byte[] attribute)
index 59e28f6178de3b4ec305aa297a0290b707414186..e2df1870ac048807df0c4657b5c992daa3c2f2d9 100755 (executable)
@@ -72,6 +72,12 @@ namespace System.Security.Cryptography.Pkcs {
                        get { return _signingTime; }
                }
 
+               public override void CopyFrom (AsnEncodedData asnEncodedData)
+               {
+                       base.CopyFrom (asnEncodedData);
+                       Decode (this.RawData);
+               }
+
                // internal stuff
 
                internal void Decode (byte[] attribute)