2 // SignatureKey.cs: Handles WS-Security SignatureKey
\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
18 using System.Security.Cryptography;
\r
20 using System.Security.Cryptography.Xml;
\r
22 namespace Microsoft.Web.Services.Security {
\r
24 public class SignatureKey {
\r
26 private AsymmetricAlgorithm asymKey;
\r
27 private SymmetricAlgorithm symKey;
\r
29 public SignatureKey (AsymmetricAlgorithm key)
\r
34 public SignatureKey (SymmetricAlgorithm key)
\r
39 public virtual void ComputeSignature (SignedXml signedXml)
\r
41 if (asymKey != null) {
\r
42 signedXml.SigningKey = asymKey;
\r
43 signedXml.ComputeSignature ();
\r
46 HMACSHA1 hmac = new HMACSHA1 (symKey.Key);
\r
47 signedXml.ComputeSignature (hmac);
\r