{"action":"created","comment":{"url":"https://api.github.com/repos/jetstack/cert-manager/pulls/comments/197785516","pull_request_review_id":130803404,"id":197785516,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5Nzc4NTUxNg==","diff_hunk":"@@ -1,18 +1,70 @@\n package pki\n \n import (\n+\t\"crypto\"\n+\t\"crypto/ecdsa\"\n+\t\"crypto/elliptic\"\n \t\"crypto/rand\"\n \t\"crypto/rsa\"\n \t\"crypto/x509\"\n \t\"encoding/pem\"\n+\t\"fmt\"\n )\n \n+var ellipticCurves = map[int]elliptic.Curve{\n+\t224: elliptic.P224(),\n+\t256: elliptic.P256(),\n+\t384: elliptic.P384(),\n+\t521: elliptic.P521(),\n+}\n+\n+func GeneratePrivateKey(algorithm string, keySize int) (crypto.PrivateKey, error) {\n+\tswitch algorithm {\n+\tcase \"rsa\":\n+\t\treturn GenerateRSAPrivateKey(keySize)\n+\tcase \"ecdsa\":\n+\t\treturn GenerateECPrivateKey(keySize)\n+\tdefault:\n+\t\treturn nil, fmt.Errorf(\"unsupported private key algorithm specified: %s\", algorithm)\n+\t}\n+}\n+\n func GenerateRSAPrivateKey(keySize int) (*rsa.PrivateKey, error) {\n \treturn rsa.GenerateKey(rand.Reader, keySize)\n }\n \n+func GenerateECPrivateKey(keySize int) (*ecdsa.PrivateKey, error) {\n+\tecCurve, ok := ellipticCurves[keySize]\n+\tif !ok {\n+\t\treturn nil, fmt.Errorf(\"unsupported ecdsa key size specified: %d\", keySize)\n+\t}\n+\n+\treturn ecdsa.GenerateKey(ecCurve, rand.Reader)\n+}\n+","path":"pkg/util/pki/generate.go","position":44,"original_position":44,"commit_id":"10ecc1b177de242a4d1a64c968ad8b28f867f8de","original_commit_id":"10ecc1b177de242a4d1a64c968ad8b28f867f8de","user":{"login":"munnerz","id":203583,"node_id":"MDQ6VXNlcjIwMzU4Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/203583?v=4","gravatar_id":"","url":"https://api.github.com/users/munnerz","html_url":"https://github.com/munnerz","followers_url":"https://api.github.com/users/munnerz/followers","following_url":"https://api.github.com/users/munnerz/following{/other_user}","gists_url":"https://api.github.com/users/munnerz/gists{/gist_id}","starred_url":"https://api.github.com/users/munnerz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/munnerz/subscriptions","organizations_url":"https://api.github.com/users/munnerz/orgs","repos_url":"https://api.github.com/users/munnerz/repos","events_url":"https://api.github.com/users/munnerz/events{/privacy}","received_events_url":"https://api.github.com/users/munnerz/received_events","type":"User","site_admin":false},"body":"The addition of EC keys is great, but can this be extracted out into a separate PR? It will take additional work to support this for all Issuer types.","created_at":"2018-06-25T12:58:14Z","updated_at":"2018-06-25T12:59:43Z","html_url":"https://github.com/jetstack/cert-manager/pull/665#discussion_r197785516","pull_request_url":"https://api.github.com/repos/jetstack/cert-manager/pulls/665","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/jetstack/cert-manager/pulls/comments/197785516"},"html":{"href":"https://github.com/jetstack/cert-manager/pull/665#discussion_r197785516"},"pull_request":{"href":"https://api.github.com/repos/jetstack/cert-manager/pulls/665"}}},"pull_request":{"url":"https://api.github.com/repos/jetstack/cert-manager/pulls/665","id":195585206,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1NTg1MjA2","html_url":"https://github.com/jetstack/cert-manager/pull/665","diff_url":"https://github.com/jetstack/cert-manager/pull/665.diff","patch_url":"https://github.com/jetstack/cert-manager/pull/665.patch","issue_url":"https://api.github.com/repos/jetstack/cert-manager/issues/665","number":665,"state":"open","locked":false,"title":"Add cfssl issuer","user":{"login":"badie","id":314155,"node_id":"MDQ6VXNlcjMxNDE1NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/314155?v=4","gravatar_id":"","url":"https://api.github.com/users/badie","html_url":"https://github.com/badie","followers_url":"https://api.github.com/users/badie/followers","following_url":"https://api.github.com/users/badie/following{/other_user}","gists_url":"https://api.github.com/users/badie/gists{/gist_id}","starred_url":"https://api.github.com/users/badie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/badie/subscriptions","organizations_url":"https://api.github.com/users/badie/orgs","repos_url":"https://api.github.com/users/badie/repos","events_url":"https://api.github.com/users/badie/events{/privacy}","received_events_url":"https://api.github.com/users/badie/received_events","type":"User","site_admin":false},"body":"\r\n**What this PR does / why we need it**:\r\n\r\nIt adds support for a [cfssl](https://github.com/cloudflare/cfssl) issuer to allow issuing certs from a [cfssl](https://github.com/cloudflare/cfssl) based CA.\r\n\r\n**Release note**:\r\n<!--  Steps to write your release note:\r\n1. Use the release-note-* labels to set the release note state (if you have access)\r\n2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`.\r\n-->\r\n```release-note\r\nAdd support for CFSSL issuers\r\n```","created_at":"2018-06-18T16:45:49Z","updated_at":"2018-06-25T12:59:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd8edafaa3b96d445f4b5e6ffee4daab7e449738","assignee":null,"assignees":[],"requested_reviewers":[{"login":"wallrj","id":978965,"node_id":"MDQ6VXNlcjk3ODk2NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/978965?v=4","gravatar_id":"","url":"https://api.github.com/users/wallrj","html_url":"https://github.com/wallrj","followers_url":"https://api.github.com/users/wallrj/followers","following_url":"https://api.github.com/users/wallrj/following{/other_user}","gists_url":"https://api.github.com/users/wallrj/gists{/gist_id}","starred_url":"https://api.github.com/users/wallrj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wallrj/subscriptions","organizations_url":"https://api.github.com/users/wallrj/orgs","repos_url":"https://api.github.com/users/wallrj/repos","events_url":"https://api.github.com/users/wallrj/events{/privacy}","received_events_url":"https://api.github.com/users/wallrj/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":727722560,"node_id":"MDU6TGFiZWw3Mjc3MjI1NjA=","url":"https://api.github.com/repos/jetstack/cert-manager/labels/release-note","name":"release-note","color":"c2e0c6","default":false},{"id":728658202,"node_id":"MDU6TGFiZWw3Mjg2NTgyMDI=","url":"https://api.github.com/repos/jetstack/cert-manager/labels/size/XXL","name":"size/XXL","color":"ee0000","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/jetstack/cert-manager/pulls/665/commits","review_comments_url":"https://api.github.com/repos/jetstack/cert-manager/pulls/665/comments","review_comment_url":"https://api.github.com/repos/jetstack/cert-manager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jetstack/cert-manager/issues/665/comments","statuses_url":"https://api.github.com/repos/jetstack/cert-manager/statuses/10ecc1b177de242a4d1a64c968ad8b28f867f8de","head":{"label":"autonomic-ai:master","ref":"master","sha":"10ecc1b177de242a4d1a64c968ad8b28f867f8de","user":{"login":"autonomic-ai","id":20615105,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNjE1MTA1","avatar_url":"https://avatars3.githubusercontent.com/u/20615105?v=4","gravatar_id":"","url":"https://api.github.com/users/autonomic-ai","html_url":"https://github.com/autonomic-ai","followers_url":"https://api.github.com/users/autonomic-ai/followers","following_url":"https://api.github.com/users/autonomic-ai/following{/other_user}","gists_url":"https://api.github.com/users/autonomic-ai/gists{/gist_id}","starred_url":"https://api.github.com/users/autonomic-ai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autonomic-ai/subscriptions","organizations_url":"https://api.github.com/users/autonomic-ai/orgs","repos_url":"https://api.github.com/users/autonomic-ai/repos","events_url":"https://api.github.com/users/autonomic-ai/events{/privacy}","received_events_url":"https://api.github.com/users/autonomic-ai/received_events","type":"Organization","site_admin":false},"repo":{"id":129833809,"node_id":"MDEwOlJlcG9zaXRvcnkxMjk4MzM4MDk=","name":"cert-manager","full_name":"autonomic-ai/cert-manager","owner":{"login":"autonomic-ai","id":20615105,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNjE1MTA1","avatar_url":"https://avatars3.githubusercontent.com/u/20615105?v=4","gravatar_id":"","url":"https://api.github.com/users/autonomic-ai","html_url":"https://github.com/autonomic-ai","followers_url":"https://api.github.com/users/autonomic-ai/followers","following_url":"https://api.github.com/users/autonomic-ai/following{/other_user}","gists_url":"https://api.github.com/users/autonomic-ai/gists{/gist_id}","starred_url":"https://api.github.com/users/autonomic-ai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/autonomic-ai/subscriptions","organizations_url":"https://api.github.com/users/autonomic-ai/orgs","repos_url":"https://api.github.com/users/autonomic-ai/repos","events_url":"https://api.github.com/users/autonomic-ai/events{/privacy}","received_events_url":"https://api.github.com/users/autonomic-ai/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/autonomic-ai/cert-manager","description":"Automatically provision and manage TLS certificates in Kubernetes","fork":true,"url":"https://api.github.com/repos/autonomic-ai/cert-manager","forks_url":"https://api.github.com/repos/autonomic-ai/cert-manager/forks","keys_url":"https://api.github.com/repos/autonomic-ai/cert-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/autonomic-ai/cert-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/autonomic-ai/cert-manager/teams","hooks_url":"https://api.github.com/repos/autonomic-ai/cert-manager/hooks","issue_events_url":"https://api.github.com/repos/autonomic-ai/cert-manager/issues/events{/number}","events_url":"https://api.github.com/repos/autonomic-ai/cert-manager/events","assignees_url":"https://api.github.com/repos/autonomic-ai/cert-manager/assignees{/user}","branches_url":"https://api.github.com/repos/autonomic-ai/cert-manager/branches{/branch}","tags_url":"https://api.github.com/repos/autonomic-ai/cert-manager/tags","blobs_url":"https://api.github.com/repos/autonomic-ai/cert-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/autonomic-ai/cert-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/autonomic-ai/cert-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/autonomic-ai/cert-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/autonomic-ai/cert-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/autonomic-ai/cert-manager/languages","stargazers_url":"https://api.github.com/repos/autonomic-ai/cert-manager/stargazers","contributors_url":"https://api.github.com/repos/autonomic-ai/cert-manager/contributors","subscribers_url":"https://api.github.com/repos/autonomic-ai/cert-manager/subscribers","subscription_url":"https://api.github.com/repos/autonomic-ai/cert-manager/subscription","commits_url":"https://api.github.com/repos/autonomic-ai/cert-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/autonomic-ai/cert-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/autonomic-ai/cert-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/autonomic-ai/cert-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/autonomic-ai/cert-manager/contents/{+path}","compare_url":"https://api.github.com/repos/autonomic-ai/cert-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/autonomic-ai/cert-manager/merges","archive_url":"https://api.github.com/repos/autonomic-ai/cert-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/autonomic-ai/cert-manager/downloads","issues_url":"https://api.github.com/repos/autonomic-ai/cert-manager/issues{/number}","pulls_url":"https://api.github.com/repos/autonomic-ai/cert-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/autonomic-ai/cert-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/autonomic-ai/cert-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/autonomic-ai/cert-manager/labels{/name}","releases_url":"https://api.github.com/repos/autonomic-ai/cert-manager/releases{/id}","deployments_url":"https://api.github.com/repos/autonomic-ai/cert-manager/deployments","created_at":"2018-04-17T02:25:20Z","updated_at":"2018-06-18T16:36:58Z","pushed_at":"2018-06-18T16:36:57Z","git_url":"git://github.com/autonomic-ai/cert-manager.git","ssh_url":"git@github.com:autonomic-ai/cert-manager.git","clone_url":"https://github.com/autonomic-ai/cert-manager.git","svn_url":"https://github.com/autonomic-ai/cert-manager","homepage":"","size":52714,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jetstack:master","ref":"master","sha":"28c52d6f02e7b19b89fd9f61cb2960be07f05d0b","user":{"login":"jetstack","id":13183983,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMTgzOTgz","avatar_url":"https://avatars1.githubusercontent.com/u/13183983?v=4","gravatar_id":"","url":"https://api.github.com/users/jetstack","html_url":"https://github.com/jetstack","followers_url":"https://api.github.com/users/jetstack/followers","following_url":"https://api.github.com/users/jetstack/following{/other_user}","gists_url":"https://api.github.com/users/jetstack/gists{/gist_id}","starred_url":"https://api.github.com/users/jetstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jetstack/subscriptions","organizations_url":"https://api.github.com/users/jetstack/orgs","repos_url":"https://api.github.com/users/jetstack/repos","events_url":"https://api.github.com/users/jetstack/events{/privacy}","received_events_url":"https://api.github.com/users/jetstack/received_events","type":"Organization","site_admin":false},"repo":{"id":92313258,"node_id":"MDEwOlJlcG9zaXRvcnk5MjMxMzI1OA==","name":"cert-manager","full_name":"jetstack/cert-manager","owner":{"login":"jetstack","id":13183983,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMTgzOTgz","avatar_url":"https://avatars1.githubusercontent.com/u/13183983?v=4","gravatar_id":"","url":"https://api.github.com/users/jetstack","html_url":"https://github.com/jetstack","followers_url":"https://api.github.com/users/jetstack/followers","following_url":"https://api.github.com/users/jetstack/following{/other_user}","gists_url":"https://api.github.com/users/jetstack/gists{/gist_id}","starred_url":"https://api.github.com/users/jetstack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jetstack/subscriptions","organizations_url":"https://api.github.com/users/jetstack/orgs","repos_url":"https://api.github.com/users/jetstack/repos","events_url":"https://api.github.com/users/jetstack/events{/privacy}","received_events_url":"https://api.github.com/users/jetstack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jetstack/cert-manager","description":"Automatically provision and manage TLS certificates in Kubernetes","fork":false,"url":"https://api.github.com/repos/jetstack/cert-manager","forks_url":"https://api.github.com/repos/jetstack/cert-manager/forks","keys_url":"https://api.github.com/repos/jetstack/cert-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jetstack/cert-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jetstack/cert-manager/teams","hooks_url":"https://api.github.com/repos/jetstack/cert-manager/hooks","issue_events_url":"https://api.github.com/repos/jetstack/cert-manager/issues/events{/number}","events_url":"https://api.github.com/repos/jetstack/cert-manager/events","assignees_url":"https://api.github.com/repos/jetstack/cert-manager/assignees{/user}","branches_url":"https://api.github.com/repos/jetstack/cert-manager/branches{/branch}","tags_url":"https://api.github.com/repos/jetstack/cert-manager/tags","blobs_url":"https://api.github.com/repos/jetstack/cert-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jetstack/cert-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jetstack/cert-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/jetstack/cert-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jetstack/cert-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/jetstack/cert-manager/languages","stargazers_url":"https://api.github.com/repos/jetstack/cert-manager/stargazers","contributors_url":"https://api.github.com/repos/jetstack/cert-manager/contributors","subscribers_url":"https://api.github.com/repos/jetstack/cert-manager/subscribers","subscription_url":"https://api.github.com/repos/jetstack/cert-manager/subscription","commits_url":"https://api.github.com/repos/jetstack/cert-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/jetstack/cert-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/jetstack/cert-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/jetstack/cert-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/jetstack/cert-manager/contents/{+path}","compare_url":"https://api.github.com/repos/jetstack/cert-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jetstack/cert-manager/merges","archive_url":"https://api.github.com/repos/jetstack/cert-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jetstack/cert-manager/downloads","issues_url":"https://api.github.com/repos/jetstack/cert-manager/issues{/number}","pulls_url":"https://api.github.com/repos/jetstack/cert-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/jetstack/cert-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/jetstack/cert-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jetstack/cert-manager/labels{/name}","releases_url":"https://api.github.com/repos/jetstack/cert-manager/releases{/id}","deployments_url":"https://api.github.com/repos/jetstack/cert-manager/deployments","created_at":"2017-05-24T16:25:59Z","updated_at":"2018-06-25T12:01:08Z","pushed_at":"2018-06-25T12:59:43Z","git_url":"git://github.com/jetstack/cert-manager.git","ssh_url":"git@github.com:jetstack/cert-manager.git","clone_url":"https://github.com/jetstack/cert-manager.git","svn_url":"https://github.com/jetstack/cert-manager","homepage":"","size":52733,"stargazers_count":1460,"watchers_count":1460,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":197,"mirror_url":null,"archived":false,"open_issues_count":140,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":197,"open_issues":140,"watchers":1460,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jetstack/cert-manager/pulls/665"},"html":{"href":"https://github.com/jetstack/cert-manager/pull/665"},"issue":{"href":"https://api.github.com/repos/jetstack/cert-manager/issues/665"},"comments":{"href":"https://api.github.com/repos/jetstack/cert-manager/issues/665/comments"},"review_comments":{"href":"https://api.github.com/repos/jetstack/cert-manager/pulls/665/comments"},"review_comment":{"href":"https://api.github.com/repos/jetstack/cert-manager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jetstack/cert-manager/pulls/665/commits"},"statuses":{"href":"https://api.github.com/repos/jetstack/cert-manager/statuses/10ecc1b177de242a4d1a64c968ad8b28f867f8de"}},"author_association":"NONE"}}
{"actor":{"display_login":"munnerz"}}