// Author:
// Sebastien Pouliot <sebastien@ximian.com>
//
-// 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
* KeyIdentifier ::= OCTET STRING
*/
- public class AuthorityKeyIdentifierExtension : X509Extension {
+#if INSIDE_SYSTEM
+ internal
+#else
+ public
+#endif
+ class AuthorityKeyIdentifierExtension : X509Extension {
private byte[] aki;
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"; }
}
return null;
return (byte[]) aki.Clone ();
}
+ set { aki = value; }
}
public override string ToString ()