{"action":"created","comment":{"url":"https://api.github.com/repos/luisgoncalves/xades4j/pulls/comments/184894378","pull_request_review_id":116177796,"id":184894378,"diff_hunk":"@@ -0,0 +1,130 @@\n+package xades4j.production;\n+\n+import org.bouncycastle.asn1.ASN1Encodable;\n+import org.bouncycastle.asn1.DERBMPString;\n+import org.bouncycastle.asn1.DERUTF8String;\n+\n+\n+import org.bouncycastle.asn1.x500.AttributeTypeAndValue;\n+import org.bouncycastle.asn1.x500.X500Name;\n+import org.bouncycastle.asn1.x500.X500NameBuilder;\n+\n+import org.bouncycastle.asn1.x500.style.RFC4519Style;\n+\n+import org.bouncycastle.asn1.x509.BasicConstraints;\n+import org.bouncycastle.asn1.x509.Extension;\n+import org.bouncycastle.asn1.x509.KeyUsage;\n+import org.bouncycastle.cert.X509v3CertificateBuilder;\n+import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;\n+import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder;\n+import org.bouncycastle.jce.provider.BouncyCastleProvider;\n+import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;\n+import org.junit.Test;\n+import org.w3c.dom.Document;\n+import org.w3c.dom.Element;\n+import xades4j.algorithms.EnvelopedSignatureTransform;\n+import xades4j.properties.DataObjectDesc;\n+\n+import xades4j.providers.impl.DirectKeyingDataProvider;\n+\n+\n+import java.io.ByteArrayInputStream;\n+import java.io.ByteArrayOutputStream;\n+import java.math.BigInteger;\n+\n+import java.security.KeyPair;\n+import java.security.KeyPairGenerator;\n+import java.security.SecureRandom;\n+import java.security.Security;\n+import java.security.cert.X509Certificate;\n+import java.util.Date;\n+import java.util.Random;\n+import java.util.ResourceBundle;\n+\n+\n+/**\n+ * @author Artem R. Romanenko\n+ * @version 02/04/2018\n+ */\n+public class SignerSpecificTest extends SignerBESTest {\n+    private final static ResourceBundle BUNGLE = ResourceBundle.getBundle(SignerSpecificTest.class.getName());\n+\n+    @Test\n+    public void signWithNationalCertificate() throws Exception {\n+        Security.addProvider(new BouncyCastleProvider());\n+        KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\", BouncyCastleProvider.PROVIDER_NAME);\n+        keyGen.initialize(1024, new SecureRandom());\n+        Date validityBeginDate = new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000);\n+        long add = (1L * 365L * 24L * 60L * 60L * 1000L);  //1 year\n+        Date validityEndDate = new Date(System.currentTimeMillis() + add);\n+\n+\n+        String nationalOrganizationName = \"National organization name '\" + BUNGLE.getString(\"common.name\") + \"'\";\n+        DERBMPString derbmpString = new DERBMPString(nationalOrganizationName);\n+        DERUTF8String derutf8String = new DERUTF8String(nationalOrganizationName);\n+        ASN1Encodable[] strings = new ASN1Encodable[]{derbmpString, derutf8String};","path":"src/test/java/xades4j/production/SignerSpecificTest.java","position":65,"original_position":65,"commit_id":"71f5f62830fbd68445b94ade035d386452a03c86","original_commit_id":"71f5f62830fbd68445b94ade035d386452a03c86","user":{"login":"luisgoncalves","id":3973253,"avatar_url":"https://avatars0.githubusercontent.com/u/3973253?v=4","gravatar_id":"","url":"https://api.github.com/users/luisgoncalves","html_url":"https://github.com/luisgoncalves","followers_url":"https://api.github.com/users/luisgoncalves/followers","following_url":"https://api.github.com/users/luisgoncalves/following{/other_user}","gists_url":"https://api.github.com/users/luisgoncalves/gists{/gist_id}","starred_url":"https://api.github.com/users/luisgoncalves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luisgoncalves/subscriptions","organizations_url":"https://api.github.com/users/luisgoncalves/orgs","repos_url":"https://api.github.com/users/luisgoncalves/repos","events_url":"https://api.github.com/users/luisgoncalves/events{/privacy}","received_events_url":"https://api.github.com/users/luisgoncalves/received_events","type":"User","site_admin":false},"body":"Could each item of this list be a parameter of the test, using JUnit's [parameterized tests](https://github.com/junit-team/junit4/wiki/parameterized-tests)? Makes it easier to add new test subjects.","created_at":"2018-04-29T20:45:13Z","updated_at":"2018-04-29T20:50:31Z","html_url":"https://github.com/luisgoncalves/xades4j/pull/152#discussion_r184894378","pull_request_url":"https://api.github.com/repos/luisgoncalves/xades4j/pulls/152","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/luisgoncalves/xades4j/pulls/comments/184894378"},"html":{"href":"https://github.com/luisgoncalves/xades4j/pull/152#discussion_r184894378"},"pull_request":{"href":"https://api.github.com/repos/luisgoncalves/xades4j/pulls/152"}}},"pull_request":{"url":"https://api.github.com/repos/luisgoncalves/xades4j/pulls/152","id":178900591,"html_url":"https://github.com/luisgoncalves/xades4j/pull/152","diff_url":"https://github.com/luisgoncalves/xades4j/pull/152.diff","patch_url":"https://github.com/luisgoncalves/xades4j/pull/152.patch","issue_url":"https://api.github.com/repos/luisgoncalves/xades4j/issues/152","number":152,"state":"open","locked":false,"title":"Added national certificate support if this contains ASN1 BMPString","user":{"login":"nekkiy","id":2129439,"avatar_url":"https://avatars1.githubusercontent.com/u/2129439?v=4","gravatar_id":"","url":"https://api.github.com/users/nekkiy","html_url":"https://github.com/nekkiy","followers_url":"https://api.github.com/users/nekkiy/followers","following_url":"https://api.github.com/users/nekkiy/following{/other_user}","gists_url":"https://api.github.com/users/nekkiy/gists{/gist_id}","starred_url":"https://api.github.com/users/nekkiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nekkiy/subscriptions","organizations_url":"https://api.github.com/users/nekkiy/orgs","repos_url":"https://api.github.com/users/nekkiy/repos","events_url":"https://api.github.com/users/nekkiy/events{/privacy}","received_events_url":"https://api.github.com/users/nekkiy/received_events","type":"User","site_admin":false},"body":"Added national certificate support if this contains ASN1 BMPString.","created_at":"2018-04-02T18:40:25Z","updated_at":"2018-04-29T20:50:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ffa16c24cb94f0fed093bdfae5f7804bef77bde","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/luisgoncalves/xades4j/pulls/152/commits","review_comments_url":"https://api.github.com/repos/luisgoncalves/xades4j/pulls/152/comments","review_comment_url":"https://api.github.com/repos/luisgoncalves/xades4j/pulls/comments{/number}","comments_url":"https://api.github.com/repos/luisgoncalves/xades4j/issues/152/comments","statuses_url":"https://api.github.com/repos/luisgoncalves/xades4j/statuses/71f5f62830fbd68445b94ade035d386452a03c86","head":{"label":"KCKSoftware:shared","ref":"shared","sha":"71f5f62830fbd68445b94ade035d386452a03c86","user":{"login":"KCKSoftware","id":33651963,"avatar_url":"https://avatars1.githubusercontent.com/u/33651963?v=4","gravatar_id":"","url":"https://api.github.com/users/KCKSoftware","html_url":"https://github.com/KCKSoftware","followers_url":"https://api.github.com/users/KCKSoftware/followers","following_url":"https://api.github.com/users/KCKSoftware/following{/other_user}","gists_url":"https://api.github.com/users/KCKSoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/KCKSoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KCKSoftware/subscriptions","organizations_url":"https://api.github.com/users/KCKSoftware/orgs","repos_url":"https://api.github.com/users/KCKSoftware/repos","events_url":"https://api.github.com/users/KCKSoftware/events{/privacy}","received_events_url":"https://api.github.com/users/KCKSoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":110560812,"name":"xades4j","full_name":"KCKSoftware/xades4j","owner":{"login":"KCKSoftware","id":33651963,"avatar_url":"https://avatars1.githubusercontent.com/u/33651963?v=4","gravatar_id":"","url":"https://api.github.com/users/KCKSoftware","html_url":"https://github.com/KCKSoftware","followers_url":"https://api.github.com/users/KCKSoftware/followers","following_url":"https://api.github.com/users/KCKSoftware/following{/other_user}","gists_url":"https://api.github.com/users/KCKSoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/KCKSoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KCKSoftware/subscriptions","organizations_url":"https://api.github.com/users/KCKSoftware/orgs","repos_url":"https://api.github.com/users/KCKSoftware/repos","events_url":"https://api.github.com/users/KCKSoftware/events{/privacy}","received_events_url":"https://api.github.com/users/KCKSoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/KCKSoftware/xades4j","description":"A Java library for XAdES signature services","fork":true,"url":"https://api.github.com/repos/KCKSoftware/xades4j","forks_url":"https://api.github.com/repos/KCKSoftware/xades4j/forks","keys_url":"https://api.github.com/repos/KCKSoftware/xades4j/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KCKSoftware/xades4j/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KCKSoftware/xades4j/teams","hooks_url":"https://api.github.com/repos/KCKSoftware/xades4j/hooks","issue_events_url":"https://api.github.com/repos/KCKSoftware/xades4j/issues/events{/number}","events_url":"https://api.github.com/repos/KCKSoftware/xades4j/events","assignees_url":"https://api.github.com/repos/KCKSoftware/xades4j/assignees{/user}","branches_url":"https://api.github.com/repos/KCKSoftware/xades4j/branches{/branch}","tags_url":"https://api.github.com/repos/KCKSoftware/xades4j/tags","blobs_url":"https://api.github.com/repos/KCKSoftware/xades4j/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KCKSoftware/xades4j/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KCKSoftware/xades4j/git/refs{/sha}","trees_url":"https://api.github.com/repos/KCKSoftware/xades4j/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KCKSoftware/xades4j/statuses/{sha}","languages_url":"https://api.github.com/repos/KCKSoftware/xades4j/languages","stargazers_url":"https://api.github.com/repos/KCKSoftware/xades4j/stargazers","contributors_url":"https://api.github.com/repos/KCKSoftware/xades4j/contributors","subscribers_url":"https://api.github.com/repos/KCKSoftware/xades4j/subscribers","subscription_url":"https://api.github.com/repos/KCKSoftware/xades4j/subscription","commits_url":"https://api.github.com/repos/KCKSoftware/xades4j/commits{/sha}","git_commits_url":"https://api.github.com/repos/KCKSoftware/xades4j/git/commits{/sha}","comments_url":"https://api.github.com/repos/KCKSoftware/xades4j/comments{/number}","issue_comment_url":"https://api.github.com/repos/KCKSoftware/xades4j/issues/comments{/number}","contents_url":"https://api.github.com/repos/KCKSoftware/xades4j/contents/{+path}","compare_url":"https://api.github.com/repos/KCKSoftware/xades4j/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KCKSoftware/xades4j/merges","archive_url":"https://api.github.com/repos/KCKSoftware/xades4j/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KCKSoftware/xades4j/downloads","issues_url":"https://api.github.com/repos/KCKSoftware/xades4j/issues{/number}","pulls_url":"https://api.github.com/repos/KCKSoftware/xades4j/pulls{/number}","milestones_url":"https://api.github.com/repos/KCKSoftware/xades4j/milestones{/number}","notifications_url":"https://api.github.com/repos/KCKSoftware/xades4j/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KCKSoftware/xades4j/labels{/name}","releases_url":"https://api.github.com/repos/KCKSoftware/xades4j/releases{/id}","deployments_url":"https://api.github.com/repos/KCKSoftware/xades4j/deployments","created_at":"2017-11-13T14:48:26Z","updated_at":"2018-04-02T18:36:18Z","pushed_at":"2018-04-02T18:38:00Z","git_url":"git://github.com/KCKSoftware/xades4j.git","ssh_url":"git@github.com:KCKSoftware/xades4j.git","clone_url":"https://github.com/KCKSoftware/xades4j.git","svn_url":"https://github.com/KCKSoftware/xades4j","homepage":"","size":17475,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"luisgoncalves:master","ref":"master","sha":"b6300abd427ed5913d161ae71d5e399f4710a43b","user":{"login":"luisgoncalves","id":3973253,"avatar_url":"https://avatars0.githubusercontent.com/u/3973253?v=4","gravatar_id":"","url":"https://api.github.com/users/luisgoncalves","html_url":"https://github.com/luisgoncalves","followers_url":"https://api.github.com/users/luisgoncalves/followers","following_url":"https://api.github.com/users/luisgoncalves/following{/other_user}","gists_url":"https://api.github.com/users/luisgoncalves/gists{/gist_id}","starred_url":"https://api.github.com/users/luisgoncalves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luisgoncalves/subscriptions","organizations_url":"https://api.github.com/users/luisgoncalves/orgs","repos_url":"https://api.github.com/users/luisgoncalves/repos","events_url":"https://api.github.com/users/luisgoncalves/events{/privacy}","received_events_url":"https://api.github.com/users/luisgoncalves/received_events","type":"User","site_admin":false},"repo":{"id":40328937,"name":"xades4j","full_name":"luisgoncalves/xades4j","owner":{"login":"luisgoncalves","id":3973253,"avatar_url":"https://avatars0.githubusercontent.com/u/3973253?v=4","gravatar_id":"","url":"https://api.github.com/users/luisgoncalves","html_url":"https://github.com/luisgoncalves","followers_url":"https://api.github.com/users/luisgoncalves/followers","following_url":"https://api.github.com/users/luisgoncalves/following{/other_user}","gists_url":"https://api.github.com/users/luisgoncalves/gists{/gist_id}","starred_url":"https://api.github.com/users/luisgoncalves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luisgoncalves/subscriptions","organizations_url":"https://api.github.com/users/luisgoncalves/orgs","repos_url":"https://api.github.com/users/luisgoncalves/repos","events_url":"https://api.github.com/users/luisgoncalves/events{/privacy}","received_events_url":"https://api.github.com/users/luisgoncalves/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/luisgoncalves/xades4j","description":"A Java library for XAdES signature services","fork":false,"url":"https://api.github.com/repos/luisgoncalves/xades4j","forks_url":"https://api.github.com/repos/luisgoncalves/xades4j/forks","keys_url":"https://api.github.com/repos/luisgoncalves/xades4j/keys{/key_id}","collaborators_url":"https://api.github.com/repos/luisgoncalves/xades4j/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/luisgoncalves/xades4j/teams","hooks_url":"https://api.github.com/repos/luisgoncalves/xades4j/hooks","issue_events_url":"https://api.github.com/repos/luisgoncalves/xades4j/issues/events{/number}","events_url":"https://api.github.com/repos/luisgoncalves/xades4j/events","assignees_url":"https://api.github.com/repos/luisgoncalves/xades4j/assignees{/user}","branches_url":"https://api.github.com/repos/luisgoncalves/xades4j/branches{/branch}","tags_url":"https://api.github.com/repos/luisgoncalves/xades4j/tags","blobs_url":"https://api.github.com/repos/luisgoncalves/xades4j/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/luisgoncalves/xades4j/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/luisgoncalves/xades4j/git/refs{/sha}","trees_url":"https://api.github.com/repos/luisgoncalves/xades4j/git/trees{/sha}","statuses_url":"https://api.github.com/repos/luisgoncalves/xades4j/statuses/{sha}","languages_url":"https://api.github.com/repos/luisgoncalves/xades4j/languages","stargazers_url":"https://api.github.com/repos/luisgoncalves/xades4j/stargazers","contributors_url":"https://api.github.com/repos/luisgoncalves/xades4j/contributors","subscribers_url":"https://api.github.com/repos/luisgoncalves/xades4j/subscribers","subscription_url":"https://api.github.com/repos/luisgoncalves/xades4j/subscription","commits_url":"https://api.github.com/repos/luisgoncalves/xades4j/commits{/sha}","git_commits_url":"https://api.github.com/repos/luisgoncalves/xades4j/git/commits{/sha}","comments_url":"https://api.github.com/repos/luisgoncalves/xades4j/comments{/number}","issue_comment_url":"https://api.github.com/repos/luisgoncalves/xades4j/issues/comments{/number}","contents_url":"https://api.github.com/repos/luisgoncalves/xades4j/contents/{+path}","compare_url":"https://api.github.com/repos/luisgoncalves/xades4j/compare/{base}...{head}","merges_url":"https://api.github.com/repos/luisgoncalves/xades4j/merges","archive_url":"https://api.github.com/repos/luisgoncalves/xades4j/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/luisgoncalves/xades4j/downloads","issues_url":"https://api.github.com/repos/luisgoncalves/xades4j/issues{/number}","pulls_url":"https://api.github.com/repos/luisgoncalves/xades4j/pulls{/number}","milestones_url":"https://api.github.com/repos/luisgoncalves/xades4j/milestones{/number}","notifications_url":"https://api.github.com/repos/luisgoncalves/xades4j/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/luisgoncalves/xades4j/labels{/name}","releases_url":"https://api.github.com/repos/luisgoncalves/xades4j/releases{/id}","deployments_url":"https://api.github.com/repos/luisgoncalves/xades4j/deployments","created_at":"2015-08-06T22:04:09Z","updated_at":"2018-04-02T18:43:48Z","pushed_at":"2018-04-02T18:40:26Z","git_url":"git://github.com/luisgoncalves/xades4j.git","ssh_url":"git@github.com:luisgoncalves/xades4j.git","clone_url":"https://github.com/luisgoncalves/xades4j.git","svn_url":"https://github.com/luisgoncalves/xades4j","homepage":"","size":17733,"stargazers_count":37,"watchers_count":37,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":25,"mirror_url":null,"archived":false,"open_issues_count":18,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0"},"forks":25,"open_issues":18,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/luisgoncalves/xades4j/pulls/152"},"html":{"href":"https://github.com/luisgoncalves/xades4j/pull/152"},"issue":{"href":"https://api.github.com/repos/luisgoncalves/xades4j/issues/152"},"comments":{"href":"https://api.github.com/repos/luisgoncalves/xades4j/issues/152/comments"},"review_comments":{"href":"https://api.github.com/repos/luisgoncalves/xades4j/pulls/152/comments"},"review_comment":{"href":"https://api.github.com/repos/luisgoncalves/xades4j/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/luisgoncalves/xades4j/pulls/152/commits"},"statuses":{"href":"https://api.github.com/repos/luisgoncalves/xades4j/statuses/71f5f62830fbd68445b94ade035d386452a03c86"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"luisgoncalves"}}