X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FMono.Security%2FMono.Security.X509.Extensions%2FAuthorityKeyIdentifierExtension.cs;h=858ee1e7e59895c7cbe55cee79deb47da343127c;hb=99b5aad5ee74b270b33e3779cf14cf18d847db50;hp=193014698225489d57e5ef6b551652569b654e8d;hpb=1c14f1ee6d701510c15499d71fc2b324151a8629;p=mono.git diff --git a/mcs/class/Mono.Security/Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs b/mcs/class/Mono.Security/Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs index 19301469822..858ee1e7e59 100644 --- a/mcs/class/Mono.Security/Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs +++ b/mcs/class/Mono.Security/Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs @@ -4,7 +4,7 @@ // Author: // Sebastien Pouliot // -// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com) +// Copyright (C) 2004-2005,2007 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 @@ -46,7 +46,12 @@ namespace Mono.Security.X509.Extensions { * KeyIdentifier ::= OCTET STRING */ - public class AuthorityKeyIdentifierExtension : X509Extension { +#if INSIDE_SYSTEM + internal +#else + public +#endif + class AuthorityKeyIdentifierExtension : X509Extension { private byte[] aki; @@ -74,14 +79,26 @@ namespace Mono.Security.X509.Extensions { case 0x80: aki = el.Value; break; - case 0x81: - case 0x82: default: - throw new ArgumentException ("Invalid AuthorityKeyIdentifier extension"); + // don't throw on stuff we don't yet support + // e.g. authorityCertIssuer/authorityCertSerialNumber + break; } } } + protected override void Encode () + { + ASN1 seq = new ASN1 (0x30); + if (aki == null) { + throw new InvalidOperationException ("Invalid AuthorityKeyIdentifier extension"); + } + + seq.Add (new ASN1 (0x80, aki)); + extnValue = new ASN1 (0x04); + extnValue.Add (seq); + } + public override string Name { get { return "Authority Key Identifier"; } } @@ -92,6 +109,7 @@ namespace Mono.Security.X509.Extensions { return null; return (byte[]) aki.Clone (); } + set { aki = value; } } public override string ToString ()