public CASTRequestParams(AppProvisioningInfo provInfo, ICryptographer cryptographer)
        {            
            provInfo.ValidateRequired("provInfo");
            cryptographer.ValidateRequired("cryptographer");
            //
            // To create a session, we prove our possesion of the app shared secret
            // We do this by creating an HMAC of some HmacContent
            //
            HmacContent content = new HmacContent(provInfo.AppIdInstance, cryptographer.HmacAlgorithm);
            string xmlContent = content.ToXml();
            Hmac hmac = cryptographer.Hmac(provInfo.SharedSecret, xmlContent);

            this.AppIDInstance = provInfo.AppIdInstance;
            this.Credential = new CASTCredential(hmac, content);
        }
예제 #2
0
 public CASTCredential(Hmac hmac, HmacContent content)
 {
     this.Hmac = new HmacCredential(hmac, content);
 }