{"action":"created","comment":{"url":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/comments/44299647","id":44299647,"diff_hunk":"@@ -112,106 +142,145 @@ trait JsonWebKey extends js.Object {\n trait SubtleCrypto extends js.Object {\n   /**\n    * Returns a Promise of the encrypted data corresponding to the clear text,\n-   * algorithm and key given as parameters.\n+   * algorithm and key given as parameters. MDN\n    *\n-   * MDN\n+   * Defined at\n+   * [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-encrypt ¶14.3.1 The encrypt method]]\n+   *\n+   * We are being a bit more precise than the official definition by requiring a KeyAlgorithmIdentifier\n+   * rather than an AlgorithmIdentifier for the algorithm field.\n    */\n-  def encrypt(algorithm: String, key: CryptoKey,\n+  def encrypt(algorithm: KeyAlgorithmIdentifier, key: CryptoKey,\n       data: BufferSource): Promise[js.Any] = js.native\n \n   /**\n    * Returns a Promise of the clear data corresponding to the encrypted text,\n-   * algorithm and key given as parameters.\n+   * algorithm and key given as parameters. MDN\n    *\n-   * MDN\n+   * Defined at\n+   * [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-decrypt ¶14.3.2 The decrypt method]]\n+   *\n+   * We are being a bit more precise than the official definition by requiring a KeyAlgorithmIdentifier\n+   * rather than an AlgorithmIdentifier for the algorithm field.\n    */\n-  def decrypt(algorithm: String, key: CryptoKey,\n+  def decrypt(algorithm: KeyAlgorithmIdentifier, key: CryptoKey,\n       data: BufferSource): Promise[js.Any] = js.native\n \n   /**\n    * Returns a Promise of the signature corresponding to the text, algorithm\n-   * and key given as parameters.\n+   * and key given as parameters.  MDN\n    *\n-   * MDN\n+   * Defined at\n+   * [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-sign ¶14.3.3 The sign method]]\n+   *\n+   * We are being a bit more precise than the official definition by requiring a KeyAlgorithmIdentifier\n+   * rather than an AlgorithmIdentifier for the algorithm field.\n    */\n-  def sign(algorithm: String, key: CryptoKey,\n+  def sign(algorithm: KeyAlgorithmIdentifier, key: CryptoKey,\n       data: BufferSource): Promise[js.Any] = js.native\n \n   /**\n    * Returns a Promise of a Boolean value indicating if the signature given as\n-   * parameter matches the text, algorithm and key also given as parameters.\n+   * parameter matches the text, algorithm and key also given as parameters.  MDN\n    *\n-   * MDN\n+   * Defined at\n+   * [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-verify ¶14.3.4 The verify method]]\n+   *\n+   * We are being a bit more precise than the official definition by requiring a KeyAlgorithmIdentifier\n+   * rather than an AlgorithmIdentifier.\n    */\n-  def verify(algorithm: String, key: CryptoKey, signature: BufferSource,\n-      data: BufferSource): Promise[js.Any] = js.native\n+  def verify(algorithm: KeyAlgorithmIdentifier, key: CryptoKey,\n+             signature: BufferSource, data: BufferSource): Promise[js.Any] = js.native\n \n   /**\n    * Returns a Promise of a digest generated from the algorithm and text given\n-   * as parameters.\n+   * as parameters. MDN\n    *\n-   * MDN\n+   * Defined at [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-digest ¶14.3.5 The digest method]]\n    */\n-  def digest(algorithm: String, data: BufferSource): Promise[js.Any] = js.native\n+  def digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise[js.Any] = js.native\n \n   /**\n    * Returns a Promise of a newly generated CryptoKey, for symmetrical\n    * algorithms, or a CryptoKeyPair, containing two newly generated keys, for\n    * asymmetrical algorithm, that matches the algorithm, the usages and the\n-   * extractability given as parameters.\n+   * extractability given as parameters.   MDN\n+   *\n+   * Defined at\n+   * [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-generateKey ¶14.3.6 The generateKey method]]\n+   *\n+   * We are being a bit more precise than the official definition by requiring a KeyAlgorithmIdentifier\n+   * rather than an AlgorithmIdentifier for the algorithm field.\n    *\n-   * MDN\n    */\n-  def generateKey(algorithm: String, extractable: Boolean,\n-      keyUsages: js.Array[String]): Promise[js.Any] = js.native\n+  def generateKey(algorithm: KeyAlgorithmIdentifier, extractable: Boolean,\n+      keyUsages: js.Array[KeyUsage]): Promise[js.Any] = js.native\n \n   /**\n    * Returns a Promise of a newly generated CryptoKey derivated from a master\n-   * key and a specific algorithm given as parameters.\n+   * key and a specific algorithm given as parameters. MDF\n    *\n-   * MDN\n+   * Defined at\n+   * [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-deriveKey ¶14.3.7 The deriveKey method]]\n+   *\n+   * We are being a bit more precise than the official definition by requiring a KeyAlgorithmIdentifier\n+   * rather than an AlgorithmIdentifier for the algorithm and derivedKeyType field\n    */\n-  def deriveKey(algorithm: String, baseKey: CryptoKey,\n-      derivedKeyType: String, extractable: Boolean,\n-      keyUsages: js.Array[String]): Promise[js.Any] = js.native\n+  def deriveKey(algorithm: KeyAlgorithmIdentifier, baseKey: CryptoKey,\n+      derivedKeyType: KeyAlgorithmIdentifier, extractable: Boolean,\n+      keyUsages: js.Array[KeyUsage]): Promise[js.Any] = js.native\n \n   /**\n    * Returns a Promise of a newly generated buffer of pseudo-random bits\n-   * derivated from a master key and a specific algorithm given as parameters.\n+   * derivated from a master key and a specific algorithm given as parameters. MDN\n    *\n-   * MDN\n+   * Defined at\n+   * [[http://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-deriveBits ¶14.3.8 The deriveBits method]]\n+   *\n+   * We are being a bit more precise than the official definition by requiring a KeyAlgorithmIdentifier\n+   * rather than an AlgorithmIdentifier.\n+","path":"src/main/scala/org/scalajs/dom/crypto/Crypto.scala","position":184,"original_position":184,"commit_id":"099c0c00e90d756eaa4f803a49db1c981b9ce4e9","original_commit_id":"099c0c00e90d756eaa4f803a49db1c981b9ce4e9","user":{"login":"sjrd","id":535934,"avatar_url":"https://avatars.githubusercontent.com/u/535934?v=3","gravatar_id":"","url":"https://api.github.com/users/sjrd","html_url":"https://github.com/sjrd","followers_url":"https://api.github.com/users/sjrd/followers","following_url":"https://api.github.com/users/sjrd/following{/other_user}","gists_url":"https://api.github.com/users/sjrd/gists{/gist_id}","starred_url":"https://api.github.com/users/sjrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjrd/subscriptions","organizations_url":"https://api.github.com/users/sjrd/orgs","repos_url":"https://api.github.com/users/sjrd/repos","events_url":"https://api.github.com/users/sjrd/events{/privacy}","received_events_url":"https://api.github.com/users/sjrd/received_events","type":"User","site_admin":false},"body":"Spurious blank line.","created_at":"2015-11-09T16:59:58Z","updated_at":"2015-11-09T16:59:58Z","html_url":"https://github.com/scala-js/scala-js-dom/pull/169#discussion_r44299647","pull_request_url":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/169","_links":{"self":{"href":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/comments/44299647"},"html":{"href":"https://github.com/scala-js/scala-js-dom/pull/169#discussion_r44299647"},"pull_request":{"href":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/169"}}},"pull_request":{"url":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/169","id":50063115,"html_url":"https://github.com/scala-js/scala-js-dom/pull/169","diff_url":"https://github.com/scala-js/scala-js-dom/pull/169.diff","patch_url":"https://github.com/scala-js/scala-js-dom/pull/169.patch","issue_url":"https://api.github.com/repos/scala-js/scala-js-dom/issues/169","number":169,"state":"open","locked":false,"title":"Fix #166: generateKeyApi not flexible enough.","user":{"login":"bblfish","id":124506,"avatar_url":"https://avatars.githubusercontent.com/u/124506?v=3","gravatar_id":"","url":"https://api.github.com/users/bblfish","html_url":"https://github.com/bblfish","followers_url":"https://api.github.com/users/bblfish/followers","following_url":"https://api.github.com/users/bblfish/following{/other_user}","gists_url":"https://api.github.com/users/bblfish/gists{/gist_id}","starred_url":"https://api.github.com/users/bblfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bblfish/subscriptions","organizations_url":"https://api.github.com/users/bblfish/orgs","repos_url":"https://api.github.com/users/bblfish/repos","events_url":"https://api.github.com/users/bblfish/events{/privacy}","received_events_url":"https://api.github.com/users/bblfish/received_events","type":"User","site_admin":false},"body":"With these changes it is possible to code the [WebCrypto API signing example](http://www.w3.org/TR/WebCryptoAPI/#examples-signing) in the same style as the example fixing #166 \r\n\r\n```scala\r\n    GlobalCrypto.crypto.subtle.generateKey(\r\n      RsaHashedKeyGenParams(\r\n        2048,\r\n        new Uint8Array(js.Array[Short](1,0,1)), //65537\r\n        HashAlgorithm.`SHA-256`),\r\n      false,\r\n      js.Array(KeyUsages.sign,KeyUsages.verify)\r\n    )\r\n```\r\n","created_at":"2015-11-08T15:58:55Z","updated_at":"2015-11-09T16:59:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a592a4a160748030e550b86b801ded8e51f014f6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/169/commits","review_comments_url":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/169/comments","review_comment_url":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scala-js/scala-js-dom/issues/169/comments","statuses_url":"https://api.github.com/repos/scala-js/scala-js-dom/statuses/099c0c00e90d756eaa4f803a49db1c981b9ce4e9","head":{"label":"bblfish:fix-generate-key-api","ref":"fix-generate-key-api","sha":"099c0c00e90d756eaa4f803a49db1c981b9ce4e9","user":{"login":"bblfish","id":124506,"avatar_url":"https://avatars.githubusercontent.com/u/124506?v=3","gravatar_id":"","url":"https://api.github.com/users/bblfish","html_url":"https://github.com/bblfish","followers_url":"https://api.github.com/users/bblfish/followers","following_url":"https://api.github.com/users/bblfish/following{/other_user}","gists_url":"https://api.github.com/users/bblfish/gists{/gist_id}","starred_url":"https://api.github.com/users/bblfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bblfish/subscriptions","organizations_url":"https://api.github.com/users/bblfish/orgs","repos_url":"https://api.github.com/users/bblfish/repos","events_url":"https://api.github.com/users/bblfish/events{/privacy}","received_events_url":"https://api.github.com/users/bblfish/received_events","type":"User","site_admin":false},"repo":{"id":45736516,"name":"scala-js-dom","full_name":"bblfish/scala-js-dom","owner":{"login":"bblfish","id":124506,"avatar_url":"https://avatars.githubusercontent.com/u/124506?v=3","gravatar_id":"","url":"https://api.github.com/users/bblfish","html_url":"https://github.com/bblfish","followers_url":"https://api.github.com/users/bblfish/followers","following_url":"https://api.github.com/users/bblfish/following{/other_user}","gists_url":"https://api.github.com/users/bblfish/gists{/gist_id}","starred_url":"https://api.github.com/users/bblfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bblfish/subscriptions","organizations_url":"https://api.github.com/users/bblfish/orgs","repos_url":"https://api.github.com/users/bblfish/repos","events_url":"https://api.github.com/users/bblfish/events{/privacy}","received_events_url":"https://api.github.com/users/bblfish/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bblfish/scala-js-dom","description":"statically typed dom wrappers for scala-js","fork":true,"url":"https://api.github.com/repos/bblfish/scala-js-dom","forks_url":"https://api.github.com/repos/bblfish/scala-js-dom/forks","keys_url":"https://api.github.com/repos/bblfish/scala-js-dom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bblfish/scala-js-dom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bblfish/scala-js-dom/teams","hooks_url":"https://api.github.com/repos/bblfish/scala-js-dom/hooks","issue_events_url":"https://api.github.com/repos/bblfish/scala-js-dom/issues/events{/number}","events_url":"https://api.github.com/repos/bblfish/scala-js-dom/events","assignees_url":"https://api.github.com/repos/bblfish/scala-js-dom/assignees{/user}","branches_url":"https://api.github.com/repos/bblfish/scala-js-dom/branches{/branch}","tags_url":"https://api.github.com/repos/bblfish/scala-js-dom/tags","blobs_url":"https://api.github.com/repos/bblfish/scala-js-dom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bblfish/scala-js-dom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bblfish/scala-js-dom/git/refs{/sha}","trees_url":"https://api.github.com/repos/bblfish/scala-js-dom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bblfish/scala-js-dom/statuses/{sha}","languages_url":"https://api.github.com/repos/bblfish/scala-js-dom/languages","stargazers_url":"https://api.github.com/repos/bblfish/scala-js-dom/stargazers","contributors_url":"https://api.github.com/repos/bblfish/scala-js-dom/contributors","subscribers_url":"https://api.github.com/repos/bblfish/scala-js-dom/subscribers","subscription_url":"https://api.github.com/repos/bblfish/scala-js-dom/subscription","commits_url":"https://api.github.com/repos/bblfish/scala-js-dom/commits{/sha}","git_commits_url":"https://api.github.com/repos/bblfish/scala-js-dom/git/commits{/sha}","comments_url":"https://api.github.com/repos/bblfish/scala-js-dom/comments{/number}","issue_comment_url":"https://api.github.com/repos/bblfish/scala-js-dom/issues/comments{/number}","contents_url":"https://api.github.com/repos/bblfish/scala-js-dom/contents/{+path}","compare_url":"https://api.github.com/repos/bblfish/scala-js-dom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bblfish/scala-js-dom/merges","archive_url":"https://api.github.com/repos/bblfish/scala-js-dom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bblfish/scala-js-dom/downloads","issues_url":"https://api.github.com/repos/bblfish/scala-js-dom/issues{/number}","pulls_url":"https://api.github.com/repos/bblfish/scala-js-dom/pulls{/number}","milestones_url":"https://api.github.com/repos/bblfish/scala-js-dom/milestones{/number}","notifications_url":"https://api.github.com/repos/bblfish/scala-js-dom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bblfish/scala-js-dom/labels{/name}","releases_url":"https://api.github.com/repos/bblfish/scala-js-dom/releases{/id}","created_at":"2015-11-07T12:59:47Z","updated_at":"2015-11-07T12:59:48Z","pushed_at":"2015-11-09T16:34:47Z","git_url":"git://github.com/bblfish/scala-js-dom.git","ssh_url":"git@github.com:bblfish/scala-js-dom.git","clone_url":"https://github.com/bblfish/scala-js-dom.git","svn_url":"https://github.com/bblfish/scala-js-dom","homepage":null,"size":2049,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scala-js:master","ref":"master","sha":"d80ee580e532a663e3ae429c160286d3e1be4454","user":{"login":"scala-js","id":6039724,"avatar_url":"https://avatars.githubusercontent.com/u/6039724?v=3","gravatar_id":"","url":"https://api.github.com/users/scala-js","html_url":"https://github.com/scala-js","followers_url":"https://api.github.com/users/scala-js/followers","following_url":"https://api.github.com/users/scala-js/following{/other_user}","gists_url":"https://api.github.com/users/scala-js/gists{/gist_id}","starred_url":"https://api.github.com/users/scala-js/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala-js/subscriptions","organizations_url":"https://api.github.com/users/scala-js/orgs","repos_url":"https://api.github.com/users/scala-js/repos","events_url":"https://api.github.com/users/scala-js/events{/privacy}","received_events_url":"https://api.github.com/users/scala-js/received_events","type":"Organization","site_admin":false},"repo":{"id":13578796,"name":"scala-js-dom","full_name":"scala-js/scala-js-dom","owner":{"login":"scala-js","id":6039724,"avatar_url":"https://avatars.githubusercontent.com/u/6039724?v=3","gravatar_id":"","url":"https://api.github.com/users/scala-js","html_url":"https://github.com/scala-js","followers_url":"https://api.github.com/users/scala-js/followers","following_url":"https://api.github.com/users/scala-js/following{/other_user}","gists_url":"https://api.github.com/users/scala-js/gists{/gist_id}","starred_url":"https://api.github.com/users/scala-js/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala-js/subscriptions","organizations_url":"https://api.github.com/users/scala-js/orgs","repos_url":"https://api.github.com/users/scala-js/repos","events_url":"https://api.github.com/users/scala-js/events{/privacy}","received_events_url":"https://api.github.com/users/scala-js/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scala-js/scala-js-dom","description":"statically typed dom wrappers for scala-js","fork":false,"url":"https://api.github.com/repos/scala-js/scala-js-dom","forks_url":"https://api.github.com/repos/scala-js/scala-js-dom/forks","keys_url":"https://api.github.com/repos/scala-js/scala-js-dom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scala-js/scala-js-dom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scala-js/scala-js-dom/teams","hooks_url":"https://api.github.com/repos/scala-js/scala-js-dom/hooks","issue_events_url":"https://api.github.com/repos/scala-js/scala-js-dom/issues/events{/number}","events_url":"https://api.github.com/repos/scala-js/scala-js-dom/events","assignees_url":"https://api.github.com/repos/scala-js/scala-js-dom/assignees{/user}","branches_url":"https://api.github.com/repos/scala-js/scala-js-dom/branches{/branch}","tags_url":"https://api.github.com/repos/scala-js/scala-js-dom/tags","blobs_url":"https://api.github.com/repos/scala-js/scala-js-dom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scala-js/scala-js-dom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scala-js/scala-js-dom/git/refs{/sha}","trees_url":"https://api.github.com/repos/scala-js/scala-js-dom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scala-js/scala-js-dom/statuses/{sha}","languages_url":"https://api.github.com/repos/scala-js/scala-js-dom/languages","stargazers_url":"https://api.github.com/repos/scala-js/scala-js-dom/stargazers","contributors_url":"https://api.github.com/repos/scala-js/scala-js-dom/contributors","subscribers_url":"https://api.github.com/repos/scala-js/scala-js-dom/subscribers","subscription_url":"https://api.github.com/repos/scala-js/scala-js-dom/subscription","commits_url":"https://api.github.com/repos/scala-js/scala-js-dom/commits{/sha}","git_commits_url":"https://api.github.com/repos/scala-js/scala-js-dom/git/commits{/sha}","comments_url":"https://api.github.com/repos/scala-js/scala-js-dom/comments{/number}","issue_comment_url":"https://api.github.com/repos/scala-js/scala-js-dom/issues/comments{/number}","contents_url":"https://api.github.com/repos/scala-js/scala-js-dom/contents/{+path}","compare_url":"https://api.github.com/repos/scala-js/scala-js-dom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scala-js/scala-js-dom/merges","archive_url":"https://api.github.com/repos/scala-js/scala-js-dom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scala-js/scala-js-dom/downloads","issues_url":"https://api.github.com/repos/scala-js/scala-js-dom/issues{/number}","pulls_url":"https://api.github.com/repos/scala-js/scala-js-dom/pulls{/number}","milestones_url":"https://api.github.com/repos/scala-js/scala-js-dom/milestones{/number}","notifications_url":"https://api.github.com/repos/scala-js/scala-js-dom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scala-js/scala-js-dom/labels{/name}","releases_url":"https://api.github.com/repos/scala-js/scala-js-dom/releases{/id}","created_at":"2013-10-15T02:35:07Z","updated_at":"2015-11-06T22:32:18Z","pushed_at":"2015-11-09T16:34:47Z","git_url":"git://github.com/scala-js/scala-js-dom.git","ssh_url":"git@github.com:scala-js/scala-js-dom.git","clone_url":"https://github.com/scala-js/scala-js-dom.git","svn_url":"https://github.com/scala-js/scala-js-dom","homepage":null,"size":3085,"stargazers_count":97,"watchers_count":97,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":44,"mirror_url":null,"open_issues_count":15,"forks":44,"open_issues":15,"watchers":97,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/169"},"html":{"href":"https://github.com/scala-js/scala-js-dom/pull/169"},"issue":{"href":"https://api.github.com/repos/scala-js/scala-js-dom/issues/169"},"comments":{"href":"https://api.github.com/repos/scala-js/scala-js-dom/issues/169/comments"},"review_comments":{"href":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/169/comments"},"review_comment":{"href":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scala-js/scala-js-dom/pulls/169/commits"},"statuses":{"href":"https://api.github.com/repos/scala-js/scala-js-dom/statuses/099c0c00e90d756eaa4f803a49db1c981b9ce4e9"}}}}