Re: openssl module for php
| From: | Sascha Kettler | Date: | Fri, 04 May 2001 20:20:23 +0000 |
| Subject: | Re: openssl module for php | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-53954@lists.php.net to get a copy of this message | ||
> On 2001-05-04 20:21:28, "Sascha Kettler" <kettler@gmx.net> wrote:
> > Sounds ok, although I wouldn't call it openssl_key_* but openssl_asym_*
> > similar.
>
> Yeah, that sounds better.
>
> > I don't know what people would prefer: Separate functions or a
> > boolean. What's the general opinion on that?
>
> IMHO, openssl_asym_public_encrypt is just a bit too long for a function
> name.
public/private_encrypt/decrypt should imply use of an asymmetric encryption,
at least it does for me. So then there's no need for the _asym bit (which
was just a replacement for openssl_key_encrypt, as this wasn't saying anything
about asymmetric encryption).
> I suppose a more sensible way is to define some constants (sth like):
> OPENSSL_ENC_PUBLIC and OPENSSL_ENC_PRIVATE so that the parameter has an
> instant obvious meaning (compared to just true/false).
>
> Mind you: strlen(constant) + strlen(openssl_asym_encrypt) >
> strlen(openssl_asym_public_encrypt)...
>
> I suppose it's just psychological, but shorter function names seem shorter
> overall (to me anyway).
No problem with that, saves me some typing (or doing a wrapper with a
shorter name) ;)
Sascha