{"action":"created","issue":{"url":"https://api.github.com/repos/ethereum/go-ethereum/issues/2945","repository_url":"https://api.github.com/repos/ethereum/go-ethereum","labels_url":"https://api.github.com/repos/ethereum/go-ethereum/issues/2945/labels{/name}","comments_url":"https://api.github.com/repos/ethereum/go-ethereum/issues/2945/comments","events_url":"https://api.github.com/repos/ethereum/go-ethereum/issues/2945/events","html_url":"https://github.com/ethereum/go-ethereum/issues/2945","id":172991780,"number":2945,"title":"how convert PrivateKey to string ","user":{"login":"362228416","id":5248797,"avatar_url":"https://avatars.githubusercontent.com/u/5248797?v=3","gravatar_id":"","url":"https://api.github.com/users/362228416","html_url":"https://github.com/362228416","followers_url":"https://api.github.com/users/362228416/followers","following_url":"https://api.github.com/users/362228416/following{/other_user}","gists_url":"https://api.github.com/users/362228416/gists{/gist_id}","starred_url":"https://api.github.com/users/362228416/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/362228416/subscriptions","organizations_url":"https://api.github.com/users/362228416/orgs","repos_url":"https://api.github.com/users/362228416/repos","events_url":"https://api.github.com/users/362228416/events{/privacy}","received_events_url":"https://api.github.com/users/362228416/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-24T15:57:30Z","updated_at":"2016-08-25T10:23:01Z","closed_at":null,"body":"#### System information\r\n\r\nGeth version: `geth version`\r\nOS & Version: Windows/Linux/OSX\r\nCommit hash : (if `develop`)\r\n\r\n#### Expected behaviour\r\n\r\nI has a keystore file and its password, I want export it's privateKey, to backup and sendTransaction use ethereumjs-tx, but I don't know how to, \r\n```\r\npackage main\r\n\r\nimport (\r\n\t\"fmt\"\r\n\t\"github.com/ethereum/go-ethereum/accounts\"\r\n\t\"io/ioutil\"\r\n)\r\n\r\n\r\nfunc main() {\r\n\r\n\r\n\tfile := \"/Users/john/Library/Ethereum/testnet/keystore/UTC--2016-08-15T15-55-53.113310954Z--5f56bba9ee673d0c7bccf4be1a78b9db3a51114d\"\r\n\tpassword := \"123123\"\r\n\r\n\tkeyjson, err := ioutil.ReadFile(file)\r\n\r\n\tkey, err := accounts.DecryptKey(keyjson, password)\r\n    if err != nil {\r\n        fmt.Println(\"json key failed to decrypt: %v\", err)\r\n    }\r\n\r\n\tfmt.Println(key.PrivateKey)\t\r\n\r\n\r\n}\r\n```\r\noutput:\r\n```\r\n&{{0xc820010fc0 81583740361756840836121323789587338945461422073887594179255540915112063238155 21797972115651064114086597227887646793489837261366149234119939453580822821536} 94774382518166634573449883147278946376407637768700369139633360135918296102392}\r\n```\r\n\r\n#### Actual behaviour\r\n\r\nI want get the privateKey: like this \r\n```\r\nvar privateKey = 'dc099880ee7d2b16e956b33cbd8b71d7cf5fdb85a3d14aea434572936a0afbd7';\r\n//  some javascript use ethereumjs-tx\r\n\r\n```\r\n#### Steps to reproduce the behaviour\r\n\r\n\r\n#### Backtrace\r\n\r\n````\r\n[backtrace]\r\n````\r\n"},"comment":{"url":"https://api.github.com/repos/ethereum/go-ethereum/issues/comments/242342205","html_url":"https://github.com/ethereum/go-ethereum/issues/2945#issuecomment-242342205","issue_url":"https://api.github.com/repos/ethereum/go-ethereum/issues/2945","id":242342205,"user":{"login":"Hellsegga","id":20972132,"avatar_url":"https://avatars.githubusercontent.com/u/20972132?v=3","gravatar_id":"","url":"https://api.github.com/users/Hellsegga","html_url":"https://github.com/Hellsegga","followers_url":"https://api.github.com/users/Hellsegga/followers","following_url":"https://api.github.com/users/Hellsegga/following{/other_user}","gists_url":"https://api.github.com/users/Hellsegga/gists{/gist_id}","starred_url":"https://api.github.com/users/Hellsegga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hellsegga/subscriptions","organizations_url":"https://api.github.com/users/Hellsegga/orgs","repos_url":"https://api.github.com/users/Hellsegga/repos","events_url":"https://api.github.com/users/Hellsegga/events{/privacy}","received_events_url":"https://api.github.com/users/Hellsegga/received_events","type":"User","site_admin":false},"created_at":"2016-08-25T10:23:01Z","updated_at":"2016-08-25T10:23:01Z","body":"Hi, this is not per se an issue on the go-ethereum client but I'll try to help you: the PrivateKey object that you print out is of type https://golang.org/pkg/crypto/ecdsa/#PrivateKey so the last part of what you print out (94774382518166634573449883147278946376407637768700369139633360135918296102392) is the private key as integer, which you can convert to hex and you should get what you're looking for."}}
{"actor":{"display_login":"Hellsegga"}}