Privacy/Features/DOMCryptAPISpec/Latest: Difference between revisions

Update to current WebIDL
(Update to current WebIDL)
Line 57: Line 57:
};
};


[Constructor(in DOMString algorithm)]
[Constructor(DOMString algorithm)]
interface CryptoHash {
interface CryptoHash {
   void append(in ArrayBuffer data);
   void append(ArrayBuffer data);
   ArrayBuffer finish();
   ArrayBuffer finish();
};
};


[Constructor(in DOMString algorithm, in ArrayBuffer key)]
[Constructor(DOMString algorithm, ArrayBuffer key)]
interface CryptoHmac {
interface CryptoHmac {
   void append(in ArrayBuffer data);
   void append(ArrayBuffer data);
   ArrayBuffer finish();
   ArrayBuffer finish();
};
};


[Callback=FunctionOnly, NoInterfaceObject] interface GenerateKeypairCallback {
callback interface GenerateKeypairCallback {
   void onsuccess(ArrayBuffer keyID, ArrayBuffer pubKey);
   void onsuccess(ArrayBuffer keyID, ArrayBuffer pubKey);
};
};


[Callback=FunctionOnly, NoInterfaceObject] interface GetPublicKeyCallback {
callback interface GetPublicKeyCallback {
   void onsuccess(ArrayBuffer pubKey);
   void onsuccess(ArrayBuffer pubKey);
};
};


[Callback=FunctionOnly, NoInterfaceObject] interface PKEncryptCallback {
callback interface PKEncryptCallback {
   void onsuccess(ArrayBuffer message);
   void onsuccess(ArrayBuffer message);
};
};


[Callback=FunctionOnly, NoInterfaceObject] interface PKDecryptCallback {
callback interface PKDecryptCallback {
   void onsuccess(ArrayBuffer plainText);
   void onsuccess(ArrayBuffer plainText);
};
};


interface CryptoPk {
interface CryptoPk {
   void generateKeypair(DOMString algorithm, GenerateKeypairCallback callback, boolean signingKeypair);
   void generateKeypair(DOMString algorithm, GenerateKeypairCallback callback, boolean signingKeypair);
   void getPublicKey(GetPublicKeyCallback callback);
   void getPublicKey(GetPublicKeyCallback callback);
   void encrypt(ArrayBuffer plainText, ArrayBuffer keyID, PKEncryptCallback callback);
   void encrypt(ArrayBuffer plainText, ArrayBuffer keyID, PKEncryptCallback callback);
   void decrypt(ArrayBuffer message, ArrayBuffer keyID, PKDecryptCallback callback);
   void decrypt(ArrayBuffer message, ArrayBuffer keyID, PKDecryptCallback callback);
};
};


[Callback=FunctionOnly, NoInterfaceObject] interface SignCallback {
callback interface SignCallback {
   void onsuccess(ArrayBuffer signature);
   void onsuccess(ArrayBuffer signature);
};
};


[Callback=FunctionOnly, NoInterfaceObject] interface VerifyCallback {
callback interface VerifyCallback {
   void onsuccess(boolean verified);
   void onsuccess(boolean verified);
};
};


interface CryptoSign {
interface CryptoSign {
   void sign(ArrayBuffer keyID, ArrayBuffer plainText, PKSignCallback callback);
   void sign(ArrayBuffer keyID, ArrayBuffer plainText, PKSignCallback callback);
   void verify(ArrayBuffer signature, ArrayBuffer pubKey, ArrayBuffer plainText, PKVerifyCallback callback);
   void verify(ArrayBuffer signature, ArrayBuffer pubKey, ArrayBuffer plainText, PKVerifyCallback callback);
};
};
</pre>
</pre>
Line 123: Line 115:
One possible addition we might consider is providing the web site with a secure mechanism having the user confirm a transaction. For example, a bank web site might wish to have the user sign a statement authorizing the transfer of funds from one account to another. Unlike the DOMCrypt APIs described above, this API involves interacting with the user to achieve non-repudiation:  
One possible addition we might consider is providing the web site with a secure mechanism having the user confirm a transaction. For example, a bank web site might wish to have the user sign a statement authorizing the transfer of funds from one account to another. Unlike the DOMCrypt APIs described above, this API involves interacting with the user to achieve non-repudiation:  
<pre class="brush:js;toolbar:false;">  
<pre class="brush:js;toolbar:false;">  
[Supplemental]
supplemental interface CryptoSign {
interface CryptoSign {
   void signWithUserConfirmation(in ArrayBuffer keyID, in DOMString description, in ArrayBuffer data, in PKSignCallback callback);  
   void signWithUserConfirmation(in ArrayBuffer keyID, in DOMString description, in ArrayBuffer data, in PKSignCallback callback);  
};
};
Line 145: Line 136:
**https://bugs.webkit.org/show_bug.cgi?id=62010
**https://bugs.webkit.org/show_bug.cgi?id=62010


*WHAT-WG mailing list thread: http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-May/031741.html
*WHATWG mailing list thread: http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-May/031741.html
*W3C mailing list thread: http://lists.w3.org/Archives/Public/public-web-security/2011Jun/0000.html
*W3C mailing list thread: http://lists.w3.org/Archives/Public/public-web-security/2011Jun/0000.html
*Mailing lists summarized http://etherpad.mozilla.com:9000/DOMCrypt-discussion
*Mailing lists summarized http://etherpad.mozilla.com:9000/DOMCrypt-discussion
Confirmed users
97

edits