{"action":"created","comment":{"url":"https://api.github.com/repos/pac4j/pac4j/pulls/comments/31901771","id":31901771,"diff_hunk":"@@ -0,0 +1,148 @@\n+/*\n+  Copyright 2012 -2014 Michael Remond\n+\n+   Licensed under the Apache License, Version 2.0 (the \"License\");\n+   you may not use this file except in compliance with the License.\n+   You may obtain a copy of the License at\n+\n+       http://www.apache.org/licenses/LICENSE-2.0\n+\n+   Unless required by applicable law or agreed to in writing, software\n+   distributed under the License is distributed on an \"AS IS\" BASIS,\n+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+   See the License for the specific language governing permissions and\n+   limitations under the License.\n+ */\n+\n+package org.pac4j.saml.crypto;\n+\n+import java.io.IOException;\n+import java.io.InputStream;\n+import java.security.KeyStore;\n+import java.security.KeyStoreException;\n+import java.util.Enumeration;\n+import java.util.HashMap;\n+import java.util.Map;\n+\n+import net.shibboleth.utilities.java.support.resolver.CriteriaSet;\n+import net.shibboleth.utilities.java.support.resolver.ResolverException;\n+import org.opensaml.core.criterion.EntityIdCriterion;\n+\n+import org.opensaml.security.credential.Credential;\n+import org.opensaml.security.credential.CredentialResolver;\n+import org.opensaml.security.credential.impl.KeyStoreCredentialResolver;\n+import org.opensaml.security.x509.X509Credential;\n+import org.opensaml.xmlsec.config.DefaultSecurityConfigurationBootstrap;\n+import org.opensaml.xmlsec.keyinfo.KeyInfoCredentialResolver;\n+import org.opensaml.xmlsec.keyinfo.KeyInfoGenerator;\n+import org.opensaml.xmlsec.keyinfo.NamedKeyInfoGeneratorManager;\n+import org.opensaml.xmlsec.keyinfo.impl.BasicKeyInfoGeneratorFactory;\n+import org.opensaml.xmlsec.keyinfo.impl.StaticKeyInfoCredentialResolver;\n+import org.opensaml.xmlsec.signature.KeyInfo;\n+import org.pac4j.core.util.CommonHelper;\n+import org.pac4j.saml.exceptions.SAMLException;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+/**\n+ * Class responsible for loading a private key from a JKS keystore and returning the corresponding {@link Credential}\n+ * opensaml object.\n+ * \n+ * @author Michael Remond","path":"pac4j-saml/src/main/java/org/pac4j/saml/crypto/KeyStoreCredentialProvider.java","position":51,"original_position":51,"commit_id":"4b30d4d732f383590a8b5181efc77df551d3f677","original_commit_id":"4b30d4d732f383590a8b5181efc77df551d3f677","user":{"login":"leleuj","id":1038508,"avatar_url":"https://avatars.githubusercontent.com/u/1038508?v=3","gravatar_id":"","url":"https://api.github.com/users/leleuj","html_url":"https://github.com/leleuj","followers_url":"https://api.github.com/users/leleuj/followers","following_url":"https://api.github.com/users/leleuj/following{/other_user}","gists_url":"https://api.github.com/users/leleuj/gists{/gist_id}","starred_url":"https://api.github.com/users/leleuj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leleuj/subscriptions","organizations_url":"https://api.github.com/users/leleuj/orgs","repos_url":"https://api.github.com/users/leleuj/repos","events_url":"https://api.github.com/users/leleuj/events{/privacy}","received_events_url":"https://api.github.com/users/leleuj/received_events","type":"User","site_admin":false},"body":"Same comment.","created_at":"2015-06-08T10:24:25Z","updated_at":"2015-06-08T10:24:25Z","html_url":"https://github.com/pac4j/pac4j/pull/171#discussion_r31901771","pull_request_url":"https://api.github.com/repos/pac4j/pac4j/pulls/171","_links":{"self":{"href":"https://api.github.com/repos/pac4j/pac4j/pulls/comments/31901771"},"html":{"href":"https://github.com/pac4j/pac4j/pull/171#discussion_r31901771"},"pull_request":{"href":"https://api.github.com/repos/pac4j/pac4j/pulls/171"}}},"pull_request":{"url":"https://api.github.com/repos/pac4j/pac4j/pulls/171","id":37111128,"html_url":"https://github.com/pac4j/pac4j/pull/171","diff_url":"https://github.com/pac4j/pac4j/pull/171.diff","patch_url":"https://github.com/pac4j/pac4j/pull/171.patch","issue_url":"https://api.github.com/repos/pac4j/pac4j/issues/171","number":171,"state":"open","locked":false,"title":"OpenSAML 3.x for master","user":{"login":"mmoayyed","id":1205228,"avatar_url":"https://avatars.githubusercontent.com/u/1205228?v=3","gravatar_id":"","url":"https://api.github.com/users/mmoayyed","html_url":"https://github.com/mmoayyed","followers_url":"https://api.github.com/users/mmoayyed/followers","following_url":"https://api.github.com/users/mmoayyed/following{/other_user}","gists_url":"https://api.github.com/users/mmoayyed/gists{/gist_id}","starred_url":"https://api.github.com/users/mmoayyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmoayyed/subscriptions","organizations_url":"https://api.github.com/users/mmoayyed/orgs","repos_url":"https://api.github.com/users/mmoayyed/repos","events_url":"https://api.github.com/users/mmoayyed/events{/privacy}","received_events_url":"https://api.github.com/users/mmoayyed/received_events","type":"User","site_admin":false},"body":"Moving #164 and other subsequent commits on 1.7 over to master. ","created_at":"2015-06-07T18:40:44Z","updated_at":"2015-06-08T10:24:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"de370d6c2188188a2978d708ff9a39d2fbb9d231","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pac4j/pac4j/pulls/171/commits","review_comments_url":"https://api.github.com/repos/pac4j/pac4j/pulls/171/comments","review_comment_url":"https://api.github.com/repos/pac4j/pac4j/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pac4j/pac4j/issues/171/comments","statuses_url":"https://api.github.com/repos/pac4j/pac4j/statuses/4b30d4d732f383590a8b5181efc77df551d3f677","head":{"label":"mmoayyed:opensaml-master","ref":"opensaml-master","sha":"4b30d4d732f383590a8b5181efc77df551d3f677","user":{"login":"mmoayyed","id":1205228,"avatar_url":"https://avatars.githubusercontent.com/u/1205228?v=3","gravatar_id":"","url":"https://api.github.com/users/mmoayyed","html_url":"https://github.com/mmoayyed","followers_url":"https://api.github.com/users/mmoayyed/followers","following_url":"https://api.github.com/users/mmoayyed/following{/other_user}","gists_url":"https://api.github.com/users/mmoayyed/gists{/gist_id}","starred_url":"https://api.github.com/users/mmoayyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmoayyed/subscriptions","organizations_url":"https://api.github.com/users/mmoayyed/orgs","repos_url":"https://api.github.com/users/mmoayyed/repos","events_url":"https://api.github.com/users/mmoayyed/events{/privacy}","received_events_url":"https://api.github.com/users/mmoayyed/received_events","type":"User","site_admin":false},"repo":{"id":35601449,"name":"pac4j","full_name":"mmoayyed/pac4j","owner":{"login":"mmoayyed","id":1205228,"avatar_url":"https://avatars.githubusercontent.com/u/1205228?v=3","gravatar_id":"","url":"https://api.github.com/users/mmoayyed","html_url":"https://github.com/mmoayyed","followers_url":"https://api.github.com/users/mmoayyed/followers","following_url":"https://api.github.com/users/mmoayyed/following{/other_user}","gists_url":"https://api.github.com/users/mmoayyed/gists{/gist_id}","starred_url":"https://api.github.com/users/mmoayyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmoayyed/subscriptions","organizations_url":"https://api.github.com/users/mmoayyed/orgs","repos_url":"https://api.github.com/users/mmoayyed/repos","events_url":"https://api.github.com/users/mmoayyed/events{/privacy}","received_events_url":"https://api.github.com/users/mmoayyed/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mmoayyed/pac4j","description":"Multi protocols (OAuth, OpenID, CAS, SAML, HTTP, GAE) auhentication/authorization engine for Java","fork":true,"url":"https://api.github.com/repos/mmoayyed/pac4j","forks_url":"https://api.github.com/repos/mmoayyed/pac4j/forks","keys_url":"https://api.github.com/repos/mmoayyed/pac4j/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mmoayyed/pac4j/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mmoayyed/pac4j/teams","hooks_url":"https://api.github.com/repos/mmoayyed/pac4j/hooks","issue_events_url":"https://api.github.com/repos/mmoayyed/pac4j/issues/events{/number}","events_url":"https://api.github.com/repos/mmoayyed/pac4j/events","assignees_url":"https://api.github.com/repos/mmoayyed/pac4j/assignees{/user}","branches_url":"https://api.github.com/repos/mmoayyed/pac4j/branches{/branch}","tags_url":"https://api.github.com/repos/mmoayyed/pac4j/tags","blobs_url":"https://api.github.com/repos/mmoayyed/pac4j/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mmoayyed/pac4j/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mmoayyed/pac4j/git/refs{/sha}","trees_url":"https://api.github.com/repos/mmoayyed/pac4j/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mmoayyed/pac4j/statuses/{sha}","languages_url":"https://api.github.com/repos/mmoayyed/pac4j/languages","stargazers_url":"https://api.github.com/repos/mmoayyed/pac4j/stargazers","contributors_url":"https://api.github.com/repos/mmoayyed/pac4j/contributors","subscribers_url":"https://api.github.com/repos/mmoayyed/pac4j/subscribers","subscription_url":"https://api.github.com/repos/mmoayyed/pac4j/subscription","commits_url":"https://api.github.com/repos/mmoayyed/pac4j/commits{/sha}","git_commits_url":"https://api.github.com/repos/mmoayyed/pac4j/git/commits{/sha}","comments_url":"https://api.github.com/repos/mmoayyed/pac4j/comments{/number}","issue_comment_url":"https://api.github.com/repos/mmoayyed/pac4j/issues/comments{/number}","contents_url":"https://api.github.com/repos/mmoayyed/pac4j/contents/{+path}","compare_url":"https://api.github.com/repos/mmoayyed/pac4j/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mmoayyed/pac4j/merges","archive_url":"https://api.github.com/repos/mmoayyed/pac4j/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mmoayyed/pac4j/downloads","issues_url":"https://api.github.com/repos/mmoayyed/pac4j/issues{/number}","pulls_url":"https://api.github.com/repos/mmoayyed/pac4j/pulls{/number}","milestones_url":"https://api.github.com/repos/mmoayyed/pac4j/milestones{/number}","notifications_url":"https://api.github.com/repos/mmoayyed/pac4j/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mmoayyed/pac4j/labels{/name}","releases_url":"https://api.github.com/repos/mmoayyed/pac4j/releases{/id}","created_at":"2015-05-14T08:54:29Z","updated_at":"2015-05-14T08:54:30Z","pushed_at":"2015-06-07T18:59:13Z","git_url":"git://github.com/mmoayyed/pac4j.git","ssh_url":"git@github.com:mmoayyed/pac4j.git","clone_url":"https://github.com/mmoayyed/pac4j.git","svn_url":"https://github.com/mmoayyed/pac4j","homepage":"http://www.pac4j.org","size":12467,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pac4j:master","ref":"master","sha":"fd888ecd685f814e3cc99217c14998725e2f1386","user":{"login":"pac4j","id":7540865,"avatar_url":"https://avatars.githubusercontent.com/u/7540865?v=3","gravatar_id":"","url":"https://api.github.com/users/pac4j","html_url":"https://github.com/pac4j","followers_url":"https://api.github.com/users/pac4j/followers","following_url":"https://api.github.com/users/pac4j/following{/other_user}","gists_url":"https://api.github.com/users/pac4j/gists{/gist_id}","starred_url":"https://api.github.com/users/pac4j/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pac4j/subscriptions","organizations_url":"https://api.github.com/users/pac4j/orgs","repos_url":"https://api.github.com/users/pac4j/repos","events_url":"https://api.github.com/users/pac4j/events{/privacy}","received_events_url":"https://api.github.com/users/pac4j/received_events","type":"Organization","site_admin":false},"repo":{"id":3291848,"name":"pac4j","full_name":"pac4j/pac4j","owner":{"login":"pac4j","id":7540865,"avatar_url":"https://avatars.githubusercontent.com/u/7540865?v=3","gravatar_id":"","url":"https://api.github.com/users/pac4j","html_url":"https://github.com/pac4j","followers_url":"https://api.github.com/users/pac4j/followers","following_url":"https://api.github.com/users/pac4j/following{/other_user}","gists_url":"https://api.github.com/users/pac4j/gists{/gist_id}","starred_url":"https://api.github.com/users/pac4j/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pac4j/subscriptions","organizations_url":"https://api.github.com/users/pac4j/orgs","repos_url":"https://api.github.com/users/pac4j/repos","events_url":"https://api.github.com/users/pac4j/events{/privacy}","received_events_url":"https://api.github.com/users/pac4j/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pac4j/pac4j","description":"Multi protocols (OAuth, OpenID, CAS, SAML, HTTP, GAE) auhentication/authorization engine for Java","fork":false,"url":"https://api.github.com/repos/pac4j/pac4j","forks_url":"https://api.github.com/repos/pac4j/pac4j/forks","keys_url":"https://api.github.com/repos/pac4j/pac4j/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pac4j/pac4j/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pac4j/pac4j/teams","hooks_url":"https://api.github.com/repos/pac4j/pac4j/hooks","issue_events_url":"https://api.github.com/repos/pac4j/pac4j/issues/events{/number}","events_url":"https://api.github.com/repos/pac4j/pac4j/events","assignees_url":"https://api.github.com/repos/pac4j/pac4j/assignees{/user}","branches_url":"https://api.github.com/repos/pac4j/pac4j/branches{/branch}","tags_url":"https://api.github.com/repos/pac4j/pac4j/tags","blobs_url":"https://api.github.com/repos/pac4j/pac4j/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pac4j/pac4j/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pac4j/pac4j/git/refs{/sha}","trees_url":"https://api.github.com/repos/pac4j/pac4j/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pac4j/pac4j/statuses/{sha}","languages_url":"https://api.github.com/repos/pac4j/pac4j/languages","stargazers_url":"https://api.github.com/repos/pac4j/pac4j/stargazers","contributors_url":"https://api.github.com/repos/pac4j/pac4j/contributors","subscribers_url":"https://api.github.com/repos/pac4j/pac4j/subscribers","subscription_url":"https://api.github.com/repos/pac4j/pac4j/subscription","commits_url":"https://api.github.com/repos/pac4j/pac4j/commits{/sha}","git_commits_url":"https://api.github.com/repos/pac4j/pac4j/git/commits{/sha}","comments_url":"https://api.github.com/repos/pac4j/pac4j/comments{/number}","issue_comment_url":"https://api.github.com/repos/pac4j/pac4j/issues/comments{/number}","contents_url":"https://api.github.com/repos/pac4j/pac4j/contents/{+path}","compare_url":"https://api.github.com/repos/pac4j/pac4j/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pac4j/pac4j/merges","archive_url":"https://api.github.com/repos/pac4j/pac4j/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pac4j/pac4j/downloads","issues_url":"https://api.github.com/repos/pac4j/pac4j/issues{/number}","pulls_url":"https://api.github.com/repos/pac4j/pac4j/pulls{/number}","milestones_url":"https://api.github.com/repos/pac4j/pac4j/milestones{/number}","notifications_url":"https://api.github.com/repos/pac4j/pac4j/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pac4j/pac4j/labels{/name}","releases_url":"https://api.github.com/repos/pac4j/pac4j/releases{/id}","created_at":"2012-01-28T17:04:12Z","updated_at":"2015-06-08T05:39:11Z","pushed_at":"2015-06-07T18:59:13Z","git_url":"git://github.com/pac4j/pac4j.git","ssh_url":"git@github.com:pac4j/pac4j.git","clone_url":"https://github.com/pac4j/pac4j.git","svn_url":"https://github.com/pac4j/pac4j","homepage":"http://www.pac4j.org","size":15542,"stargazers_count":270,"watchers_count":270,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":92,"mirror_url":null,"open_issues_count":16,"forks":92,"open_issues":16,"watchers":270,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pac4j/pac4j/pulls/171"},"html":{"href":"https://github.com/pac4j/pac4j/pull/171"},"issue":{"href":"https://api.github.com/repos/pac4j/pac4j/issues/171"},"comments":{"href":"https://api.github.com/repos/pac4j/pac4j/issues/171/comments"},"review_comments":{"href":"https://api.github.com/repos/pac4j/pac4j/pulls/171/comments"},"review_comment":{"href":"https://api.github.com/repos/pac4j/pac4j/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pac4j/pac4j/pulls/171/commits"},"statuses":{"href":"https://api.github.com/repos/pac4j/pac4j/statuses/4b30d4d732f383590a8b5181efc77df551d3f677"}}}}