//-----------------------------------------------------------------------
//
// Copyright (c) Outercurve Foundation. All rights reserved.
//
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.OpenId.Messages {
using System;
using System.Diagnostics.Contracts;
using System.Security.Cryptography;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Reflection;
using Org.Mentalis.Security.Cryptography;
///
/// The successful Diffie-Hellman association response message.
///
///
/// Association response messages are described in OpenID 2.0 section 8.2. This type covers section 8.2.3.
///
internal abstract class AssociateDiffieHellmanResponse : AssociateSuccessfulResponse {
///
/// Initializes a new instance of the class.
///
/// The OpenID version of the response message.
/// The originating request.
internal AssociateDiffieHellmanResponse(Version responseVersion, AssociateDiffieHellmanRequest originatingRequest)
: base(responseVersion, originatingRequest) {
}
///
/// Gets or sets the Provider's Diffie-Hellman public key.
///
/// btwoc(g ^ xb mod p)
[MessagePart("dh_server_public", IsRequired = true, AllowEmpty = false)]
internal byte[] DiffieHellmanServerPublic { get; set; }
///
/// Gets or sets the MAC key (shared secret), encrypted with the secret Diffie-Hellman value.
///
/// H(btwoc(g ^ (xa * xb) mod p)) XOR MAC key. H is either "SHA1" or "SHA256" depending on the session type.
[MessagePart("enc_mac_key", IsRequired = true, AllowEmpty = false)]
internal byte[] EncodedMacKey { get; set; }
}
}