📄 facebooksignatureutil.html
字号:
</DD></DL><HR><A NAME="verifySignature(java.util.EnumMap, java.lang.String)"><!-- --></A><H3>verifySignature</H3><PRE>public static boolean <B>verifySignature</B>(java.util.EnumMap<<A HREF="../../../../com/google/code/facebookapi/FacebookParam.html" title="enum in com.google.code.facebookapi">FacebookParam</A>,java.lang.String> params, java.lang.String secret)</PRE><DL><DD>Verifies that a signature received matches the expected value. Removes FacebookParam.SIGNATURE from params if present.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>params</CODE> - a map of parameters and their values, such as one obtained from extractFacebookParams; expected to the expected signature as the FacebookParam.SIGNATURE parameter<DD><CODE>secret</CODE> - <DT><B>Returns:</B><DD>a boolean indicating whether the calculated signature matched the expected signature</DL></DD></DL><HR><A NAME="verifySignature(java.util.EnumMap, java.lang.String, java.lang.String)"><!-- --></A><H3>verifySignature</H3><PRE>public static boolean <B>verifySignature</B>(java.util.EnumMap<<A HREF="../../../../com/google/code/facebookapi/FacebookParam.html" title="enum in com.google.code.facebookapi">FacebookParam</A>,java.lang.String> params, java.lang.String secret, java.lang.String expected)</PRE><DL><DD>Verifies that a signature received matches the expected value.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>params</CODE> - a map of parameters and their values, such as one obtained from extractFacebookParams<DD><CODE>secret</CODE> - the developers 'secret' API key<DD><CODE>expected</CODE> - the expected resulting value of computing the MD5 sum of the 'sig' params and the 'secret' key<DT><B>Returns:</B><DD>a boolean indicating whether the calculated signature matched the expected signature</DL></DD></DL><HR><A NAME="verifySignature(java.util.Map, java.lang.String)"><!-- --></A><H3>verifySignature</H3><PRE>public static boolean <B>verifySignature</B>(java.util.Map<java.lang.String,java.lang.String> params, java.lang.String secret)</PRE><DL><DD>Verifies that a signature received matches the expected value. Removes FacebookParam.SIGNATURE from params if present.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>params</CODE> - a map of parameters and their values, such as one obtained from extractFacebookNamespaceParams; expected to contain the signature as the FacebookParam.SIGNATURE parameter<DD><CODE>secret</CODE> - the developers 'secret' API key<DT><B>Returns:</B><DD>a boolean indicating whether the calculated signature matched the expected signature</DL></DD></DL><HR><A NAME="autoVerifySignature(java.util.Map, java.lang.String, java.lang.String)"><!-- --></A><H3>autoVerifySignature</H3><PRE>public static boolean <B>autoVerifySignature</B>(java.util.Map<java.lang.String,java.lang.String[]> requestParams, java.lang.String secret, java.lang.String expected)</PRE><DL><DD>Verifies that a signature received matches the expected value. This method will perform any necessary conversion of the parameter map passed to it (should the map be immutable, etc.), meaning that you may safely call it without doing any manual preprocessing of the parameters first.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>requestParams</CODE> - A map of request parameters to their values, as returned by ServletRequest.getParameterMap(), for example.<DD><CODE>secret</CODE> - the developers 'secret' API key<DD><CODE>expected</CODE> - the expected resulting value of computing the MD5 sum of the 'sig' params and the 'secret' key<DT><B>Returns:</B><DD>a boolean indicating whether the calculated signature matched the expected signature</DL></DD></DL><HR><A NAME="autoVerifySignature(java.util.Map, java.lang.String)"><!-- --></A><H3>autoVerifySignature</H3><PRE>public static boolean <B>autoVerifySignature</B>(java.util.Map<java.lang.String,java.lang.String[]> requestParams, java.lang.String secret)</PRE><DL><DD>Verifies that a signature received matches the expected value. This method will perform any necessary conversion of the parameter map passed to it (should the map be immutable, etc.), meaning that you may safely call it without doing any manual preprocessing of the parameters first.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>requestParams</CODE> - A map of request parameters to their values, as returned by ServletRequest.getParameterMap(), for example.<DD><CODE>secret</CODE> - the developers 'secret' API key<DD><CODE>expected</CODE> - the expected resulting value of computing the MD5 sum of the 'sig' params and the 'secret' key<DT><B>Returns:</B><DD>a boolean indicating whether the calculated signature matched the expected signature</DL></DD></DL><HR><A NAME="verifySignature(java.util.Map, java.lang.String, java.lang.String)"><!-- --></A><H3>verifySignature</H3><PRE>public static boolean <B>verifySignature</B>(java.util.Map<java.lang.String,java.lang.String> params, java.lang.String secret, java.lang.String expected)</PRE><DL><DD>Verifies that a signature received matches the expected value.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>params</CODE> - a map of parameters and their values, such as one obtained from extractFacebookNamespaceParams<DD><CODE>secret</CODE> - the developers 'secret' API key<DD><CODE>expected</CODE> - the expected resulting value of computing the MD5 sum of the 'sig' params and the 'secret' key<DT><B>Returns:</B><DD>a boolean indicating whether the calculated signature matched the expected signature</DL></DD></DL><HR><A NAME="convert(java.util.Collection)"><!-- --></A><H3>convert</H3><PRE>public static java.util.List<java.lang.String> <B>convert</B>(java.util.Collection<java.util.Map.Entry<java.lang.String,java.lang.String>> entries)</PRE><DL><DD>Converts a Map of key-value pairs into the form expected by generateSignature<P><DD><DL><DT><B>Parameters:</B><DD><CODE>entries</CODE> - a collection of Map.Entry's, such as can be obtained using myMap.entrySet()<DT><B>Returns:</B><DD>a List suitable for being passed to generateSignature</DL></DD></DL><HR><A NAME="convertFacebookParams(java.util.Collection)"><!-- --></A><H3>convertFacebookParams</H3><PRE>public static java.util.List<java.lang.String> <B>convertFacebookParams</B>(java.util.Collection<java.util.Map.Entry<<A HREF="../../../../com/google/code/facebookapi/FacebookParam.html" title="enum in com.google.code.facebookapi">FacebookParam</A>,java.lang.String>> entries)</PRE><DL><DD>Converts a Map of key-value pairs into the form expected by generateSignature<P><DD><DL><DT><B>Parameters:</B><DD><CODE>entries</CODE> - a collection of Map.Entry's, such as can be obtained using myMap.entrySet()<DT><B>Returns:</B><DD>a List suitable for being passed to generateSignature</DL></DD></DL><HR><A NAME="generateSignature(java.util.List, java.lang.String)"><!-- --></A><H3>generateSignature</H3><PRE>public static java.lang.String <B>generateSignature</B>(java.util.List<java.lang.String> params, java.lang.String secret)</PRE><DL><DD>Calculates the signature for the given set of params using the supplied secret<P><DD><DL><DT><B>Parameters:</B><DD><CODE>params</CODE> - Strings of the form "key=value"<DD><CODE>secret</CODE> - <DT><B>Returns:</B><DD>the signature</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../com/google/code/facebookapi/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/FacebookSignatureUtil.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../com/google/code/facebookapi/FacebookRestClient.html" title="class in com.google.code.facebookapi"><B>PREV CLASS</B></A> <A HREF="../../../../com/google/code/facebookapi/FacebookWebappHelper.html" title="class in com.google.code.facebookapi"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?com/google/code/facebookapi/FacebookSignatureUtil.html" target="_top"><B>FRAMES</B></A> <A HREF="FacebookSignatureUtil.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR>Copyright © 2008. All Rights Reserved.</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -