{"action":"created","issue":{"url":"https://api.github.com/repos/phpseclib/phpseclib/issues/673","labels_url":"https://api.github.com/repos/phpseclib/phpseclib/issues/673/labels{/name}","comments_url":"https://api.github.com/repos/phpseclib/phpseclib/issues/673/comments","events_url":"https://api.github.com/repos/phpseclib/phpseclib/issues/673/events","html_url":"https://github.com/phpseclib/phpseclib/pull/673","id":72950256,"number":673,"title":"RSA: Add support for calculating a public key's fingerprint","user":{"login":"Lukas-W","id":2879917,"avatar_url":"https://avatars.githubusercontent.com/u/2879917?v=3","gravatar_id":"","url":"https://api.github.com/users/Lukas-W","html_url":"https://github.com/Lukas-W","followers_url":"https://api.github.com/users/Lukas-W/followers","following_url":"https://api.github.com/users/Lukas-W/following{/other_user}","gists_url":"https://api.github.com/users/Lukas-W/gists{/gist_id}","starred_url":"https://api.github.com/users/Lukas-W/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lukas-W/subscriptions","organizations_url":"https://api.github.com/users/Lukas-W/orgs","repos_url":"https://api.github.com/users/Lukas-W/repos","events_url":"https://api.github.com/users/Lukas-W/events{/privacy}","received_events_url":"https://api.github.com/users/Lukas-W/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-04T07:55:31Z","updated_at":"2015-05-05T23:27:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/phpseclib/phpseclib/pulls/673","html_url":"https://github.com/phpseclib/phpseclib/pull/673","diff_url":"https://github.com/phpseclib/phpseclib/pull/673.diff","patch_url":"https://github.com/phpseclib/phpseclib/pull/673.patch"},"body":"This adds the function `getPublicKeyFingerprint()` to `Crypt_RSA`:\r\n```php\r\n$rsa = new Crypt_RSA();\r\n$rsa->loadPublicKey(file_get_contents('rsa.pub'));\r\necho $rsa->getPublicKeyFingerprint('md5');\r\necho $rsa->getPublicKeyFingerprint('sha256');\r\n```\r\nreturns something like\r\n```\r\nc1:b1:30:29:d7:b8:de:6c:97:77:10:d7:46:41:63:87\r\nN9sV2uSNZEe8TITODku0pRI27l+Zk0IY0TrRTw3ozwM\r\n```\r\nCalling this function outputs the same as running `ssh-keygen -lE sha256 f id.pub` or `ssh-keygen -lE md5 -f id.pub`.\r\n\r\nThe MD5 format is specified in https://tools.ietf.org/html/rfc4716#section-4."},"comment":{"url":"https://api.github.com/repos/phpseclib/phpseclib/issues/comments/99260329","html_url":"https://github.com/phpseclib/phpseclib/pull/673#issuecomment-99260329","issue_url":"https://api.github.com/repos/phpseclib/phpseclib/issues/673","id":99260329,"user":{"login":"terrafrost","id":214474,"avatar_url":"https://avatars.githubusercontent.com/u/214474?v=3","gravatar_id":"","url":"https://api.github.com/users/terrafrost","html_url":"https://github.com/terrafrost","followers_url":"https://api.github.com/users/terrafrost/followers","following_url":"https://api.github.com/users/terrafrost/following{/other_user}","gists_url":"https://api.github.com/users/terrafrost/gists{/gist_id}","starred_url":"https://api.github.com/users/terrafrost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/terrafrost/subscriptions","organizations_url":"https://api.github.com/users/terrafrost/orgs","repos_url":"https://api.github.com/users/terrafrost/repos","events_url":"https://api.github.com/users/terrafrost/events{/privacy}","received_events_url":"https://api.github.com/users/terrafrost/received_events","type":"User","site_admin":false},"created_at":"2015-05-05T23:27:47Z","updated_at":"2015-05-05T23:27:47Z","body":"Err...  I forgot the md5 lol. Should be this:\r\n\r\n```php\r\nsubstr(chunk_split(md5($RSAPublicKey), 2, ':'), 0, -1);\r\n```\r\n\r\nTime permitting I may do this myself later tonight."}}