Remove the "temporary" attribute. All Key objects are implicitly temporary
unless/until persisted into some form of web storage, so there is no longer
a need.
--- a/spec/Overview-WebCryptoAPI.xml Mon Dec 03 17:16:36 2012 -0800
+++ b/spec/Overview-WebCryptoAPI.xml Mon Dec 03 17:16:45 2012 -0800
@@ -765,7 +765,6 @@
interface <dfn id="dfn-Key">Key</dfn> {
readonly attribute KeyType <a href="#dfn-Key-type">type</a>;
readonly attribute bool <a href="#dfn-Key-extractable">extractable</a>;
- readonly attribute bool <a href="#dfn-Key-temporary">temporary</a>;
readonly attribute <a href="#dfn-Algorithm">Algorithm</a> <a href="#dfn-Key-algorithm">algorithm</a>;
readonly attribute <a href="#dfn-KeyUsage">KeyUsage</a>[] <a href="#dfn-Key-keyUsage">keyUsage</a>;
};
@@ -804,11 +803,6 @@
<dd>
Whether or not the raw keying material may be exported by the application.
</dd>
- <dt id="dfn-Key-temporary"><code>temporary</code></dt>
- <dd>
- Whether or not the keying material persists beyond the lifetime of the current
- top-level browsing context.
- </dd>
<dt id="dfn-Key-algorithm"><code>algorithm</code></dt>
<dd>
The <a href="#dfn-Algorithm"><code>Algorithm</code></a> used to generate the key.
@@ -843,7 +837,6 @@
<ul>
<li><a href="#dfn-Key-type">type</a></li>
<li><a href="#dfn-Key-extractable">extractable</a></li>
- <li><a href="#dfn-Key-temporary">temporary</a></li>
<li><a href="#dfn-Key-Algorithm">Algorithm</a></li>
<li><a href="#dfn-Key-KeyUsage">KeyUsage</a></li>
</ul>
@@ -1375,13 +1368,11 @@
<span class="comment">// TBD: <a href="https://www.w3.org/2012/webcrypto/track/issues/36">ISSUE-36</a></span>
<a href="#dfn-KeyGenerator">KeyGenerator</a> <a href="#dfn-Crypto-method-createKeyGenerator">createKeyGenerator</a>(<a href="#dfn-AlgorithmIdentifier">AlgorithmIdentifier</a> algorithm,
- bool temporary = true,
bool extractable = false,
<a href="#dfn-KeyUsage">KeyUsage</a>[] keyUsages = []);
<a href="#dfn-KeyDeriver">KeyDeriver</a> <a href="#dfn-Crypto-method-createKeyDeriver">createKeyDeriver</a>(<a href="#dfn-AlgorithmIdentifier">AlgorithmIdentifier</a> algorithm,
<a href="#dfn-Key">Key</a> baseKey,
<a href="#dfn-AlgorithmIdentifier">AlgorithmIdentifier</a>? derivedKeyType,
- bool temporary = true,
bool extractable = false,
<a href="#dfn-KeyUsage">KeyUsage</a>[] keyUsages = []);
@@ -1389,7 +1380,6 @@
<a href="#dfn-KeyImporter">KeyImporter</a> <a href="#dfn-Crypto-method-createKeyImporter">createKeyImporter</a>(<a href="#dfn-KeyFormat">KeyFormat</a> format,
ArrayBufferView key,
<a href="#dfn-AlgorithmIdentifier">AlgorithmIdentifier</a>? algorithm,
- bool temporary = true,
bool extractable = false,
<a href="#dfn-KeyUsage">KeyUsage</a>[] keyUsages = []);
<a href="#dfn-KeyExporter">KeyExporter</a> <a href="#dfn-Crypto-method-createKeyExporter">createKeyExporter</a>(<a href="#dfn-KeyFormat">KeyFormat</a> format, <a href="#dfn-Key">Key</a> key);
@@ -3084,17 +3074,15 @@
};
var keyGen = window.crypto.createKeyGenerator(algorithmKeyGen,
- false, <span class="comment">// temporary</span>
false, <span class="comment">// extractable</span>
["sign"]);
keyGen.oncomplete = function onKeyGenComplete(event)
{
<span class="comment">// The keyGen operation is complete</span>
- console.log("Public Key ID: " + event.target.result.publicKey.id);
<span class="comment">// create a "signer" CryptoOperation object</span>
- var signer = window.crypto.createSigner(algorithmSign, event.target.result.privateKey.id);
+ var signer = window.crypto.createSigner(algorithmSign, event.target.result.privateKey);
signer.oncomplete = function signer_oncomplete(event)
{
console.log("The signer CryptoOperation is finished, the signature is: " +
@@ -3154,18 +3142,11 @@
<span class="comment">// Create a keygenerator to produce a one-time-use AES key to encrypt some data</span>
var cryptoKeyGen = window.crypto.createKeyGenerator(aesAlgorithmKeyGen,
- false, <span class="comment">// temporary</span>
false, <span class="comment">// extractable</span>
["encrypt"]);
cryptoKeyGen.oncomplete = function ckg_onComplete(event)
{
-<span class="comment">
- // Optionally get the keyId and key via the id:
- // var aesKeyId = event.target.result.id;
- // var aesKey = window.crypto.keys.getKeyByKeyId(aesKeyId);
-</span>
-
var aesKey = event.target.result;
var aesSymmetricCryptoOp = window.crypto.createEncrypter(aesAlgorithmEncrypt, aesKey);
--- a/spec/Overview.html Mon Dec 03 17:16:36 2012 -0800
+++ b/spec/Overview.html Mon Dec 03 17:16:45 2012 -0800
@@ -761,7 +761,6 @@
interface <dfn id="dfn-Key">Key</dfn> {
readonly attribute KeyType <a href="#dfn-Key-type">type</a>;
readonly attribute bool <a href="#dfn-Key-extractable">extractable</a>;
- readonly attribute bool <a href="#dfn-Key-temporary">temporary</a>;
readonly attribute <a href="#dfn-Algorithm">Algorithm</a> <a href="#dfn-Key-algorithm">algorithm</a>;
readonly attribute <a href="#dfn-KeyUsage">KeyUsage</a>[] <a href="#dfn-Key-keyUsage">keyUsage</a>;
};
@@ -800,11 +799,6 @@
<dd>
Whether or not the raw keying material may be exported by the application.
</dd>
- <dt id="dfn-Key-temporary"><code>temporary</code></dt>
- <dd>
- Whether or not the keying material persists beyond the lifetime of the current
- top-level browsing context.
- </dd>
<dt id="dfn-Key-algorithm"><code>algorithm</code></dt>
<dd>
The <a href="#dfn-Algorithm"><code>Algorithm</code></a> used to generate the key.
@@ -839,7 +833,6 @@
<ul>
<li><a href="#dfn-Key-type">type</a></li>
<li><a href="#dfn-Key-extractable">extractable</a></li>
- <li><a href="#dfn-Key-temporary">temporary</a></li>
<li><a href="#dfn-Key-Algorithm">Algorithm</a></li>
<li><a href="#dfn-Key-KeyUsage">KeyUsage</a></li>
</ul>
@@ -1371,13 +1364,11 @@
<span class="comment">// TBD: <a href="https://www.w3.org/2012/webcrypto/track/issues/36">ISSUE-36</a></span>
<a href="#dfn-KeyGenerator">KeyGenerator</a> <a href="#dfn-Crypto-method-createKeyGenerator">createKeyGenerator</a>(<a href="#dfn-AlgorithmIdentifier">AlgorithmIdentifier</a> algorithm,
- bool temporary = true,
bool extractable = false,
<a href="#dfn-KeyUsage">KeyUsage</a>[] keyUsages = []);
<a href="#dfn-KeyDeriver">KeyDeriver</a> <a href="#dfn-Crypto-method-createKeyDeriver">createKeyDeriver</a>(<a href="#dfn-AlgorithmIdentifier">AlgorithmIdentifier</a> algorithm,
<a href="#dfn-Key">Key</a> baseKey,
<a href="#dfn-AlgorithmIdentifier">AlgorithmIdentifier</a>? derivedKeyType,
- bool temporary = true,
bool extractable = false,
<a href="#dfn-KeyUsage">KeyUsage</a>[] keyUsages = []);
@@ -1385,7 +1376,6 @@
<a href="#dfn-KeyImporter">KeyImporter</a> <a href="#dfn-Crypto-method-createKeyImporter">createKeyImporter</a>(<a href="#dfn-KeyFormat">KeyFormat</a> format,
ArrayBufferView key,
<a href="#dfn-AlgorithmIdentifier">AlgorithmIdentifier</a>? algorithm,
- bool temporary = true,
bool extractable = false,
<a href="#dfn-KeyUsage">KeyUsage</a>[] keyUsages = []);
<a href="#dfn-KeyExporter">KeyExporter</a> <a href="#dfn-Crypto-method-createKeyExporter">createKeyExporter</a>(<a href="#dfn-KeyFormat">KeyFormat</a> format, <a href="#dfn-Key">Key</a> key);
@@ -3080,17 +3070,15 @@
};
var keyGen = window.crypto.createKeyGenerator(algorithmKeyGen,
- false, <span class="comment">// temporary</span>
false, <span class="comment">// extractable</span>
["sign"]);
keyGen.oncomplete = function onKeyGenComplete(event)
{
<span class="comment">// The keyGen operation is complete</span>
- console.log("Public Key ID: " + event.target.result.publicKey.id);
<span class="comment">// create a "signer" CryptoOperation object</span>
- var signer = window.crypto.createSigner(algorithmSign, event.target.result.privateKey.id);
+ var signer = window.crypto.createSigner(algorithmSign, event.target.result.privateKey);
signer.oncomplete = function signer_oncomplete(event)
{
console.log("The signer CryptoOperation is finished, the signature is: " +
@@ -3150,18 +3138,11 @@
<span class="comment">// Create a keygenerator to produce a one-time-use AES key to encrypt some data</span>
var cryptoKeyGen = window.crypto.createKeyGenerator(aesAlgorithmKeyGen,
- false, <span class="comment">// temporary</span>
false, <span class="comment">// extractable</span>
["encrypt"]);
cryptoKeyGen.oncomplete = function ckg_onComplete(event)
{
-<span class="comment">
- // Optionally get the keyId and key via the id:
- // var aesKeyId = event.target.result.id;
- // var aesKey = window.crypto.keys.getKeyByKeyId(aesKeyId);
-</span>
-
var aesKey = event.target.result;
var aesSymmetricCryptoOp = window.crypto.createEncrypter(aesAlgorithmEncrypt, aesKey);