Crypto.PublicKey.RSA.error: Plaintext too large

Peter Hansen peter at engcorp.com
Wed Aug 4 08:05:16 EDT 2004


Ajay Brar wrote:

> the documentation says verify should return true or false. it will 
> generate an error if plaintext is too large - which is not helping me much
> i have pinned the problem down to the signature itself and the way i am 
> downloading it.
> what i do is when a user clicks on a signature link, i calculate the 
> signature on the fly and then do
> print "Content-type: application\n"
> print signature
> i am using content-type application to force explorer to give the 
> download dalog box (the application i am building will later be ported 
> to a pocket pc). Microsoft on their website said to put the header 
> "Content-disposition: attachment;filename=blah" to force dowload, but 
> that didn't work - i am yet to find out what i am doing wrong?
> so any ideas on how i send the signature across and make the user 
> download it?

Internet Explorer is, of course, broken.  The only guaranteed
solution of which I'm aware to the problem that it sounds like
you are describing (IE refusing to download a file in the right
way or to save it as right type) is to set the file extension
to something that it recognizes as requiring a download.  For
example, if you use a file extension of .txt on something, it
will generally not try to download it automatically.  Same for
other things that it recognizes.  Setting the extension to
.exe would presumably force the same behaviour as using content
type "application".  Leaving the extension off might also work,
though I haven't tried that.

Or I might be interpreting what you are saying incorrectly.

-Peter



More information about the Python-list mailing list