{"id":77,"date":"2009-11-25T21:14:45","date_gmt":"2009-11-25T20:14:45","guid":{"rendered":"http:\/\/www.pmannel.de\/wordpress\/?p=77"},"modified":"2011-01-08T17:42:26","modified_gmt":"2011-01-08T16:42:26","slug":"uberprufen-einer-qualifizierten-signatur-per-extension","status":"publish","type":"post","link":"https:\/\/www.pmannel.de\/wordpress\/?p=77","title":{"rendered":"\u00dcberpr\u00fcfen einer qualifizierten Signatur per Extension"},"content":{"rendered":"\n<p><strong>Wie \u00fcberpr\u00fcft man (mit BouncyCastle), ob ein X509-Zertifikat einer qualifizierten elektronischen Signatur entspricht?<\/strong><\/p>\n<p>Man liest die Extension aus:<\/p>\n<pre class=\"brush:java\">\r\nX509Certificate[] chain = getYourCertificateChain();\r\n\t\ttry\r\n\t\t{\r\n\t\t\tASN1InputStream in \t\t\t= new ASN1InputStream(new ByteArrayInputStream(chain[0].getEncoded()));\r\n\t\t\tDERObject der \t\t\t\t= in.readObject();\r\n\t\t\tX509CertificateStructure x509Str \t= new X509CertificateStructure((ASN1Sequence) der);\r\n\r\n\t\t\tTBSCertificateStructure xTBSCert \t= x509Str.getTBSCertificate();\r\n\t\t\text \t\t\t\t\t\t= xTBSCert.getExtensions();\r\n\r\n\t\t\tX509Extension qcStats \t\t= ext.getExtension(X509Extensions.QCStatements);\r\n\r\n\t\t\tif(null != qcStats)\r\n\t\t\t\t\/\/yes, its is!\r\n\t\t\t\t\/\/.....\r\n\r\n\t\t} catch (CertificateEncodingException e)\r\n\t\t{\r\n\t\t\tlogger.error(e.getMessage());\r\n\t\t}\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Wie \u00fcberpr\u00fcft man (mit BouncyCastle), ob ein X509-Zertifikat einer qualifizierten elektronischen Signatur entspricht? Man liest die Extension aus: X509Certificate[] chain = getYourCertificateChain(); try { ASN1InputStream in = new ASN1InputStream(new ByteArrayInputStream(chain[0].getEncoded())); DERObject der = in.readObject(); X509CertificateStructure x509Str = new X509CertificateStructure((ASN1Sequence) der); TBSCertificateStructure xTBSCert = x509Str.getTBSCertificate(); ext = xTBSCert.getExtensions(); X509Extension qcStats = ext.getExtension(X509Extensions.QCStatements); if(null != qcStats) \/\/yes,&#8230; <\/p>\n<div class=\"read-more\"><a href=\"https:\/\/www.pmannel.de\/wordpress\/?p=77\">Weiterlesen<\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,9],"tags":[31,32],"class_list":["post-77","post","type-post","status-publish","format-standard","hentry","category-java","category-security","tag-bouncycastle","tag-x509"],"_links":{"self":[{"href":"https:\/\/www.pmannel.de\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/77","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pmannel.de\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pmannel.de\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pmannel.de\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pmannel.de\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=77"}],"version-history":[{"count":4,"href":"https:\/\/www.pmannel.de\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/77\/revisions"}],"predecessor-version":[{"id":136,"href":"https:\/\/www.pmannel.de\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/77\/revisions\/136"}],"wp:attachment":[{"href":"https:\/\/www.pmannel.de\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=77"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pmannel.de\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=77"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pmannel.de\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=77"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}