/lib/bouncycastle/docs/org/bouncycastle/crypto/engines/RSABlindingEngine.html

https://bitbucket.org/arkban/somersault · HTML · 352 lines · 290 code · 40 blank · 22 comment · 0 complexity · e1efc18f7a168dbb6cedac8033a2622a MD5 · raw file

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!--NewPage-->
  3. <HTML>
  4. <HEAD>
  5. <!-- Generated by javadoc (build 1.6.0) on Mon Jan 11 13:46:35 EST 2010 -->
  6. <TITLE>
  7. RSABlindingEngine (Bouncy Castle Library 1.45 API Specification)
  8. </TITLE>
  9. <META NAME="date" CONTENT="2010-01-11">
  10. <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
  11. <SCRIPT type="text/javascript">
  12. function windowTitle()
  13. {
  14. if (location.href.indexOf('is-external=true') == -1) {
  15. parent.document.title="RSABlindingEngine (Bouncy Castle Library 1.45 API Specification)";
  16. }
  17. }
  18. </SCRIPT>
  19. <NOSCRIPT>
  20. </NOSCRIPT>
  21. </HEAD>
  22. <BODY BGCOLOR="white" onload="windowTitle();">
  23. <HR>
  24. <!-- ========= START OF TOP NAVBAR ======= -->
  25. <A NAME="navbar_top"><!-- --></A>
  26. <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
  27. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  28. <TR>
  29. <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  30. <A NAME="navbar_top_firstrow"><!-- --></A>
  31. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  32. <TR ALIGN="center" VALIGN="top">
  33. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  34. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  35. <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  36. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  37. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  38. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  39. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  40. </TR>
  41. </TABLE>
  42. </TD>
  43. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  44. <b>Bouncy Castle Cryptography Library 1.45</b></EM>
  45. </TD>
  46. </TR>
  47. <TR>
  48. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  49. &nbsp;<A HREF="../../../../org/bouncycastle/crypto/engines/RSABlindedEngine.html" title="class in org.bouncycastle.crypto.engines"><B>PREV CLASS</B></A>&nbsp;
  50. &nbsp;<A HREF="../../../../org/bouncycastle/crypto/engines/RSAEngine.html" title="class in org.bouncycastle.crypto.engines"><B>NEXT CLASS</B></A></FONT></TD>
  51. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  52. <A HREF="../../../../index.html?org/bouncycastle/crypto/engines/RSABlindingEngine.html" target="_top"><B>FRAMES</B></A> &nbsp;
  53. &nbsp;<A HREF="RSABlindingEngine.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
  54. &nbsp;<SCRIPT type="text/javascript">
  55. <!--
  56. if(window==top) {
  57. document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  58. }
  59. //-->
  60. </SCRIPT>
  61. <NOSCRIPT>
  62. <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
  63. </NOSCRIPT>
  64. </FONT></TD>
  65. </TR>
  66. <TR>
  67. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  68. SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  69. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  70. DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  71. </TR>
  72. </TABLE>
  73. <A NAME="skip-navbar_top"></A>
  74. <!-- ========= END OF TOP NAVBAR ========= -->
  75. <HR>
  76. <!-- ======== START OF CLASS DATA ======== -->
  77. <H2>
  78. <FONT SIZE="-1">
  79. org.bouncycastle.crypto.engines</FONT>
  80. <BR>
  81. Class RSABlindingEngine</H2>
  82. <PRE>
  83. java.lang.Object
  84. <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.bouncycastle.crypto.engines.RSABlindingEngine</B>
  85. </PRE>
  86. <DL>
  87. <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../org/bouncycastle/crypto/AsymmetricBlockCipher.html" title="interface in org.bouncycastle.crypto">AsymmetricBlockCipher</A></DD>
  88. </DL>
  89. <HR>
  90. <DL>
  91. <DT><PRE>public class <B>RSABlindingEngine</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../../org/bouncycastle/crypto/AsymmetricBlockCipher.html" title="interface in org.bouncycastle.crypto">AsymmetricBlockCipher</A></DL>
  92. </PRE>
  93. <P>
  94. This does your basic RSA Chaum's blinding and unblinding as outlined in
  95. "Handbook of Applied Cryptography", page 475. You need to use this if you are
  96. trying to get another party to generate signatures without them being aware
  97. of the message they are signing.
  98. <P>
  99. <P>
  100. <HR>
  101. <P>
  102. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  103. <A NAME="constructor_summary"><!-- --></A>
  104. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  105. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  106. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  107. <B>Constructor Summary</B></FONT></TH>
  108. </TR>
  109. <TR BGCOLOR="white" CLASS="TableRowColor">
  110. <TD><CODE><B><A HREF="../../../../org/bouncycastle/crypto/engines/RSABlindingEngine.html#RSABlindingEngine()">RSABlindingEngine</A></B>()</CODE>
  111. <BR>
  112. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  113. </TR>
  114. </TABLE>
  115. &nbsp;
  116. <!-- ========== METHOD SUMMARY =========== -->
  117. <A NAME="method_summary"><!-- --></A>
  118. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  119. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  120. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  121. <B>Method Summary</B></FONT></TH>
  122. </TR>
  123. <TR BGCOLOR="white" CLASS="TableRowColor">
  124. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  125. <CODE>&nbsp;int</CODE></FONT></TD>
  126. <TD><CODE><B><A HREF="../../../../org/bouncycastle/crypto/engines/RSABlindingEngine.html#getInputBlockSize()">getInputBlockSize</A></B>()</CODE>
  127. <BR>
  128. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the maximum size for an input block to this engine.</TD>
  129. </TR>
  130. <TR BGCOLOR="white" CLASS="TableRowColor">
  131. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  132. <CODE>&nbsp;int</CODE></FONT></TD>
  133. <TD><CODE><B><A HREF="../../../../org/bouncycastle/crypto/engines/RSABlindingEngine.html#getOutputBlockSize()">getOutputBlockSize</A></B>()</CODE>
  134. <BR>
  135. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the maximum size for an output block to this engine.</TD>
  136. </TR>
  137. <TR BGCOLOR="white" CLASS="TableRowColor">
  138. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  139. <CODE>&nbsp;void</CODE></FONT></TD>
  140. <TD><CODE><B><A HREF="../../../../org/bouncycastle/crypto/engines/RSABlindingEngine.html#init(boolean, org.bouncycastle.crypto.CipherParameters)">init</A></B>(boolean&nbsp;forEncryption,
  141. <A HREF="../../../../org/bouncycastle/crypto/CipherParameters.html" title="interface in org.bouncycastle.crypto">CipherParameters</A>&nbsp;param)</CODE>
  142. <BR>
  143. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initialise the blinding engine.</TD>
  144. </TR>
  145. <TR BGCOLOR="white" CLASS="TableRowColor">
  146. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  147. <CODE>&nbsp;byte[]</CODE></FONT></TD>
  148. <TD><CODE><B><A HREF="../../../../org/bouncycastle/crypto/engines/RSABlindingEngine.html#processBlock(byte[], int, int)">processBlock</A></B>(byte[]&nbsp;in,
  149. int&nbsp;inOff,
  150. int&nbsp;inLen)</CODE>
  151. <BR>
  152. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Process a single block using the RSA blinding algorithm.</TD>
  153. </TR>
  154. </TABLE>
  155. &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
  156. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  157. <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
  158. <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
  159. </TR>
  160. <TR BGCOLOR="white" CLASS="TableRowColor">
  161. <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
  162. </TR>
  163. </TABLE>
  164. &nbsp;
  165. <P>
  166. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  167. <A NAME="constructor_detail"><!-- --></A>
  168. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  169. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  170. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  171. <B>Constructor Detail</B></FONT></TH>
  172. </TR>
  173. </TABLE>
  174. <A NAME="RSABlindingEngine()"><!-- --></A><H3>
  175. RSABlindingEngine</H3>
  176. <PRE>
  177. public <B>RSABlindingEngine</B>()</PRE>
  178. <DL>
  179. </DL>
  180. <!-- ============ METHOD DETAIL ========== -->
  181. <A NAME="method_detail"><!-- --></A>
  182. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  183. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  184. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  185. <B>Method Detail</B></FONT></TH>
  186. </TR>
  187. </TABLE>
  188. <A NAME="init(boolean, org.bouncycastle.crypto.CipherParameters)"><!-- --></A><H3>
  189. init</H3>
  190. <PRE>
  191. public void <B>init</B>(boolean&nbsp;forEncryption,
  192. <A HREF="../../../../org/bouncycastle/crypto/CipherParameters.html" title="interface in org.bouncycastle.crypto">CipherParameters</A>&nbsp;param)</PRE>
  193. <DL>
  194. <DD>Initialise the blinding engine.
  195. <P>
  196. <DD><DL>
  197. <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/bouncycastle/crypto/AsymmetricBlockCipher.html#init(boolean, org.bouncycastle.crypto.CipherParameters)">init</A></CODE> in interface <CODE><A HREF="../../../../org/bouncycastle/crypto/AsymmetricBlockCipher.html" title="interface in org.bouncycastle.crypto">AsymmetricBlockCipher</A></CODE></DL>
  198. </DD>
  199. <DD><DL>
  200. <DT><B>Parameters:</B><DD><CODE>forEncryption</CODE> - true if we are encrypting (blinding), false otherwise.<DD><CODE>param</CODE> - the necessary RSA key parameters.</DL>
  201. </DD>
  202. </DL>
  203. <HR>
  204. <A NAME="getInputBlockSize()"><!-- --></A><H3>
  205. getInputBlockSize</H3>
  206. <PRE>
  207. public int <B>getInputBlockSize</B>()</PRE>
  208. <DL>
  209. <DD>Return the maximum size for an input block to this engine.
  210. For RSA this is always one byte less than the key size on
  211. encryption, and the same length as the key size on decryption.
  212. <P>
  213. <DD><DL>
  214. <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/bouncycastle/crypto/AsymmetricBlockCipher.html#getInputBlockSize()">getInputBlockSize</A></CODE> in interface <CODE><A HREF="../../../../org/bouncycastle/crypto/AsymmetricBlockCipher.html" title="interface in org.bouncycastle.crypto">AsymmetricBlockCipher</A></CODE></DL>
  215. </DD>
  216. <DD><DL>
  217. <DT><B>Returns:</B><DD>maximum size for an input block.</DL>
  218. </DD>
  219. </DL>
  220. <HR>
  221. <A NAME="getOutputBlockSize()"><!-- --></A><H3>
  222. getOutputBlockSize</H3>
  223. <PRE>
  224. public int <B>getOutputBlockSize</B>()</PRE>
  225. <DL>
  226. <DD>Return the maximum size for an output block to this engine.
  227. For RSA this is always one byte less than the key size on
  228. decryption, and the same length as the key size on encryption.
  229. <P>
  230. <DD><DL>
  231. <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/bouncycastle/crypto/AsymmetricBlockCipher.html#getOutputBlockSize()">getOutputBlockSize</A></CODE> in interface <CODE><A HREF="../../../../org/bouncycastle/crypto/AsymmetricBlockCipher.html" title="interface in org.bouncycastle.crypto">AsymmetricBlockCipher</A></CODE></DL>
  232. </DD>
  233. <DD><DL>
  234. <DT><B>Returns:</B><DD>maximum size for an output block.</DL>
  235. </DD>
  236. </DL>
  237. <HR>
  238. <A NAME="processBlock(byte[], int, int)"><!-- --></A><H3>
  239. processBlock</H3>
  240. <PRE>
  241. public byte[] <B>processBlock</B>(byte[]&nbsp;in,
  242. int&nbsp;inOff,
  243. int&nbsp;inLen)</PRE>
  244. <DL>
  245. <DD>Process a single block using the RSA blinding algorithm.
  246. <P>
  247. <DD><DL>
  248. <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/bouncycastle/crypto/AsymmetricBlockCipher.html#processBlock(byte[], int, int)">processBlock</A></CODE> in interface <CODE><A HREF="../../../../org/bouncycastle/crypto/AsymmetricBlockCipher.html" title="interface in org.bouncycastle.crypto">AsymmetricBlockCipher</A></CODE></DL>
  249. </DD>
  250. <DD><DL>
  251. <DT><B>Parameters:</B><DD><CODE>in</CODE> - the input array.<DD><CODE>inOff</CODE> - the offset into the input buffer where the data starts.<DD><CODE>inLen</CODE> - the length of the data to be processed.
  252. <DT><B>Returns:</B><DD>the result of the RSA process.
  253. <DT><B>Throws:</B>
  254. <DD><CODE><A HREF="../../../../org/bouncycastle/crypto/DataLengthException.html" title="class in org.bouncycastle.crypto">DataLengthException</A></CODE> - the input block is too large.</DL>
  255. </DD>
  256. </DL>
  257. <!-- ========= END OF CLASS DATA ========= -->
  258. <HR>
  259. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  260. <A NAME="navbar_bottom"><!-- --></A>
  261. <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
  262. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  263. <TR>
  264. <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  265. <A NAME="navbar_bottom_firstrow"><!-- --></A>
  266. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  267. <TR ALIGN="center" VALIGN="top">
  268. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  269. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  270. <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  271. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  272. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  273. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  274. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  275. </TR>
  276. </TABLE>
  277. </TD>
  278. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  279. <b>Bouncy Castle Cryptography Library 1.45</b></EM>
  280. </TD>
  281. </TR>
  282. <TR>
  283. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  284. &nbsp;<A HREF="../../../../org/bouncycastle/crypto/engines/RSABlindedEngine.html" title="class in org.bouncycastle.crypto.engines"><B>PREV CLASS</B></A>&nbsp;
  285. &nbsp;<A HREF="../../../../org/bouncycastle/crypto/engines/RSAEngine.html" title="class in org.bouncycastle.crypto.engines"><B>NEXT CLASS</B></A></FONT></TD>
  286. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  287. <A HREF="../../../../index.html?org/bouncycastle/crypto/engines/RSABlindingEngine.html" target="_top"><B>FRAMES</B></A> &nbsp;
  288. &nbsp;<A HREF="RSABlindingEngine.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
  289. &nbsp;<SCRIPT type="text/javascript">
  290. <!--
  291. if(window==top) {
  292. document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  293. }
  294. //-->
  295. </SCRIPT>
  296. <NOSCRIPT>
  297. <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
  298. </NOSCRIPT>
  299. </FONT></TD>
  300. </TR>
  301. <TR>
  302. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  303. SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  304. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  305. DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  306. </TR>
  307. </TABLE>
  308. <A NAME="skip-navbar_bottom"></A>
  309. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  310. <HR>
  311. </BODY>
  312. </HTML>