diff options
author | Sebastien Pouliot <sebastien@ximian.com> | 2004-07-15 23:30:58 +0400 |
---|---|---|
committer | Sebastien Pouliot <sebastien@ximian.com> | 2004-07-15 23:30:58 +0400 |
commit | 97a8b657ada50c1b588a4fd3fc12349655a19a9d (patch) | |
tree | 58bfa176831d08aaaa8fe72d495d3eadf245a7cf /mcs/class/Mono.Security | |
parent | 8fe07643247b2c014d56e5f2252eb74a04ec8eb4 (diff) |
2004-07-15 Sebastien Pouliot <sebastien@ximian.com>
* KeyUsageExtension.cs: Added Encode to extension so it can be used
by makecert. Fix bug # 61240. Patch provided by Ianier Munoz.
svn path=/branches/mono-1-0/mcs/; revision=31195
Diffstat (limited to 'mcs/class/Mono.Security')
-rw-r--r-- | mcs/class/Mono.Security/Mono.Security.X509.Extensions/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/Mono.Security/Mono.Security.X509.Extensions/KeyUsageExtension.cs | 17 |
2 files changed, 22 insertions, 0 deletions
diff --git a/mcs/class/Mono.Security/Mono.Security.X509.Extensions/ChangeLog b/mcs/class/Mono.Security/Mono.Security.X509.Extensions/ChangeLog index f00dcacd041..b8d2dc9942e 100644 --- a/mcs/class/Mono.Security/Mono.Security.X509.Extensions/ChangeLog +++ b/mcs/class/Mono.Security/Mono.Security.X509.Extensions/ChangeLog @@ -1,3 +1,8 @@ +2004-07-15 Sebastien Pouliot <sebastien@ximian.com> + + * KeyUsageExtension.cs: Added Encode to extension so it can be used + by makecert. Fix bug # 61240. Patch provided by Ianier Munoz. + 2004-04-28 Sebastien Pouliot <sebastien@ximian.com> * KeyUsageExtension.cs: Added missing INSIDE_CORLIB to enum. diff --git a/mcs/class/Mono.Security/Mono.Security.X509.Extensions/KeyUsageExtension.cs b/mcs/class/Mono.Security/Mono.Security.X509.Extensions/KeyUsageExtension.cs index a8c5553ed58..0c5d3b0cf38 100644 --- a/mcs/class/Mono.Security/Mono.Security.X509.Extensions/KeyUsageExtension.cs +++ b/mcs/class/Mono.Security/Mono.Security.X509.Extensions/KeyUsageExtension.cs @@ -86,6 +86,11 @@ namespace Mono.Security.X509.Extensions { public KeyUsageExtension (X509Extension extension) : base (extension) {} + public KeyUsageExtension () : base () + { + extnOid = "2.5.29.15"; + } + protected override void Decode () { ASN1 bitString = new ASN1 (extnValue.Value); @@ -96,6 +101,18 @@ namespace Mono.Security.X509.Extensions { kubits = (kubits << 8) + bitString.Value [i++]; } + protected override void Encode () + { + if (extnValue == null) { + extnValue = new ASN1 (0x03, new byte[] { 0x00, (byte)kubits }); + } + } + + public KeyUsages KeyUsage { + get { return (KeyUsages) kubits; } + set { kubits = Convert.ToInt32 (value, CultureInfo.InvariantCulture); } + } + public override string Name { get { return "Key Usage"; } } |