{"action":"created","comment":{"url":"https://api.github.com/repos/line/line-bot-sdk-java/pulls/comments/64989715","id":64989715,"diff_hunk":"@@ -389,20 +395,23 @@ public MultipleMessageBuilder createMultipleMessageBuilder() {\n     @Override\n     public boolean validateSignature(@NonNull String jsonText, @NonNull String headerSignature)\n             throws LineBotAPIException {\n-        byte[] signature = this.createSignature(jsonText);\n-        byte[] decodeHeaderSignature = Base64.getDecoder().decode(headerSignature);\n-        return MessageDigest.isEqual(decodeHeaderSignature,\n-                                     signature);\n+        return validateSignature(jsonText.getBytes(StandardCharsets.UTF_8), headerSignature);\n+    }\n+\n+    @Override\n+    public boolean validateSignature(@NonNull byte[] jsonText, @NonNull String headerSignature)\n+            throws LineBotAPIException {\n+        final byte[] signature = createSignature(jsonText);\n+        final byte[] decodeHeaderSignature = Base64.getDecoder().decode(headerSignature);\n+        return MessageDigest.isEqual(decodeHeaderSignature, signature);\n     }\n \n     @Override\n-    public byte[] createSignature(@NonNull String jsonText) throws LineBotAPIException {\n+    public byte[] createSignature(@NonNull byte[] jsonText) throws LineBotAPIException {\n         try {\n-            SecretKeySpec key = new SecretKeySpec(this.channelSecret.getBytes(StandardCharsets.UTF_8),","path":"line-bot-api-client/src/main/java/com/linecorp/bot/client/DefaultLineBotClient.java","position":50,"original_position":50,"commit_id":"bc36f1833044f1cf9229d9d508cfc48901e3bebc","original_commit_id":"bc36f1833044f1cf9229d9d508cfc48901e3bebc","user":{"login":"synk","id":543209,"avatar_url":"https://avatars.githubusercontent.com/u/543209?v=3","gravatar_id":"","url":"https://api.github.com/users/synk","html_url":"https://github.com/synk","followers_url":"https://api.github.com/users/synk/followers","following_url":"https://api.github.com/users/synk/following{/other_user}","gists_url":"https://api.github.com/users/synk/gists{/gist_id}","starred_url":"https://api.github.com/users/synk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/synk/subscriptions","organizations_url":"https://api.github.com/users/synk/orgs","repos_url":"https://api.github.com/users/synk/repos","events_url":"https://api.github.com/users/synk/events{/privacy}","received_events_url":"https://api.github.com/users/synk/received_events","type":"User","site_admin":false},"body":"We don't need to create the keyspec every time","created_at":"2016-05-28T14:45:32Z","updated_at":"2016-05-28T14:45:32Z","html_url":"https://github.com/line/line-bot-sdk-java/pull/18#discussion_r64989715","pull_request_url":"https://api.github.com/repos/line/line-bot-sdk-java/pulls/18","_links":{"self":{"href":"https://api.github.com/repos/line/line-bot-sdk-java/pulls/comments/64989715"},"html":{"href":"https://github.com/line/line-bot-sdk-java/pull/18#discussion_r64989715"},"pull_request":{"href":"https://api.github.com/repos/line/line-bot-sdk-java/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/line/line-bot-sdk-java/pulls/18","id":71803586,"html_url":"https://github.com/line/line-bot-sdk-java/pull/18","diff_url":"https://github.com/line/line-bot-sdk-java/pull/18.diff","patch_url":"https://github.com/line/line-bot-sdk-java/pull/18.patch","issue_url":"https://api.github.com/repos/line/line-bot-sdk-java/issues/18","number":18,"state":"open","locked":false,"title":"refactor around signature validation for performance","user":{"login":"synk","id":543209,"avatar_url":"https://avatars.githubusercontent.com/u/543209?v=3","gravatar_id":"","url":"https://api.github.com/users/synk","html_url":"https://github.com/synk","followers_url":"https://api.github.com/users/synk/followers","following_url":"https://api.github.com/users/synk/following{/other_user}","gists_url":"https://api.github.com/users/synk/gists{/gist_id}","starred_url":"https://api.github.com/users/synk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/synk/subscriptions","organizations_url":"https://api.github.com/users/synk/orgs","repos_url":"https://api.github.com/users/synk/repos","events_url":"https://api.github.com/users/synk/events{/privacy}","received_events_url":"https://api.github.com/users/synk/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-28T14:43:52Z","updated_at":"2016-05-28T14:45:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4ce54fde89bf9c2197a51edf56c1e513daf0299b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/line/line-bot-sdk-java/pulls/18/commits","review_comments_url":"https://api.github.com/repos/line/line-bot-sdk-java/pulls/18/comments","review_comment_url":"https://api.github.com/repos/line/line-bot-sdk-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/line/line-bot-sdk-java/issues/18/comments","statuses_url":"https://api.github.com/repos/line/line-bot-sdk-java/statuses/bc36f1833044f1cf9229d9d508cfc48901e3bebc","head":{"label":"synk:bytes","ref":"bytes","sha":"bc36f1833044f1cf9229d9d508cfc48901e3bebc","user":{"login":"synk","id":543209,"avatar_url":"https://avatars.githubusercontent.com/u/543209?v=3","gravatar_id":"","url":"https://api.github.com/users/synk","html_url":"https://github.com/synk","followers_url":"https://api.github.com/users/synk/followers","following_url":"https://api.github.com/users/synk/following{/other_user}","gists_url":"https://api.github.com/users/synk/gists{/gist_id}","starred_url":"https://api.github.com/users/synk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/synk/subscriptions","organizations_url":"https://api.github.com/users/synk/orgs","repos_url":"https://api.github.com/users/synk/repos","events_url":"https://api.github.com/users/synk/events{/privacy}","received_events_url":"https://api.github.com/users/synk/received_events","type":"User","site_admin":false},"repo":{"id":56426954,"name":"line-bot-sdk-java","full_name":"synk/line-bot-sdk-java","owner":{"login":"synk","id":543209,"avatar_url":"https://avatars.githubusercontent.com/u/543209?v=3","gravatar_id":"","url":"https://api.github.com/users/synk","html_url":"https://github.com/synk","followers_url":"https://api.github.com/users/synk/followers","following_url":"https://api.github.com/users/synk/following{/other_user}","gists_url":"https://api.github.com/users/synk/gists{/gist_id}","starred_url":"https://api.github.com/users/synk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/synk/subscriptions","organizations_url":"https://api.github.com/users/synk/orgs","repos_url":"https://api.github.com/users/synk/repos","events_url":"https://api.github.com/users/synk/events{/privacy}","received_events_url":"https://api.github.com/users/synk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/synk/line-bot-sdk-java","description":"SDK of the LINE BOT API Trial for Java","fork":true,"url":"https://api.github.com/repos/synk/line-bot-sdk-java","forks_url":"https://api.github.com/repos/synk/line-bot-sdk-java/forks","keys_url":"https://api.github.com/repos/synk/line-bot-sdk-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/synk/line-bot-sdk-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/synk/line-bot-sdk-java/teams","hooks_url":"https://api.github.com/repos/synk/line-bot-sdk-java/hooks","issue_events_url":"https://api.github.com/repos/synk/line-bot-sdk-java/issues/events{/number}","events_url":"https://api.github.com/repos/synk/line-bot-sdk-java/events","assignees_url":"https://api.github.com/repos/synk/line-bot-sdk-java/assignees{/user}","branches_url":"https://api.github.com/repos/synk/line-bot-sdk-java/branches{/branch}","tags_url":"https://api.github.com/repos/synk/line-bot-sdk-java/tags","blobs_url":"https://api.github.com/repos/synk/line-bot-sdk-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/synk/line-bot-sdk-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/synk/line-bot-sdk-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/synk/line-bot-sdk-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/synk/line-bot-sdk-java/statuses/{sha}","languages_url":"https://api.github.com/repos/synk/line-bot-sdk-java/languages","stargazers_url":"https://api.github.com/repos/synk/line-bot-sdk-java/stargazers","contributors_url":"https://api.github.com/repos/synk/line-bot-sdk-java/contributors","subscribers_url":"https://api.github.com/repos/synk/line-bot-sdk-java/subscribers","subscription_url":"https://api.github.com/repos/synk/line-bot-sdk-java/subscription","commits_url":"https://api.github.com/repos/synk/line-bot-sdk-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/synk/line-bot-sdk-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/synk/line-bot-sdk-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/synk/line-bot-sdk-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/synk/line-bot-sdk-java/contents/{+path}","compare_url":"https://api.github.com/repos/synk/line-bot-sdk-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/synk/line-bot-sdk-java/merges","archive_url":"https://api.github.com/repos/synk/line-bot-sdk-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/synk/line-bot-sdk-java/downloads","issues_url":"https://api.github.com/repos/synk/line-bot-sdk-java/issues{/number}","pulls_url":"https://api.github.com/repos/synk/line-bot-sdk-java/pulls{/number}","milestones_url":"https://api.github.com/repos/synk/line-bot-sdk-java/milestones{/number}","notifications_url":"https://api.github.com/repos/synk/line-bot-sdk-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/synk/line-bot-sdk-java/labels{/name}","releases_url":"https://api.github.com/repos/synk/line-bot-sdk-java/releases{/id}","deployments_url":"https://api.github.com/repos/synk/line-bot-sdk-java/deployments","created_at":"2016-04-17T08:38:15Z","updated_at":"2016-04-17T08:38:16Z","pushed_at":"2016-05-28T14:42:48Z","git_url":"git://github.com/synk/line-bot-sdk-java.git","ssh_url":"git@github.com:synk/line-bot-sdk-java.git","clone_url":"https://github.com/synk/line-bot-sdk-java.git","svn_url":"https://github.com/synk/line-bot-sdk-java","homepage":"https://developers.line.me/","size":279,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"line:master","ref":"master","sha":"63c342f0c229d41676bad413cf3f9bf832ca73db","user":{"login":"line","id":13128444,"avatar_url":"https://avatars.githubusercontent.com/u/13128444?v=3","gravatar_id":"","url":"https://api.github.com/users/line","html_url":"https://github.com/line","followers_url":"https://api.github.com/users/line/followers","following_url":"https://api.github.com/users/line/following{/other_user}","gists_url":"https://api.github.com/users/line/gists{/gist_id}","starred_url":"https://api.github.com/users/line/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/line/subscriptions","organizations_url":"https://api.github.com/users/line/orgs","repos_url":"https://api.github.com/users/line/repos","events_url":"https://api.github.com/users/line/events{/privacy}","received_events_url":"https://api.github.com/users/line/received_events","type":"Organization","site_admin":false},"repo":{"id":56061422,"name":"line-bot-sdk-java","full_name":"line/line-bot-sdk-java","owner":{"login":"line","id":13128444,"avatar_url":"https://avatars.githubusercontent.com/u/13128444?v=3","gravatar_id":"","url":"https://api.github.com/users/line","html_url":"https://github.com/line","followers_url":"https://api.github.com/users/line/followers","following_url":"https://api.github.com/users/line/following{/other_user}","gists_url":"https://api.github.com/users/line/gists{/gist_id}","starred_url":"https://api.github.com/users/line/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/line/subscriptions","organizations_url":"https://api.github.com/users/line/orgs","repos_url":"https://api.github.com/users/line/repos","events_url":"https://api.github.com/users/line/events{/privacy}","received_events_url":"https://api.github.com/users/line/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/line/line-bot-sdk-java","description":"SDK of the LINE BOT API Trial for Java","fork":false,"url":"https://api.github.com/repos/line/line-bot-sdk-java","forks_url":"https://api.github.com/repos/line/line-bot-sdk-java/forks","keys_url":"https://api.github.com/repos/line/line-bot-sdk-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/line/line-bot-sdk-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/line/line-bot-sdk-java/teams","hooks_url":"https://api.github.com/repos/line/line-bot-sdk-java/hooks","issue_events_url":"https://api.github.com/repos/line/line-bot-sdk-java/issues/events{/number}","events_url":"https://api.github.com/repos/line/line-bot-sdk-java/events","assignees_url":"https://api.github.com/repos/line/line-bot-sdk-java/assignees{/user}","branches_url":"https://api.github.com/repos/line/line-bot-sdk-java/branches{/branch}","tags_url":"https://api.github.com/repos/line/line-bot-sdk-java/tags","blobs_url":"https://api.github.com/repos/line/line-bot-sdk-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/line/line-bot-sdk-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/line/line-bot-sdk-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/line/line-bot-sdk-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/line/line-bot-sdk-java/statuses/{sha}","languages_url":"https://api.github.com/repos/line/line-bot-sdk-java/languages","stargazers_url":"https://api.github.com/repos/line/line-bot-sdk-java/stargazers","contributors_url":"https://api.github.com/repos/line/line-bot-sdk-java/contributors","subscribers_url":"https://api.github.com/repos/line/line-bot-sdk-java/subscribers","subscription_url":"https://api.github.com/repos/line/line-bot-sdk-java/subscription","commits_url":"https://api.github.com/repos/line/line-bot-sdk-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/line/line-bot-sdk-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/line/line-bot-sdk-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/line/line-bot-sdk-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/line/line-bot-sdk-java/contents/{+path}","compare_url":"https://api.github.com/repos/line/line-bot-sdk-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/line/line-bot-sdk-java/merges","archive_url":"https://api.github.com/repos/line/line-bot-sdk-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/line/line-bot-sdk-java/downloads","issues_url":"https://api.github.com/repos/line/line-bot-sdk-java/issues{/number}","pulls_url":"https://api.github.com/repos/line/line-bot-sdk-java/pulls{/number}","milestones_url":"https://api.github.com/repos/line/line-bot-sdk-java/milestones{/number}","notifications_url":"https://api.github.com/repos/line/line-bot-sdk-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/line/line-bot-sdk-java/labels{/name}","releases_url":"https://api.github.com/repos/line/line-bot-sdk-java/releases{/id}","deployments_url":"https://api.github.com/repos/line/line-bot-sdk-java/deployments","created_at":"2016-04-12T12:32:40Z","updated_at":"2016-05-26T15:22:10Z","pushed_at":"2016-05-28T14:43:52Z","git_url":"git://github.com/line/line-bot-sdk-java.git","ssh_url":"git@github.com:line/line-bot-sdk-java.git","clone_url":"https://github.com/line/line-bot-sdk-java.git","svn_url":"https://github.com/line/line-bot-sdk-java","homepage":"https://developers.line.me/","size":265,"stargazers_count":53,"watchers_count":53,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":5,"forks":8,"open_issues":5,"watchers":53,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/line/line-bot-sdk-java/pulls/18"},"html":{"href":"https://github.com/line/line-bot-sdk-java/pull/18"},"issue":{"href":"https://api.github.com/repos/line/line-bot-sdk-java/issues/18"},"comments":{"href":"https://api.github.com/repos/line/line-bot-sdk-java/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/line/line-bot-sdk-java/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/line/line-bot-sdk-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/line/line-bot-sdk-java/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/line/line-bot-sdk-java/statuses/bc36f1833044f1cf9229d9d508cfc48901e3bebc"}}}}
{"actor":{"display_login":"synk"}}