{"action":"created","comment":{"url":"https://api.github.com/repos/open-keychain/open-keychain/pulls/comments/33144636","id":33144636,"diff_hunk":"@@ -590,4 +629,245 @@ ExportResult exportKeyRings(OperationLog log, long[] masterKeyIds, boolean expor\n \n     }\n \n-}\n+    @Override\n+    public OperationResult execute(ImportExportParcel input, CryptoInputParcel cryptoInput) {\n+        if (input instanceof ExportKeyringParcel) {\n+            ExportKeyringParcel exportInput = (ExportKeyringParcel) input;\n+            switch (exportInput.mExportType) {\n+                case UPLOAD_KEYSERVER: {\n+                    HkpKeyserver hkpKeyserver = new HkpKeyserver(exportInput.mKeyserver);\n+                    try {\n+                        CanonicalizedPublicKeyRing keyring\n+                                = mProviderHelper.getCanonicalizedPublicKeyRing(\n+                                exportInput.mCanonicalizedPublicKeyringUri);\n+                        uploadKeyRingToServer(hkpKeyserver, keyring);\n+                        // TODO: replace with proper log\n+                        return new ExportResult(ExportResult.RESULT_OK, new OperationLog());\n+                    } catch (Exception e) {\n+                        // TODO: Implement better exception handling, replace with log\n+                    }\n+                    break;\n+                }\n+                case EXPORT_FILE: {\n+                    return exportToFile(exportInput.mMasterKeyIds, exportInput.mExportSecret,\n+                            exportInput.mOutputFile);\n+                }\n+                case EXPORT_URI: {\n+                    return exportToUri(exportInput.mMasterKeyIds, exportInput.mExportSecret,\n+                            exportInput.mOutputUri);\n+                }\n+                default: {\n+                    return null;\n+                }\n+            }\n+        }\n+        else if (input instanceof ImportKeyringParcel) {\n+            ImportKeyringParcel importInput = (ImportKeyringParcel) input;\n+            return importKeys(importInput.mKeyList, importInput.mKeyserver);\n+        } else {\n+            throw new RuntimeException(\"Invalid input parcel at ImportExportOperation\");","path":"OpenKeychain/src/main/java/org/sufficientlysecure/keychain/operations/ImportExportOperation.java","position":200,"original_position":200,"commit_id":"c98df0b56970f7d43157eacada904b2fd56686a9","original_commit_id":"c98df0b56970f7d43157eacada904b2fd56686a9","user":{"login":"Valodim","id":27813,"avatar_url":"https://avatars.githubusercontent.com/u/27813?v=3","gravatar_id":"","url":"https://api.github.com/users/Valodim","html_url":"https://github.com/Valodim","followers_url":"https://api.github.com/users/Valodim/followers","following_url":"https://api.github.com/users/Valodim/following{/other_user}","gists_url":"https://api.github.com/users/Valodim/gists{/gist_id}","starred_url":"https://api.github.com/users/Valodim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Valodim/subscriptions","organizations_url":"https://api.github.com/users/Valodim/orgs","repos_url":"https://api.github.com/users/Valodim/repos","events_url":"https://api.github.com/users/Valodim/events{/privacy}","received_events_url":"https://api.github.com/users/Valodim/received_events","type":"User","site_admin":false},"body":"import and export should be two independent operations, to avoid control flow like this","created_at":"2015-06-24T13:03:51Z","updated_at":"2015-06-24T13:03:51Z","html_url":"https://github.com/open-keychain/open-keychain/pull/1362#discussion_r33144636","pull_request_url":"https://api.github.com/repos/open-keychain/open-keychain/pulls/1362","_links":{"self":{"href":"https://api.github.com/repos/open-keychain/open-keychain/pulls/comments/33144636"},"html":{"href":"https://github.com/open-keychain/open-keychain/pull/1362#discussion_r33144636"},"pull_request":{"href":"https://api.github.com/repos/open-keychain/open-keychain/pulls/1362"}}},"pull_request":{"url":"https://api.github.com/repos/open-keychain/open-keychain/pulls/1362","id":38402224,"html_url":"https://github.com/open-keychain/open-keychain/pull/1362","diff_url":"https://github.com/open-keychain/open-keychain/pull/1362.diff","patch_url":"https://github.com/open-keychain/open-keychain/pull/1362.patch","issue_url":"https://api.github.com/repos/open-keychain/open-keychain/issues/1362","number":1362,"state":"open","locked":false,"title":"Migrated all operations to KeychainNewService","user":{"login":"adithyaphilip","id":5712241,"avatar_url":"https://avatars.githubusercontent.com/u/5712241?v=3","gravatar_id":"","url":"https://api.github.com/users/adithyaphilip","html_url":"https://github.com/adithyaphilip","followers_url":"https://api.github.com/users/adithyaphilip/followers","following_url":"https://api.github.com/users/adithyaphilip/following{/other_user}","gists_url":"https://api.github.com/users/adithyaphilip/gists{/gist_id}","starred_url":"https://api.github.com/users/adithyaphilip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adithyaphilip/subscriptions","organizations_url":"https://api.github.com/users/adithyaphilip/orgs","repos_url":"https://api.github.com/users/adithyaphilip/repos","events_url":"https://api.github.com/users/adithyaphilip/events{/privacy}","received_events_url":"https://api.github.com/users/adithyaphilip/received_events","type":"User","site_admin":false},"body":"All operations have been migrated to KeychainNewService (now renamed to KeychainService).\r\n* Key import and export/upload tested - both from file and cloud.\r\n* Key Certification by fingerprint fixed and tested.\r\n* File encryption/decryption working.\r\n* Key editing tested and working.\r\n* Consolidation works great.\r\n* Key deletion tested and working.\r\n\r\nCouldn't test:\r\n* `PromoteKeyOperation` since it required a YubiKey.\r\n* `KeybaseVerificationOperation` because our Keybase search seems to be crashing as of now with https://github.com/open-keychain/open-keychain/issues/1361, for me anyway.","created_at":"2015-06-24T02:28:47Z","updated_at":"2015-06-24T13:03:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2c86fc0af384ac5f7f6785fa74cd73a499a91277","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/open-keychain/open-keychain/pulls/1362/commits","review_comments_url":"https://api.github.com/repos/open-keychain/open-keychain/pulls/1362/comments","review_comment_url":"https://api.github.com/repos/open-keychain/open-keychain/pulls/comments{/number}","comments_url":"https://api.github.com/repos/open-keychain/open-keychain/issues/1362/comments","statuses_url":"https://api.github.com/repos/open-keychain/open-keychain/statuses/c98df0b56970f7d43157eacada904b2fd56686a9","head":{"label":"open-keychain:operation-migration","ref":"operation-migration","sha":"c98df0b56970f7d43157eacada904b2fd56686a9","user":{"login":"open-keychain","id":6513445,"avatar_url":"https://avatars.githubusercontent.com/u/6513445?v=3","gravatar_id":"","url":"https://api.github.com/users/open-keychain","html_url":"https://github.com/open-keychain","followers_url":"https://api.github.com/users/open-keychain/followers","following_url":"https://api.github.com/users/open-keychain/following{/other_user}","gists_url":"https://api.github.com/users/open-keychain/gists{/gist_id}","starred_url":"https://api.github.com/users/open-keychain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-keychain/subscriptions","organizations_url":"https://api.github.com/users/open-keychain/orgs","repos_url":"https://api.github.com/users/open-keychain/repos","events_url":"https://api.github.com/users/open-keychain/events{/privacy}","received_events_url":"https://api.github.com/users/open-keychain/received_events","type":"Organization","site_admin":false},"repo":{"id":3669065,"name":"open-keychain","full_name":"open-keychain/open-keychain","owner":{"login":"open-keychain","id":6513445,"avatar_url":"https://avatars.githubusercontent.com/u/6513445?v=3","gravatar_id":"","url":"https://api.github.com/users/open-keychain","html_url":"https://github.com/open-keychain","followers_url":"https://api.github.com/users/open-keychain/followers","following_url":"https://api.github.com/users/open-keychain/following{/other_user}","gists_url":"https://api.github.com/users/open-keychain/gists{/gist_id}","starred_url":"https://api.github.com/users/open-keychain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-keychain/subscriptions","organizations_url":"https://api.github.com/users/open-keychain/orgs","repos_url":"https://api.github.com/users/open-keychain/repos","events_url":"https://api.github.com/users/open-keychain/events{/privacy}","received_events_url":"https://api.github.com/users/open-keychain/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-keychain/open-keychain","description":"OpenKeychain is an OpenPGP implementation for Android.","fork":false,"url":"https://api.github.com/repos/open-keychain/open-keychain","forks_url":"https://api.github.com/repos/open-keychain/open-keychain/forks","keys_url":"https://api.github.com/repos/open-keychain/open-keychain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-keychain/open-keychain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-keychain/open-keychain/teams","hooks_url":"https://api.github.com/repos/open-keychain/open-keychain/hooks","issue_events_url":"https://api.github.com/repos/open-keychain/open-keychain/issues/events{/number}","events_url":"https://api.github.com/repos/open-keychain/open-keychain/events","assignees_url":"https://api.github.com/repos/open-keychain/open-keychain/assignees{/user}","branches_url":"https://api.github.com/repos/open-keychain/open-keychain/branches{/branch}","tags_url":"https://api.github.com/repos/open-keychain/open-keychain/tags","blobs_url":"https://api.github.com/repos/open-keychain/open-keychain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-keychain/open-keychain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-keychain/open-keychain/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-keychain/open-keychain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-keychain/open-keychain/statuses/{sha}","languages_url":"https://api.github.com/repos/open-keychain/open-keychain/languages","stargazers_url":"https://api.github.com/repos/open-keychain/open-keychain/stargazers","contributors_url":"https://api.github.com/repos/open-keychain/open-keychain/contributors","subscribers_url":"https://api.github.com/repos/open-keychain/open-keychain/subscribers","subscription_url":"https://api.github.com/repos/open-keychain/open-keychain/subscription","commits_url":"https://api.github.com/repos/open-keychain/open-keychain/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-keychain/open-keychain/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-keychain/open-keychain/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-keychain/open-keychain/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-keychain/open-keychain/contents/{+path}","compare_url":"https://api.github.com/repos/open-keychain/open-keychain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-keychain/open-keychain/merges","archive_url":"https://api.github.com/repos/open-keychain/open-keychain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-keychain/open-keychain/downloads","issues_url":"https://api.github.com/repos/open-keychain/open-keychain/issues{/number}","pulls_url":"https://api.github.com/repos/open-keychain/open-keychain/pulls{/number}","milestones_url":"https://api.github.com/repos/open-keychain/open-keychain/milestones{/number}","notifications_url":"https://api.github.com/repos/open-keychain/open-keychain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-keychain/open-keychain/labels{/name}","releases_url":"https://api.github.com/repos/open-keychain/open-keychain/releases{/id}","created_at":"2012-03-09T09:10:42Z","updated_at":"2015-06-24T08:34:51Z","pushed_at":"2015-06-24T11:08:41Z","git_url":"git://github.com/open-keychain/open-keychain.git","ssh_url":"git@github.com:open-keychain/open-keychain.git","clone_url":"https://github.com/open-keychain/open-keychain.git","svn_url":"https://github.com/open-keychain/open-keychain","homepage":"http://www.openkeychain.org","size":83753,"stargazers_count":421,"watchers_count":421,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":201,"mirror_url":null,"open_issues_count":157,"forks":201,"open_issues":157,"watchers":421,"default_branch":"master"}},"base":{"label":"open-keychain:master","ref":"master","sha":"2b26f293b8cb03a0b605e3a95365160f5c034329","user":{"login":"open-keychain","id":6513445,"avatar_url":"https://avatars.githubusercontent.com/u/6513445?v=3","gravatar_id":"","url":"https://api.github.com/users/open-keychain","html_url":"https://github.com/open-keychain","followers_url":"https://api.github.com/users/open-keychain/followers","following_url":"https://api.github.com/users/open-keychain/following{/other_user}","gists_url":"https://api.github.com/users/open-keychain/gists{/gist_id}","starred_url":"https://api.github.com/users/open-keychain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-keychain/subscriptions","organizations_url":"https://api.github.com/users/open-keychain/orgs","repos_url":"https://api.github.com/users/open-keychain/repos","events_url":"https://api.github.com/users/open-keychain/events{/privacy}","received_events_url":"https://api.github.com/users/open-keychain/received_events","type":"Organization","site_admin":false},"repo":{"id":3669065,"name":"open-keychain","full_name":"open-keychain/open-keychain","owner":{"login":"open-keychain","id":6513445,"avatar_url":"https://avatars.githubusercontent.com/u/6513445?v=3","gravatar_id":"","url":"https://api.github.com/users/open-keychain","html_url":"https://github.com/open-keychain","followers_url":"https://api.github.com/users/open-keychain/followers","following_url":"https://api.github.com/users/open-keychain/following{/other_user}","gists_url":"https://api.github.com/users/open-keychain/gists{/gist_id}","starred_url":"https://api.github.com/users/open-keychain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/open-keychain/subscriptions","organizations_url":"https://api.github.com/users/open-keychain/orgs","repos_url":"https://api.github.com/users/open-keychain/repos","events_url":"https://api.github.com/users/open-keychain/events{/privacy}","received_events_url":"https://api.github.com/users/open-keychain/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/open-keychain/open-keychain","description":"OpenKeychain is an OpenPGP implementation for Android.","fork":false,"url":"https://api.github.com/repos/open-keychain/open-keychain","forks_url":"https://api.github.com/repos/open-keychain/open-keychain/forks","keys_url":"https://api.github.com/repos/open-keychain/open-keychain/keys{/key_id}","collaborators_url":"https://api.github.com/repos/open-keychain/open-keychain/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/open-keychain/open-keychain/teams","hooks_url":"https://api.github.com/repos/open-keychain/open-keychain/hooks","issue_events_url":"https://api.github.com/repos/open-keychain/open-keychain/issues/events{/number}","events_url":"https://api.github.com/repos/open-keychain/open-keychain/events","assignees_url":"https://api.github.com/repos/open-keychain/open-keychain/assignees{/user}","branches_url":"https://api.github.com/repos/open-keychain/open-keychain/branches{/branch}","tags_url":"https://api.github.com/repos/open-keychain/open-keychain/tags","blobs_url":"https://api.github.com/repos/open-keychain/open-keychain/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/open-keychain/open-keychain/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/open-keychain/open-keychain/git/refs{/sha}","trees_url":"https://api.github.com/repos/open-keychain/open-keychain/git/trees{/sha}","statuses_url":"https://api.github.com/repos/open-keychain/open-keychain/statuses/{sha}","languages_url":"https://api.github.com/repos/open-keychain/open-keychain/languages","stargazers_url":"https://api.github.com/repos/open-keychain/open-keychain/stargazers","contributors_url":"https://api.github.com/repos/open-keychain/open-keychain/contributors","subscribers_url":"https://api.github.com/repos/open-keychain/open-keychain/subscribers","subscription_url":"https://api.github.com/repos/open-keychain/open-keychain/subscription","commits_url":"https://api.github.com/repos/open-keychain/open-keychain/commits{/sha}","git_commits_url":"https://api.github.com/repos/open-keychain/open-keychain/git/commits{/sha}","comments_url":"https://api.github.com/repos/open-keychain/open-keychain/comments{/number}","issue_comment_url":"https://api.github.com/repos/open-keychain/open-keychain/issues/comments{/number}","contents_url":"https://api.github.com/repos/open-keychain/open-keychain/contents/{+path}","compare_url":"https://api.github.com/repos/open-keychain/open-keychain/compare/{base}...{head}","merges_url":"https://api.github.com/repos/open-keychain/open-keychain/merges","archive_url":"https://api.github.com/repos/open-keychain/open-keychain/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/open-keychain/open-keychain/downloads","issues_url":"https://api.github.com/repos/open-keychain/open-keychain/issues{/number}","pulls_url":"https://api.github.com/repos/open-keychain/open-keychain/pulls{/number}","milestones_url":"https://api.github.com/repos/open-keychain/open-keychain/milestones{/number}","notifications_url":"https://api.github.com/repos/open-keychain/open-keychain/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/open-keychain/open-keychain/labels{/name}","releases_url":"https://api.github.com/repos/open-keychain/open-keychain/releases{/id}","created_at":"2012-03-09T09:10:42Z","updated_at":"2015-06-24T08:34:51Z","pushed_at":"2015-06-24T11:08:41Z","git_url":"git://github.com/open-keychain/open-keychain.git","ssh_url":"git@github.com:open-keychain/open-keychain.git","clone_url":"https://github.com/open-keychain/open-keychain.git","svn_url":"https://github.com/open-keychain/open-keychain","homepage":"http://www.openkeychain.org","size":83753,"stargazers_count":421,"watchers_count":421,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":201,"mirror_url":null,"open_issues_count":157,"forks":201,"open_issues":157,"watchers":421,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/open-keychain/open-keychain/pulls/1362"},"html":{"href":"https://github.com/open-keychain/open-keychain/pull/1362"},"issue":{"href":"https://api.github.com/repos/open-keychain/open-keychain/issues/1362"},"comments":{"href":"https://api.github.com/repos/open-keychain/open-keychain/issues/1362/comments"},"review_comments":{"href":"https://api.github.com/repos/open-keychain/open-keychain/pulls/1362/comments"},"review_comment":{"href":"https://api.github.com/repos/open-keychain/open-keychain/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/open-keychain/open-keychain/pulls/1362/commits"},"statuses":{"href":"https://api.github.com/repos/open-keychain/open-keychain/statuses/c98df0b56970f7d43157eacada904b2fd56686a9"}}}}