Confirmed users
97
edits
(→Terms) |
(Update to current WebIDL) |
||
Line 57: | Line 57: | ||
}; | }; | ||
[Constructor( | [Constructor(DOMString algorithm)] | ||
interface CryptoHash { | interface CryptoHash { | ||
void append( | void append(ArrayBuffer data); | ||
ArrayBuffer finish(); | ArrayBuffer finish(); | ||
}; | }; | ||
[Constructor( | [Constructor(DOMString algorithm, ArrayBuffer key)] | ||
interface CryptoHmac { | interface CryptoHmac { | ||
void append( | void append(ArrayBuffer data); | ||
ArrayBuffer finish(); | ArrayBuffer finish(); | ||
}; | }; | ||
callback interface GenerateKeypairCallback { | |||
void onsuccess(ArrayBuffer keyID, ArrayBuffer pubKey); | void onsuccess(ArrayBuffer keyID, ArrayBuffer pubKey); | ||
}; | }; | ||
callback interface GetPublicKeyCallback { | |||
void onsuccess(ArrayBuffer pubKey); | void onsuccess(ArrayBuffer pubKey); | ||
}; | }; | ||
callback interface PKEncryptCallback { | |||
void onsuccess(ArrayBuffer message); | void onsuccess(ArrayBuffer message); | ||
}; | }; | ||
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 interface SignCallback { | |||
void onsuccess(ArrayBuffer signature); | void onsuccess(ArrayBuffer signature); | ||
}; | }; | ||
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 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 | ||
* | *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 |