{"action":"created","comment":{"url":"https://api.github.com/repos/alextaka/u2f-ref-code/pulls/comments/87157889","pull_request_review_id":7779383,"id":87157889,"diff_hunk":"@@ -215,4 +291,65 @@ public static AuthenticateResponse decodeAuthenticateResponse(byte[] data) throw\n     .put(challengeSha256);\n     return signedData;\n   }\n+  \n+  public static byte[] encodeTransferAccessMessageSignedBytesForAuthenticationKey(\n+      byte sequenceNumber, byte[] newUserPublicKey, byte[] applicationSha256,\n+      X509Certificate attestationCertificate) throws U2FException {\n+\n+    byte[] attestationCertificateBytes;\n+    try {\n+      attestationCertificateBytes = attestationCertificate.getEncoded();\n+    } catch (CertificateEncodingException e) {\n+      throw new U2FException(\"Error when encoding attestation certificate.\", e);\n+    }\n+\n+    byte[] signedData = new byte[1 + newUserPublicKey.length + applicationSha256.length\n+        + attestationCertificateBytes.length];\n+    \n+    ByteBuffer.wrap(signedData)\n+    .put(sequenceNumber)\n+    .put(newUserPublicKey)\n+    .put(applicationSha256)\n+    .put(attestationCertificateBytes);\n+    return signedData;\n+  }\n+  \n+  public static byte[] encodeTransferAccessMessageSignedBytesForAttestationKey(byte sequenceNumber,\n+      byte[] newUserPublicKey, byte[] applicationSha256, X509Certificate attestationCertificate,\n+      byte[] signatureUsingAuthenticationKey) throws U2FException {\n+\n+    byte[] attestationCertificateBytes;\n+    try {\n+      attestationCertificateBytes = attestationCertificate.getEncoded();\n+    } catch (CertificateEncodingException e) {\n+      throw new U2FException(\"Error when encoding attestation certificate.\", e);\n+    }\n+\n+    byte[] signedData = new byte[1 + newUserPublicKey.length + applicationSha256.length\n+        + attestationCertificateBytes.length + signatureUsingAuthenticationKey.length];\n+    \n+    ByteBuffer.wrap(signedData)","path":"u2f-ref-code/java/src/com/google/u2f/codec/RawMessageCodec.java","position":131,"original_position":131,"commit_id":"1651cf74405642c62d725545e935b2093cd61e9d","original_commit_id":"1651cf74405642c62d725545e935b2093cd61e9d","user":{"login":"leshi","id":1407369,"avatar_url":"https://avatars.githubusercontent.com/u/1407369?v=3","gravatar_id":"","url":"https://api.github.com/users/leshi","html_url":"https://github.com/leshi","followers_url":"https://api.github.com/users/leshi/followers","following_url":"https://api.github.com/users/leshi/following{/other_user}","gists_url":"https://api.github.com/users/leshi/gists{/gist_id}","starred_url":"https://api.github.com/users/leshi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leshi/subscriptions","organizations_url":"https://api.github.com/users/leshi/orgs","repos_url":"https://api.github.com/users/leshi/repos","events_url":"https://api.github.com/users/leshi/events{/privacy}","received_events_url":"https://api.github.com/users/leshi/received_events","type":"User","site_admin":false},"body":"same as above","created_at":"2016-11-09T09:34:27Z","updated_at":"2016-11-09T09:34:27Z","html_url":"https://github.com/alextaka/u2f-ref-code/pull/12#discussion_r87157889","pull_request_url":"https://api.github.com/repos/alextaka/u2f-ref-code/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/alextaka/u2f-ref-code/pulls/comments/87157889"},"html":{"href":"https://github.com/alextaka/u2f-ref-code/pull/12#discussion_r87157889"},"pull_request":{"href":"https://api.github.com/repos/alextaka/u2f-ref-code/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/alextaka/u2f-ref-code/pulls/12","id":92672110,"html_url":"https://github.com/alextaka/u2f-ref-code/pull/12","diff_url":"https://github.com/alextaka/u2f-ref-code/pull/12.diff","patch_url":"https://github.com/alextaka/u2f-ref-code/pull/12.patch","issue_url":"https://api.github.com/repos/alextaka/u2f-ref-code/issues/12","number":12,"state":"open","locked":false,"title":"Update RawMessageCodec and tests","user":{"login":"alextaka","id":5852034,"avatar_url":"https://avatars.githubusercontent.com/u/5852034?v=3","gravatar_id":"","url":"https://api.github.com/users/alextaka","html_url":"https://github.com/alextaka","followers_url":"https://api.github.com/users/alextaka/followers","following_url":"https://api.github.com/users/alextaka/following{/other_user}","gists_url":"https://api.github.com/users/alextaka/gists{/gist_id}","starred_url":"https://api.github.com/users/alextaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alextaka/subscriptions","organizations_url":"https://api.github.com/users/alextaka/orgs","repos_url":"https://api.github.com/users/alextaka/repos","events_url":"https://api.github.com/users/alextaka/events{/privacy}","received_events_url":"https://api.github.com/users/alextaka/received_events","type":"User","site_admin":false},"body":"Adding ability to decode TransferAccessResponse and adding associated test skeletons","created_at":"2016-11-07T21:54:14Z","updated_at":"2016-11-09T09:35:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"455fb2a0c1051dcdb1518d003093beee090bb75e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/alextaka/u2f-ref-code/pulls/12/commits","review_comments_url":"https://api.github.com/repos/alextaka/u2f-ref-code/pulls/12/comments","review_comment_url":"https://api.github.com/repos/alextaka/u2f-ref-code/pulls/comments{/number}","comments_url":"https://api.github.com/repos/alextaka/u2f-ref-code/issues/12/comments","statuses_url":"https://api.github.com/repos/alextaka/u2f-ref-code/statuses/1651cf74405642c62d725545e935b2093cd61e9d","head":{"label":"alextaka:update-RawMessageCodec","ref":"update-RawMessageCodec","sha":"1651cf74405642c62d725545e935b2093cd61e9d","user":{"login":"alextaka","id":5852034,"avatar_url":"https://avatars.githubusercontent.com/u/5852034?v=3","gravatar_id":"","url":"https://api.github.com/users/alextaka","html_url":"https://github.com/alextaka","followers_url":"https://api.github.com/users/alextaka/followers","following_url":"https://api.github.com/users/alextaka/following{/other_user}","gists_url":"https://api.github.com/users/alextaka/gists{/gist_id}","starred_url":"https://api.github.com/users/alextaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alextaka/subscriptions","organizations_url":"https://api.github.com/users/alextaka/orgs","repos_url":"https://api.github.com/users/alextaka/repos","events_url":"https://api.github.com/users/alextaka/events{/privacy}","received_events_url":"https://api.github.com/users/alextaka/received_events","type":"User","site_admin":false},"repo":{"id":61751491,"name":"u2f-ref-code","full_name":"alextaka/u2f-ref-code","owner":{"login":"alextaka","id":5852034,"avatar_url":"https://avatars.githubusercontent.com/u/5852034?v=3","gravatar_id":"","url":"https://api.github.com/users/alextaka","html_url":"https://github.com/alextaka","followers_url":"https://api.github.com/users/alextaka/followers","following_url":"https://api.github.com/users/alextaka/following{/other_user}","gists_url":"https://api.github.com/users/alextaka/gists{/gist_id}","starred_url":"https://api.github.com/users/alextaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alextaka/subscriptions","organizations_url":"https://api.github.com/users/alextaka/orgs","repos_url":"https://api.github.com/users/alextaka/repos","events_url":"https://api.github.com/users/alextaka/events{/privacy}","received_events_url":"https://api.github.com/users/alextaka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alextaka/u2f-ref-code","description":"U2F reference implementations","fork":true,"url":"https://api.github.com/repos/alextaka/u2f-ref-code","forks_url":"https://api.github.com/repos/alextaka/u2f-ref-code/forks","keys_url":"https://api.github.com/repos/alextaka/u2f-ref-code/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alextaka/u2f-ref-code/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alextaka/u2f-ref-code/teams","hooks_url":"https://api.github.com/repos/alextaka/u2f-ref-code/hooks","issue_events_url":"https://api.github.com/repos/alextaka/u2f-ref-code/issues/events{/number}","events_url":"https://api.github.com/repos/alextaka/u2f-ref-code/events","assignees_url":"https://api.github.com/repos/alextaka/u2f-ref-code/assignees{/user}","branches_url":"https://api.github.com/repos/alextaka/u2f-ref-code/branches{/branch}","tags_url":"https://api.github.com/repos/alextaka/u2f-ref-code/tags","blobs_url":"https://api.github.com/repos/alextaka/u2f-ref-code/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alextaka/u2f-ref-code/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alextaka/u2f-ref-code/git/refs{/sha}","trees_url":"https://api.github.com/repos/alextaka/u2f-ref-code/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alextaka/u2f-ref-code/statuses/{sha}","languages_url":"https://api.github.com/repos/alextaka/u2f-ref-code/languages","stargazers_url":"https://api.github.com/repos/alextaka/u2f-ref-code/stargazers","contributors_url":"https://api.github.com/repos/alextaka/u2f-ref-code/contributors","subscribers_url":"https://api.github.com/repos/alextaka/u2f-ref-code/subscribers","subscription_url":"https://api.github.com/repos/alextaka/u2f-ref-code/subscription","commits_url":"https://api.github.com/repos/alextaka/u2f-ref-code/commits{/sha}","git_commits_url":"https://api.github.com/repos/alextaka/u2f-ref-code/git/commits{/sha}","comments_url":"https://api.github.com/repos/alextaka/u2f-ref-code/comments{/number}","issue_comment_url":"https://api.github.com/repos/alextaka/u2f-ref-code/issues/comments{/number}","contents_url":"https://api.github.com/repos/alextaka/u2f-ref-code/contents/{+path}","compare_url":"https://api.github.com/repos/alextaka/u2f-ref-code/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alextaka/u2f-ref-code/merges","archive_url":"https://api.github.com/repos/alextaka/u2f-ref-code/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alextaka/u2f-ref-code/downloads","issues_url":"https://api.github.com/repos/alextaka/u2f-ref-code/issues{/number}","pulls_url":"https://api.github.com/repos/alextaka/u2f-ref-code/pulls{/number}","milestones_url":"https://api.github.com/repos/alextaka/u2f-ref-code/milestones{/number}","notifications_url":"https://api.github.com/repos/alextaka/u2f-ref-code/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alextaka/u2f-ref-code/labels{/name}","releases_url":"https://api.github.com/repos/alextaka/u2f-ref-code/releases{/id}","deployments_url":"https://api.github.com/repos/alextaka/u2f-ref-code/deployments","created_at":"2016-06-22T21:06:10Z","updated_at":"2016-06-22T21:06:11Z","pushed_at":"2016-11-07T21:54:15Z","git_url":"git://github.com/alextaka/u2f-ref-code.git","ssh_url":"git@github.com:alextaka/u2f-ref-code.git","clone_url":"https://github.com/alextaka/u2f-ref-code.git","svn_url":"https://github.com/alextaka/u2f-ref-code","homepage":"","size":148041,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"alextaka:add-transfer-access","ref":"add-transfer-access","sha":"008aff824da7545c94409b782f92c7bc48826d81","user":{"login":"alextaka","id":5852034,"avatar_url":"https://avatars.githubusercontent.com/u/5852034?v=3","gravatar_id":"","url":"https://api.github.com/users/alextaka","html_url":"https://github.com/alextaka","followers_url":"https://api.github.com/users/alextaka/followers","following_url":"https://api.github.com/users/alextaka/following{/other_user}","gists_url":"https://api.github.com/users/alextaka/gists{/gist_id}","starred_url":"https://api.github.com/users/alextaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alextaka/subscriptions","organizations_url":"https://api.github.com/users/alextaka/orgs","repos_url":"https://api.github.com/users/alextaka/repos","events_url":"https://api.github.com/users/alextaka/events{/privacy}","received_events_url":"https://api.github.com/users/alextaka/received_events","type":"User","site_admin":false},"repo":{"id":61751491,"name":"u2f-ref-code","full_name":"alextaka/u2f-ref-code","owner":{"login":"alextaka","id":5852034,"avatar_url":"https://avatars.githubusercontent.com/u/5852034?v=3","gravatar_id":"","url":"https://api.github.com/users/alextaka","html_url":"https://github.com/alextaka","followers_url":"https://api.github.com/users/alextaka/followers","following_url":"https://api.github.com/users/alextaka/following{/other_user}","gists_url":"https://api.github.com/users/alextaka/gists{/gist_id}","starred_url":"https://api.github.com/users/alextaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alextaka/subscriptions","organizations_url":"https://api.github.com/users/alextaka/orgs","repos_url":"https://api.github.com/users/alextaka/repos","events_url":"https://api.github.com/users/alextaka/events{/privacy}","received_events_url":"https://api.github.com/users/alextaka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alextaka/u2f-ref-code","description":"U2F reference implementations","fork":true,"url":"https://api.github.com/repos/alextaka/u2f-ref-code","forks_url":"https://api.github.com/repos/alextaka/u2f-ref-code/forks","keys_url":"https://api.github.com/repos/alextaka/u2f-ref-code/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alextaka/u2f-ref-code/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alextaka/u2f-ref-code/teams","hooks_url":"https://api.github.com/repos/alextaka/u2f-ref-code/hooks","issue_events_url":"https://api.github.com/repos/alextaka/u2f-ref-code/issues/events{/number}","events_url":"https://api.github.com/repos/alextaka/u2f-ref-code/events","assignees_url":"https://api.github.com/repos/alextaka/u2f-ref-code/assignees{/user}","branches_url":"https://api.github.com/repos/alextaka/u2f-ref-code/branches{/branch}","tags_url":"https://api.github.com/repos/alextaka/u2f-ref-code/tags","blobs_url":"https://api.github.com/repos/alextaka/u2f-ref-code/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alextaka/u2f-ref-code/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alextaka/u2f-ref-code/git/refs{/sha}","trees_url":"https://api.github.com/repos/alextaka/u2f-ref-code/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alextaka/u2f-ref-code/statuses/{sha}","languages_url":"https://api.github.com/repos/alextaka/u2f-ref-code/languages","stargazers_url":"https://api.github.com/repos/alextaka/u2f-ref-code/stargazers","contributors_url":"https://api.github.com/repos/alextaka/u2f-ref-code/contributors","subscribers_url":"https://api.github.com/repos/alextaka/u2f-ref-code/subscribers","subscription_url":"https://api.github.com/repos/alextaka/u2f-ref-code/subscription","commits_url":"https://api.github.com/repos/alextaka/u2f-ref-code/commits{/sha}","git_commits_url":"https://api.github.com/repos/alextaka/u2f-ref-code/git/commits{/sha}","comments_url":"https://api.github.com/repos/alextaka/u2f-ref-code/comments{/number}","issue_comment_url":"https://api.github.com/repos/alextaka/u2f-ref-code/issues/comments{/number}","contents_url":"https://api.github.com/repos/alextaka/u2f-ref-code/contents/{+path}","compare_url":"https://api.github.com/repos/alextaka/u2f-ref-code/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alextaka/u2f-ref-code/merges","archive_url":"https://api.github.com/repos/alextaka/u2f-ref-code/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alextaka/u2f-ref-code/downloads","issues_url":"https://api.github.com/repos/alextaka/u2f-ref-code/issues{/number}","pulls_url":"https://api.github.com/repos/alextaka/u2f-ref-code/pulls{/number}","milestones_url":"https://api.github.com/repos/alextaka/u2f-ref-code/milestones{/number}","notifications_url":"https://api.github.com/repos/alextaka/u2f-ref-code/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alextaka/u2f-ref-code/labels{/name}","releases_url":"https://api.github.com/repos/alextaka/u2f-ref-code/releases{/id}","deployments_url":"https://api.github.com/repos/alextaka/u2f-ref-code/deployments","created_at":"2016-06-22T21:06:10Z","updated_at":"2016-06-22T21:06:11Z","pushed_at":"2016-11-07T21:54:15Z","git_url":"git://github.com/alextaka/u2f-ref-code.git","ssh_url":"git@github.com:alextaka/u2f-ref-code.git","clone_url":"https://github.com/alextaka/u2f-ref-code.git","svn_url":"https://github.com/alextaka/u2f-ref-code","homepage":"","size":148041,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alextaka/u2f-ref-code/pulls/12"},"html":{"href":"https://github.com/alextaka/u2f-ref-code/pull/12"},"issue":{"href":"https://api.github.com/repos/alextaka/u2f-ref-code/issues/12"},"comments":{"href":"https://api.github.com/repos/alextaka/u2f-ref-code/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/alextaka/u2f-ref-code/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/alextaka/u2f-ref-code/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/alextaka/u2f-ref-code/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/alextaka/u2f-ref-code/statuses/1651cf74405642c62d725545e935b2093cd61e9d"}}}}
{"actor":{"display_login":"leshi"}}