{"action":"opened","issue":{"url":"https://api.github.com/repos/mudhairless/openpgp/issues/2","labels_url":"https://api.github.com/repos/mudhairless/openpgp/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/mudhairless/openpgp/issues/2/comments","events_url":"https://api.github.com/repos/mudhairless/openpgp/issues/2/events","html_url":"https://github.com/mudhairless/openpgp/issues/2","id":71675322,"number":2,"title":"Issue with key fields with private keys","user":{"login":"pgogy","id":541425,"avatar_url":"https://avatars.githubusercontent.com/u/541425?v=3","gravatar_id":"","url":"https://api.github.com/users/pgogy","html_url":"https://github.com/pgogy","followers_url":"https://api.github.com/users/pgogy/followers","following_url":"https://api.github.com/users/pgogy/following{/other_user}","gists_url":"https://api.github.com/users/pgogy/gists{/gist_id}","starred_url":"https://api.github.com/users/pgogy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pgogy/subscriptions","organizations_url":"https://api.github.com/users/pgogy/orgs","repos_url":"https://api.github.com/users/pgogy/repos","events_url":"https://api.github.com/users/pgogy/events{/privacy}","received_events_url":"https://api.github.com/users/pgogy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-28T19:09:37Z","updated_at":"2015-04-28T19:09:37Z","closed_at":null,"body":"Hello\r\nI am trying to use this library to sign a document and then generate a signature.\r\nI am basing this on the example (https://github.com/singpolyma/openpgp-php/blob/master/examples/sign.php) which may be wrong, but I've nothing else to go on.\r\n\r\nSo I load the key in from the file\r\n\r\n$wkey = \\OpenPGP\\Message::parse(file_get_contents($this->getKeyPath()));\r\n\r\nit detects the key as a secret key, but only creates the key fields of N and E, as the array seems to use the publickeypacket key fields and not the secretkeypacket key fields\r\n\r\n$RSA = new \\OpenPGP\\Crypt\\RSA($wkey[0]);\r\n$m = $RSA->sign($hashedDocument);\r\n\r\nHence M fails as D does not exist?\r\n\r\nThoughts? Feedback?\r\n\r\nAny help appreciated"}}