W3C home > Mailing lists > Public > public-webcrypto@w3.org > August 2012

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

From: Wan-Teh Chang <wtc@google.com>
Date: Wed, 29 Aug 2012 18:08:24 -0700
Message-ID: <CALTJjxGt=wnk-6OS634AueT26ePS4ybHz9ez0x18N9t4uh4CcQ@mail.gmail.com>
To: Ryan Sleevi <sleevi@google.com>
Cc: Web Cryptography Working Group <public-webcrypto@w3.org>
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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:01:26 UTC