diff options
Diffstat (limited to 'src/DotNetOpenId/HmacShaAssociation.cs')
-rw-r--r-- | src/DotNetOpenId/HmacShaAssociation.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/DotNetOpenId/HmacShaAssociation.cs b/src/DotNetOpenId/HmacShaAssociation.cs index a754aca..dd66900 100644 --- a/src/DotNetOpenId/HmacShaAssociation.cs +++ b/src/DotNetOpenId/HmacShaAssociation.cs @@ -1,5 +1,6 @@ using System;
using System.Diagnostics;
+using System.Collections.Generic;
using System.Security.Cryptography;
namespace DotNetOpenId {
@@ -14,7 +15,7 @@ namespace DotNetOpenId { /// </summary>
internal int SecretLength { get { return BaseHashAlgorithm.HashSize / 8; } }
}
- static HmacSha[] HmacShaAssociationTypes = {
+ static HmacSha[] HmacShaAssociationTypes = new List<HmacSha> {
new HmacSha {
CreateHasher = secretKey => new HMACSHA512(secretKey),
GetAssociationType = protocol => protocol.Args.SignatureAlgorithm.HMAC_SHA512,
@@ -35,7 +36,7 @@ namespace DotNetOpenId { GetAssociationType = protocol => protocol.Args.SignatureAlgorithm.HMAC_SHA1,
BaseHashAlgorithm = new SHA1Managed(),
},
- };
+ }.ToArray();
public static HmacShaAssociation Create(Protocol protocol, string associationType,
string handle, byte[] secret, TimeSpan totalLifeLength) {
@@ -142,4 +143,4 @@ namespace DotNetOpenId { return typeIdentity.CreateHasher(SecretKey);
}
}
-}
\ No newline at end of file +}
|