2 // KeyIdentifier.cs: Handles WS-Security KeyIdentifier
\r
5 // Sebastien Pouliot (spouliot@motus.com)
\r
7 // (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
\r
9 // Licensed under MIT X11 (see LICENSE) with this specific addition:
\r
11 //
\93This source code may incorporate intellectual property owned by Microsoft
\r
12 // Corporation. Our provision of this source code does not include any licenses
\r
13 // or any other rights to you under any Microsoft intellectual property. If you
\r
14 // would like a license from Microsoft (e.g. rebrand, redistribute), you need
\r
15 // to contact Microsoft directly.
\94 \r
19 using System.Security.Cryptography.Xml;
\r
21 using Microsoft.Web.Services;
\r
22 using Microsoft.Web.Services.Xml;
\r
24 namespace Microsoft.Web.Services.Security {
\r
26 public class KeyIdentifier : IXmlElement {
\r
28 private byte[] kivalue;
\r
29 private XmlQualifiedName vtype;
\r
31 public KeyIdentifier (byte[] identifier)
\r
33 if (identifier == null)
\r
34 throw new ArgumentNullException ("identifier");
\r
35 kivalue = (byte[]) identifier.Clone ();
\r
38 public KeyIdentifier (XmlElement element)
\r
43 public KeyIdentifier (byte[] identifier, XmlQualifiedName valueType)
\r
45 if (identifier == null)
\r
46 throw new ArgumentNullException ("identifier");
\r
47 kivalue = (byte[]) identifier.Clone ();
\r
51 public byte[] Value {
\r
52 get { return (byte[]) kivalue.Clone (); }
\r
55 throw new ArgumentNullException ("value");
\r
60 public XmlQualifiedName ValueType {
\r
61 get { return vtype; }
\r
62 set { vtype = value; }
\r
65 public XmlElement GetXml (XmlDocument document)
\r
67 if (document == null)
\r
68 throw new ArgumentNullException ("document");
\r
72 public void LoadXml (XmlElement element)
\r
74 if ((element.LocalName != WSSecurity.ElementNames.KeyIdentifier) || (element.NamespaceURI != WSSecurity.NamespaceURI))
\r
75 throw new System.ArgumentException ("invalid LocalName or NamespaceURI");
\r