Re: crypto-ISSUE-37: Method naming [Web Cryptography API]

On Tue, Aug 28, 2012 at 8:24 PM, Ryan Sleevi <sleevi@google.com> wrote:
>
> Solution 3:
> Create objects for each of the "primitive" cryptographic operations,
> and combine with Solution 2 to define constructors for each object.
>
> [Constructor(AlgorithmIdentifier algorithm, ...)]
> interface Encrypter : CryptoOperation { ... };
> interface Decrypter : CryptoOperation { ... };
> interface KeyDeriver : KeyOperation { ... };
> etc
>
> Sample Code:
> var a = Encrypter(...);

I like this solution the best.

As for Encrypter vs. Encryptor, I think the misspelled HTTP "Referer"
header shows programmers can live with it. We can avoid it with longer
names like EncryptOperation or EncryptContext.

Wan-Teh

Received on Thursday, 30 August 2012 01:08:53 UTC