Raise ValueError if the password doesn't fit

Fixes #1235. OpenSSL only allows password up to 1024 bytes.
It's not like anything else calls it so that's probably not totally silly idea :)