W3C home > Mailing lists > Public > public-webcrypto@w3.org > March 2014

Promise return types

From: Vijay Bharadwaj <Vijay.Bharadwaj@microsoft.com>
Date: Thu, 6 Mar 2014 19:22:59 +0000
To: "public-webcrypto@w3.org" <public-webcrypto@w3.org>
Message-ID: <ee018548166841b480fcd6de7e0c2f6e@DFM-DB3MBX15-07.exchange.corp.microsoft.com>
Someone asked me a question recently that made me look more closely at our return types for the subtleCrypto functions. Should we look at tightening these up a bit instead of having them all be Promise<any>?

Specifically, is there any reason to have exportKey and wrapKey return Promise<any> instead of Promise<ArrayBuffer>? The way it's set up now, it would be very tempting for someone adding a future algorithm to, say, return an object for the JWK export instead of serializing it first as all the existing algorithms do. This may develop into a hassle for programmers as they would have to track what each algorithm does for each format.
Received on Thursday, 6 March 2014 19:23:40 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:02:41 UTC