<HTML xmlns:o><HEAD><TITLE>Samsung Enterprise Portal mySingle</TITLE>
<META content=IE=5 http-equiv=X-UA-Compatible>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<STYLE id=mysingle_style type=text/css>P {
MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt; FONT-FAMILY: Arial, arial; MARGIN-TOP: 5px
}
TD {
MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt; FONT-FAMILY: Arial, arial; MARGIN-TOP: 5px
}
LI {
MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt; FONT-FAMILY: Arial, arial; MARGIN-TOP: 5px
}
BODY {
FONT-SIZE: 9pt; FONT-FAMILY: Arial, arial; MARGIN: 10px; LINE-HEIGHT: 1.4
}
</STYLE>
<META name=GENERATOR content=ActiveSquare></HEAD>
<BODY>
<P>Hi Ryan/Stefan,</P>
<P> </P>
<P>I went through the code part in crypto.js and on understanding how they calculated the Payload hash, I replicated the code part in my implementation. </P>
<P> </P>
<P>Now I am able to get successful certificate.</P>
<P> </P>
<P>Thanks a lot for your guidance :)</P>
<P> </P>
<P>Regards,</P>
<P>Manoj</P>
<P> </P>
<P> </P>
<P>------- <B>Original Message</B> -------</P>
<P><B>Sender</B> : Stefan Arentz<sarentz@mozilla.com></P>
<P><B>Date</B> : Oct 20, 2014 19:39 (GMT+05:30)</P>
<P><B>Title</B> : Re: Error in POST /v1/certificate/sign response.</P>
<P> </P><BR>
<DIV>
<BLOCKQUOTE type="cite">
<DIV>On Oct 20, 2014, at 8:26 AM, Manoj Kumar S <<A href="mailto:manojkumar.s@samsung.com">manojkumar.s@samsung.com</A>> wrote:</DIV><BR class=Apple-interchange-newline>
<DIV>
<P style="MARGIN-BOTTOM: 5px; WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; FONT: 12px/16px Arial, arial; MARGIN-TOP: 5px; LETTER-SPACING: normal; TEXT-INDENT: 0px; -webkit-text-stroke-width: 0px">Hi Ryan/ Stefan,<o:p></o:p></P>
<P style="MARGIN-BOTTOM: 5px; WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; FONT: 12px/16px Arial, arial; MARGIN-TOP: 5px; LETTER-SPACING: normal; TEXT-INDENT: 0px; -webkit-text-stroke-width: 0px"> <o:p></o:p></P>
<P style="MARGIN-BOTTOM: 5px; WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; FONT: 12px/16px Arial, arial; MARGIN-TOP: 5px; LETTER-SPACING: normal; TEXT-INDENT: 0px; -webkit-text-stroke-width: 0px">I have built a local server, from your code in /example/usage.js of<SPAN class=Apple-converted-space> </SPAN><A href="https://github.com/hueniverse/hawk"><SPAN>https://github.com/hueniverse/hawk</SPAN></A><o:p></o:p></P>
<P style="MARGIN-BOTTOM: 5px; WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; FONT: 12px/16px Arial, arial; MARGIN-TOP: 5px; LETTER-SPACING: normal; TEXT-INDENT: 0px; -webkit-text-stroke-width: 0px">I debugged through the client and server code on how they calculate and validate the payload hash,<o:p></o:p></P>
<P style="MARGIN-BOTTOM: 5px; WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; FONT: 12px/16px Arial, arial; MARGIN-TOP: 5px; LETTER-SPACING: normal; TEXT-INDENT: 0px; -webkit-text-stroke-width: 0px">As far as I understood, the error message "Payload is Invalid", happens when server code compares the request hash ( sent as header by client ) with the generated<o:p></o:p></P>
<P style="MARGIN-BOTTOM: 5px; WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; FONT: 12px/16px Arial, arial; MARGIN-TOP: 5px; LETTER-SPACING: normal; TEXT-INDENT: 0px; -webkit-text-stroke-width: 0px">hash from payload.</P>
<DIV><BR></DIV></DIV></BLOCKQUOTE>
<DIV><BR></DIV></DIV>
<DIV>Here are some examples (in Objective-C) to show what unit tests could look like:</DIV>
<DIV><BR></DIV>
<DIV><A href="https://github.com/st3fan/bookmarks/blob/master/FirefoxAccountsTests/HawkCredentialsTest.m">https://github.com/st3fan/bookmarks/blob/master/FirefoxAccountsTests/HawkCredentialsTest.m</A></DIV>
<DIV><BR></DIV>
<DIV>These are unit tests in Java:</DIV>
<DIV><BR></DIV>
<DIV><A href="https://github.com/mozilla-services/android-sync/blob/develop/src/test/java/org/mozilla/gecko/sync/net/test/TestHawkAuthHeaderProvider.java">https://github.com/mozilla-services/android-sync/blob/develop/src/test/java/org/mozilla/gecko/sync/net/test/TestHawkAuthHeaderProvider.java</A></DIV>
<DIV><BR></DIV>
<DIV>Both tests use the example Hawk vectors from <A href="https://github.com/hueniverse/hawk/blob/master/README.md#protocol-example">https://github.com/hueniverse/hawk/blob/master/README.md#protocol-example</A></DIV>
<DIV><BR></DIV>
<DIV> S.</DIV>
<DIV><BR></DIV>
<P> </P><!--SP:manojkumar.s-->
<P>Thanks,<BR>Manoj</P><!--manojkumar.s:EP-->
<P> </P>
<TABLE id=confidentialsignimg>
<TBODY>
<TR>
<TD NAMO_LOCK>
<P><IMG border=0 src="cid:YKENUIXHLLKJ@namo.co.kr"></P></TD></TR></TBODY></TABLE></BODY></HTML><img src='http://ext.samsung.net/mailcheck/SeenTimeChecker?do=14f7afe1216e9674f9397f97ef03e5f8a2d05458db55902e86905d89a565a6e55ae294939dd64ac078b72e7a65da3d59720175c7c1788460326bbdfb2ea96a2fcf878f9a26ce15a0' border=0 width=0 height=0 style='display:none'>