2 // SignatureKey.cs: Handles WS-Security SignatureKey
5 // Sebastien Pouliot (spouliot@motus.com)
7 // (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
9 // Licensed under MIT X11 (see LICENSE) with this specific addition:
11 // “This source code may incorporate intellectual property owned by Microsoft
12 // Corporation. Our provision of this source code does not include any licenses
13 // or any other rights to you under any Microsoft intellectual property. If you
14 // would like a license from Microsoft (e.g. rebrand, redistribute), you need
15 // to contact Microsoft directly.”
18 using System
.Security
.Cryptography
;
20 using System
.Security
.Cryptography
.Xml
;
22 namespace Microsoft
.Web
.Services
.Security
{
24 public class SignatureKey
{
26 private AsymmetricAlgorithm asymKey
;
27 private SymmetricAlgorithm symKey
;
29 public SignatureKey (AsymmetricAlgorithm key
)
34 public SignatureKey (SymmetricAlgorithm key
)
39 public virtual void ComputeSignature (SignedXml signedXml
)
41 if (asymKey
!= null) {
42 signedXml
.SigningKey
= asymKey
;
43 signedXml
.ComputeSignature ();
46 HMACSHA1 hmac
= new HMACSHA1 (symKey
.Key
);
47 signedXml
.ComputeSignature (hmac
);