summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenId/RelyingParty/AssociateResponse.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-08-13 04:25:00 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2008-08-13 04:25:00 -0700
commitfd6acdc9b14b51fc0bf4c1b4fa815cc1f0d7ce26 (patch)
treea345806393382207e9d75a14f820457906f5878e /src/DotNetOpenId/RelyingParty/AssociateResponse.cs
parentba48275ccaae1218b1e8574029f7e009eb3f8735 (diff)
downloadDotNetOpenAuth-fd6acdc9b14b51fc0bf4c1b4fa815cc1f0d7ce26.zip
DotNetOpenAuth-fd6acdc9b14b51fc0bf4c1b4fa815cc1f0d7ce26.tar.gz
DotNetOpenAuth-fd6acdc9b14b51fc0bf4c1b4fa815cc1f0d7ce26.tar.bz2
Made HMAC-SHA association types a table instead of several classes.
Diffstat (limited to 'src/DotNetOpenId/RelyingParty/AssociateResponse.cs')
-rw-r--r--src/DotNetOpenId/RelyingParty/AssociateResponse.cs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/DotNetOpenId/RelyingParty/AssociateResponse.cs b/src/DotNetOpenId/RelyingParty/AssociateResponse.cs
index 3652b1c..d55a64f 100644
--- a/src/DotNetOpenId/RelyingParty/AssociateResponse.cs
+++ b/src/DotNetOpenId/RelyingParty/AssociateResponse.cs
@@ -56,14 +56,13 @@ namespace DotNetOpenId.RelyingParty {
string assocHandle = Util.GetRequiredArg(Args, Protocol.openidnp.assoc_handle);
TimeSpan expiresIn = new TimeSpan(0, 0, Convert.ToInt32(Util.GetRequiredArg(Args, Protocol.openidnp.expires_in), CultureInfo.InvariantCulture));
- if (assoc_type == Protocol.Args.SignatureAlgorithm.HMAC_SHA1) {
- Association = new HmacSha1Association(assocHandle, secret, expiresIn);
- } else if (assoc_type == Protocol.Args.SignatureAlgorithm.HMAC_SHA256) {
- Association = new HmacSha256Association(assocHandle, secret, expiresIn);
- } else {
+ try {
+ Association = HmacShaAssociation.Create(Protocol, assoc_type,
+ assocHandle, secret, expiresIn);
+ } catch (ArgumentException ex) {
throw new OpenIdException(string.Format(CultureInfo.CurrentCulture,
Strings.InvalidOpenIdQueryParameterValue,
- Protocol.openid.assoc_type, assoc_type));
+ Protocol.openid.assoc_type, assoc_type), ex);
}
} else {
throw new OpenIdException(string.Format(CultureInfo.CurrentCulture,