564
edits
No edit summary |
|||
| Line 1: | Line 1: | ||
= DOMCrypt 'window. | = DOMCrypt 'window.mozCrypto' Specification = | ||
;DRAFT | ;DRAFT | ||
;Version 0. | ;Version 0.2PRE This draft is under heavy development right now. WebIDL is being added, v0.2 will be posted 2011-06-06 | ||
;Updated 2011-06-03 | |||
; Author: David Dahl <ddahl@mozilla.com> | ; Author: David Dahl <ddahl@mozilla.com> | ||
| Line 9: | Line 11: | ||
== Introduction == | == Introduction == | ||
This document describes a proposed Javascript Cryptography API available in web browsers to allow any web page script the ability to generate asymmetric key pairs, encrypt, decrypt, sign, verify, hash data ( via a variety of algorithms ) | This document describes a proposed Javascript Cryptography API available in web browsers to allow any web page script the ability to generate asymmetric key pairs, encrypt, decrypt (asymmetric and symmetric crypto), sign, verify, HMAC, and hash data ( via a variety of algorithms ). | ||
== Terms == | == Terms == | ||
| Line 17: | Line 19: | ||
; window.cipher | ; window.cipher | ||
: The proposed window property name for this API | : The now '''deprecated''' proposed window property name for this API | ||
; window.mozCrypto | |||
: The temporary window property used to distinguish this new API from the current window.crypto property. The consensus so far is to add this API to the window.crypto property | |||
; cipher Configuration | ; cipher Configuration | ||
| Line 30: | Line 35: | ||
; Private Key | ; Private Key | ||
: The private half of an asymmetric key pair | : The private half of an asymmetric key pair | ||
; Symmetric Key | ; Symmetric Key | ||
| Line 59: | Line 58: | ||
</pre> | </pre> | ||
== Browser Window property == | |||
;window.mozCrypto<br> | |||
< | |||
All windows will have this property (in the current implementation) for the time being as this API is hashed out. | |||
The property is namespaced in order to provide future capabilities. The current design is asynchronous and looks like this: <br> | |||
<pre class="brush:js;toolbar:false;"> | <pre class="brush:js;toolbar:false;"> | ||
{ | { | ||
| Line 102: | Line 90: | ||
// verify a signature | // verify a signature | ||
verify: function ( signature, plainText, function callback ( boolean ) { } ) { }, | verify: function ( signature, plainText, function callback ( boolean ) { } ) { }, | ||
}, | }, | ||
| Line 128: | Line 110: | ||
hash: { | hash: { | ||
set algorithm( algorithm ) { }, | |||
get algorithm( ) { }, | |||
createHash: function (function callback (hash) {}) { } | |||
}, | }, | ||
| Line 143: | Line 129: | ||
</pre> | </pre> | ||
== Notes == | == Notes == | ||
; The implementation should allow users to whitelist domains and pages which are authorized to use this API - much like how the Geolocation API asks the user for permission to get location data | |||
; The implementation should allow users to whitelist domains and pages which are authorized to use this API - | |||
== References == | == References == | ||
*DOMCrypt: http://domcrypt.org | *DOMCrypt: http://domcrypt.org | ||
* | *DOMCrypt Mozilla bugs: | ||
**https://bugzilla.mozilla.org/show_bug.cgi?id=649154 | **https://bugzilla.mozilla.org/show_bug.cgi?id=649154 | ||
**https://bugzilla.mozilla.org/show_bug.cgi?id=657432 | **https://bugzilla.mozilla.org/show_bug.cgi?id=657432 | ||
*DOMCrypt WebKit bug: | |||
**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 | *WHAT-WG 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 | ||
*Mailing lists summarized http://etherpad.mozilla.com:9000/DOMCrypt-discussion | |||
<br> | <br> | ||
edits