{"action":"created","issue":{"url":"https://api.github.com/repos/briansmith/ring/issues/511","repository_url":"https://api.github.com/repos/briansmith/ring","labels_url":"https://api.github.com/repos/briansmith/ring/issues/511/labels{/name}","comments_url":"https://api.github.com/repos/briansmith/ring/issues/511/comments","events_url":"https://api.github.com/repos/briansmith/ring/issues/511/events","html_url":"https://github.com/briansmith/ring/issues/511","id":221790573,"number":511,"title":"Expose rsa::padding::PKCS1?","user":{"login":"Keats","id":680355,"avatar_url":"https://avatars1.githubusercontent.com/u/680355?v=3","gravatar_id":"","url":"https://api.github.com/users/Keats","html_url":"https://github.com/Keats","followers_url":"https://api.github.com/users/Keats/followers","following_url":"https://api.github.com/users/Keats/following{/other_user}","gists_url":"https://api.github.com/users/Keats/gists{/gist_id}","starred_url":"https://api.github.com/users/Keats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Keats/subscriptions","organizations_url":"https://api.github.com/users/Keats/orgs","repos_url":"https://api.github.com/users/Keats/repos","events_url":"https://api.github.com/users/Keats/events{/privacy}","received_events_url":"https://api.github.com/users/Keats/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-04-14T11:11:47Z","updated_at":"2017-06-10T01:54:45Z","closed_at":"2017-06-10T01:54:45Z","body":"I would like to do the following:\r\n\r\n```rust\r\n...\r\nAlgorithm::RS256 => sign_rsa(&signature::RSA_PKCS1_SHA256, key, signing_input),\r\nAlgorithm::RS384 => sign_rsa(&signature::RSA_PKCS1_SHA384, key, signing_input),\r\nAlgorithm::RS512 => sign_rsa(&signature::RSA_PKCS1_SHA512, key, signing_input),\r\n...\r\n```\r\n\r\nwhere `sign_rsa` definition would be: `fn sign_rsa(alg: &rsa::padding::PKCS1, key: &[u8], signing_input: &str) -> Result<String> ` but the `PKCS1` is marked as private and not re-exported anywhere (afaik).\r\nI can do another `match` in my `sign_rsa` instead of doing it there to avoid writing the type so it's not a big deal but I was wondering whether it would be ok to expose it."},"comment":{"url":"https://api.github.com/repos/briansmith/ring/issues/comments/307534665","html_url":"https://github.com/briansmith/ring/issues/511#issuecomment-307534665","issue_url":"https://api.github.com/repos/briansmith/ring/issues/511","id":307534665,"user":{"login":"briansmith","id":16816,"avatar_url":"https://avatars3.githubusercontent.com/u/16816?v=3","gravatar_id":"","url":"https://api.github.com/users/briansmith","html_url":"https://github.com/briansmith","followers_url":"https://api.github.com/users/briansmith/followers","following_url":"https://api.github.com/users/briansmith/following{/other_user}","gists_url":"https://api.github.com/users/briansmith/gists{/gist_id}","starred_url":"https://api.github.com/users/briansmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briansmith/subscriptions","organizations_url":"https://api.github.com/users/briansmith/orgs","repos_url":"https://api.github.com/users/briansmith/repos","events_url":"https://api.github.com/users/briansmith/events{/privacy}","received_events_url":"https://api.github.com/users/briansmith/received_events","type":"User","site_admin":false},"created_at":"2017-06-10T01:54:45Z","updated_at":"2017-06-10T01:54:45Z","body":"@Keats Thanks for filing this. I'm leaning towards closing it because they way you want to do things is literally the way the *ring* API is trying to discourage RSA from being used. Your API is designed to be congruent with the JOSE specifications, but that approach is totally different than *ring*'s approach to API design, so we're bound to have some ugliness in the adaptation of one approach to the other.\r\n\r\nIn particular, although we don't (can't, and don't want to) prevent the same RSA key from being used for multiple algorithms (padding schemes and/or digest algorithms), we want to encourage people to use a key with only one padding scheme and only one digest algorithm, and also to know what padding scheme and what digest algorithm the key is intended to be used with at the time the key is loaded, instead of at the time the key is used for the actual signing.\r\n\r\nSo, even though your request isn't unreasonable, I'm going to close this because it's counter to the project's goals. Thanks for filing the issue, though!"}}
{"actor":{"display_login":"briansmith"}}