• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Generate Shared Secret ?

Guest
Jun 20, 2011 Jun 20, 2011

Copy link to clipboard

Copied

I am creating service in C# wich creates new Distributor , i could not generate Distributor Shared Secret for distributor being created. Can anyone tell what is the formula for Generating Shared Scret ?

Thanks

Views

1.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 20, 2011 Jun 20, 2011

Copy link to clipboard

Copied

A shared secret is 20 bytes of binary data.  I would suggest using random data...  (and it is base64 encoded in the XML)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 20, 2011 Jun 20, 2011

Copy link to clipboard

Copied

Thanks Jim,

Here is my c# code for creating distributor:

Xml:

<request action="create" auth="builtin" xmlns="http://ns.adobe.com/adept">
  <nonce>rNfAkgAAAA4=</nonce>
  <expiration>2011-06-20T12:07:58-00:00</expiration>
  <distributorData>
    <name>Shafqat</name>
    <distributorURL>http://www.shafqat.com</distributorURL>
    <notifyURL>http://www.shafqat.com/notify</notifyURL>
    <description>description shfqat</description>
    <maxLoanCount>9</maxLoanCount>
    <linkExpiration>19</linkExpiration>
    <sharedSecret>Q1nKX1RjimoVy5jzayWcYXe4xuU=</sharedSecret>
  </distributorData>
  <hmac>8SnrEtwNnDoXF4r4e0g8y27fveo=</hmac>
</request>

C#:

            HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(new Uri("http://192.168.0.61:8080/admin/ManageDistributor"));
            request.Method = "POST";
            request.ContentType = "text/xml";

            StreamWriter writer = new StreamWriter(request.GetRequestStream());
            writer.Write(Encoding.UTF8.GetBytes(xml));
            writer.Close();

            HttpWebResponse webReaponse = (HttpWebResponse)request.GetResponse();
            StreamReader reader = new StreamReader(webReaponse.GetResponseStream());
            Response.Write(reader.ReadToEnd());
            reader.Close();

i could not get anything in response and niether distributor is created ? can you guess whats wrong with code?

Thanks, Shafqat.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 21, 2011 Jun 21, 2011

Copy link to clipboard

Copied

With no response at all I would suspect that your handling of the HTTPWebRequest class is off.  What happens when you use curl to do a post?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 21, 2011 Jun 21, 2011

Copy link to clipboard

Copied

Thanks Jim,

I am not using CURL. This is simple asp.net/C# (.net framwork 4.0) code. When i execute that i gives error about content type. Invalid content type.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 22, 2011 Jun 22, 2011

Copy link to clipboard

Copied

Oh so you are getting a response.  I had noticed that you are setting the Content-Type to 'text/xml' instead of the correct value "application/vnd.adobe.adept+xml" - you will want to fix that.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 22, 2011 Jun 22, 2011

Copy link to clipboard

Copied

LATEST

Jim i am very thankful to you for your quick response to my questions. My problem have been soleve .  it was a problem with generating hmac. i have got the solution. If anybody interested in C# version of UploadTool i will send the source code to him........

Thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines