- From: Wan-Teh Chang <wtc@google.com>
- Date: Wed, 29 Aug 2012 18:08:24 -0700
- 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