On Fri, May 04, 2001 at 09:21:28PM +0200, Sascha Kettler wrote:
> > On 2001-05-04 17:59:03, "Stig Venaas" <[EMAIL PROTECTED]> wrote:
> > > followed up on that. It would be good if you and Sascha Kettler could
> > > agree on how the API should be
> > 
> > How about:
> > 
> > openssl_key_encrypt(
> >   string data,  // to encrypt
> >   string &crypted,  // encrypted result
> >   mixed key, // key to use
> >   bool public, // true if you want public key, false for private key
> >   [int padding] // optional padding
> > );

Even though it is 4 functions, I think users will find it easier to
work with functions called openssl_public_encrypt,
openssl_private_decrypt etc. It also separates them from possible
symmetric enryption later on.

How about returning the result like this:

string openssl_public_encrypt(
  string data,
  mixed key,
  [int padding]
);

I think it's generally better to not alter arguments, better return it
this way. Is it good enough to report errors by returning an empty
string? I think so.

Stig

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to