ISSUE-12: Should the API distinguish between algorithm and operation parameters?

Sorry I missed the discussion due to a combination of technical issues and dinnertime.

I worry that we're leaving out syntactic sugar that could be used to guide the developer. I think this unease is also reflected in Dan Boneh's comments from last month. People are going to cut-and-paste sample code, and the fact that some elements of the Algorithm are sensitive if reused may get lost when "most" elements in that dictionary look safe to reuse (e.g. the name).

So I definitely sympathize with Dan's view that we should have something similar to:

Promise<any> encrypt(AlgorithmIdentifier algorithm,
                       Key key,
                       sequence<CryptoOperationData> data
CryptoOperationParameters? params);

Where for instance for AES-GCM params might have nonce and associatedData as members.

All that said, we have had this discussion for a long time, and we haven't managed to come up with a neat way of expressing the above intention in WebIDL. Also, I think the draft as it stands is sufficient, in that it provides a way for developers to access the full intended functionality through the API. So unless anyone has a new idea in this space it might be time to let the matter drop.

Received on Thursday, 14 November 2013 06:05:11 UTC