Ejemplo n.º 1
0
 public FblRequestParameters(NameValueCollection queryParams)
 {
     if (!string.IsNullOrEmpty(queryParams["pd"]) && !ulong.TryParse(HttpUtility.UrlDecode(queryParams["pd"]), out this.Puid))
     {
         this.Puid = 0UL;
     }
     if (!string.IsNullOrEmpty(queryParams["aid"]))
     {
         this.PrimaryEmail = HttpUtility.UrlDecode(queryParams["aid"]);
     }
     this.CustomerGuid = new Guid(Convert.FromBase64String(AuthkeyAuthenticationRequest.UrlDecodeBase64String(queryParams["cid"])));
     this.MessageClass = HttpUtility.UrlDecode(queryParams["mc"]);
     this.MailGuid     = new Guid(Convert.FromBase64String(AuthkeyAuthenticationRequest.UrlDecodeBase64String(queryParams["mg"])));
     this.OptIn        = "1".Equals(queryParams["opt"]);
 }
Ejemplo n.º 2
0
 public SignedUrl(NameValueCollection queryString)
 {
     this.KeyVersion = byte.Parse(queryString["kv"], NumberFormatInfo.InvariantInfo);
     if (this.KeyVersion > 1)
     {
         this.PayloadType = (CryptoKeyPayloadType)int.Parse(queryString["pt"], NumberFormatInfo.InvariantInfo);
     }
     else
     {
         AuthkeyAuthenticationRequest.SignedUrl.LegacyPayloadType legacyPayloadType  = (AuthkeyAuthenticationRequest.SignedUrl.LegacyPayloadType) int.Parse(queryString["pt"], NumberFormatInfo.InvariantInfo);
         AuthkeyAuthenticationRequest.SignedUrl.LegacyPayloadType legacyPayloadType2 = legacyPayloadType;
         if (legacyPayloadType2 != AuthkeyAuthenticationRequest.SignedUrl.LegacyPayloadType.SvmFeedback)
         {
             throw new SecurityException("failed to parse query string collection");
         }
         this.PayloadType = CryptoKeyPayloadType.SvmFeedbackEncryption;
     }
     this.UtcTimestamp         = DateTime.FromFileTimeUtc(long.Parse(queryString["ts"], NumberFormatInfo.InvariantInfo));
     this.InitializationVector = Convert.FromBase64String(AuthkeyAuthenticationRequest.UrlDecodeBase64String(queryString["iv"]));
     this.Payload = Convert.FromBase64String(AuthkeyAuthenticationRequest.UrlDecodeBase64String(queryString["authKey"]));
     this.MessageAuthenticationCode = Convert.FromBase64String(AuthkeyAuthenticationRequest.UrlDecodeBase64String(queryString["hmac"]));
 }