diff options
author | Sebastien Pouliot <sebastien@ximian.com> | 2004-05-12 18:21:25 +0400 |
---|---|---|
committer | Sebastien Pouliot <sebastien@ximian.com> | 2004-05-12 18:21:25 +0400 |
commit | 0a2dad82d7ace18e4c3ff3d387bd450fdfce6493 (patch) | |
tree | 5912543f5d0bbefee68f32bb9c9c42b9651b0b9f /mcs/class/Mono.Security/Mono.Security.X509 | |
parent | 38c5d018ae3f0b4def7678109d26df2fb56dd9ba (diff) |
2004-05-12 Jesper Pedersen <jep@itplus.dk>
* PKCS12.cs: Removed file exists check from SaveToFile(). Removed
Equals() and GetHashCode(). Clone the original iteration count.
svn path=/trunk/mcs/; revision=27166
Diffstat (limited to 'mcs/class/Mono.Security/Mono.Security.X509')
-rw-r--r-- | mcs/class/Mono.Security/Mono.Security.X509/ChangeLog | 5 | ||||
-rwxr-xr-x | mcs/class/Mono.Security/Mono.Security.X509/PKCS12.cs | 27 |
2 files changed, 11 insertions, 21 deletions
diff --git a/mcs/class/Mono.Security/Mono.Security.X509/ChangeLog b/mcs/class/Mono.Security/Mono.Security.X509/ChangeLog index 93ece5c105d..912262b7db4 100644 --- a/mcs/class/Mono.Security/Mono.Security.X509/ChangeLog +++ b/mcs/class/Mono.Security/Mono.Security.X509/ChangeLog @@ -1,3 +1,8 @@ +2004-05-12 Jesper Pedersen <jep@itplus.dk> + + * PKCS12.cs: Removed file exists check from SaveToFile(). Removed + Equals() and GetHashCode(). Clone the original iteration count. + 2004-05-06 Jesper Pedersen <jep@itplus.dk> * PKCS12.cs: Fixed synchronization with X509CertificateCollection in diff --git a/mcs/class/Mono.Security/Mono.Security.X509/PKCS12.cs b/mcs/class/Mono.Security/Mono.Security.X509/PKCS12.cs index 03e01122d8c..37f7106b365 100755 --- a/mcs/class/Mono.Security/Mono.Security.X509/PKCS12.cs +++ b/mcs/class/Mono.Security/Mono.Security.X509/PKCS12.cs @@ -1649,10 +1649,6 @@ namespace Mono.Security.X509 { if (filename == null) throw new ArgumentNullException ("filename"); - if (File.Exists (filename)) { - File.Delete (filename); - } - using (FileStream fs = File.OpenWrite (filename)) { byte[] data = GetBytes (); fs.Write (data, 0, data.Length); @@ -1663,26 +1659,15 @@ namespace Mono.Security.X509 { public object Clone () { + PKCS12 clone = null; if (_password != null) { - return new PKCS12 (GetBytes (), Encoding.BigEndianUnicode.GetString (_password)); + clone = new PKCS12 (GetBytes (), Encoding.BigEndianUnicode.GetString (_password)); + } else { + clone = new PKCS12 (GetBytes ()); } - return new PKCS12 (GetBytes ()); - } - - public override bool Equals (object o) - { - if (o == null) return false; + clone.IterationCount = this.IterationCount; - PKCS12 p = (o as PKCS12); - if (p == null) - return false; - - return Compare (GetBytes (), p.GetBytes ()); - } - - public override int GetHashCode () - { - return GetBytes ().GetHashCode (); + return clone; } // static methods |