Java Code Examples for java.security.cert.X509CertSelector#setAuthorityKeyIdentifier()
The following examples show how to use
java.security.cert.X509CertSelector#setAuthorityKeyIdentifier() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: X509CertSelectorTest.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
private void testAuthorityKeyIdentifier() throws IOException { System.out.println("X.509 Certificate Match on authorityKeyIdentifier"); // bad match X509CertSelector selector = new X509CertSelector(); byte[] b = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; AuthorityKeyIdentifierExtension a = new AuthorityKeyIdentifierExtension(new KeyIdentifier(b), null, null); selector.setAuthorityKeyIdentifier(a.getExtensionValue()); checkMatch(selector, cert, false); // good match DerInputStream in = new DerInputStream(cert.getExtensionValue("2.5.29.35")); byte[] encoded = in.getOctetString(); selector.setAuthorityKeyIdentifier(encoded); checkMatch(selector, cert, true); }
Example 2
Source File: X509CertSelectorTest.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private void testAuthorityKeyIdentifier() throws IOException { System.out.println("X.509 Certificate Match on authorityKeyIdentifier"); // bad match X509CertSelector selector = new X509CertSelector(); byte[] b = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; AuthorityKeyIdentifierExtension a = new AuthorityKeyIdentifierExtension(new KeyIdentifier(b), null, null); selector.setAuthorityKeyIdentifier(a.getExtensionValue()); checkMatch(selector, cert, false); // good match DerInputStream in = new DerInputStream(cert.getExtensionValue("2.5.29.35")); byte[] encoded = in.getOctetString(); selector.setAuthorityKeyIdentifier(encoded); checkMatch(selector, cert, true); }
Example 3
Source File: X509CertSelectorTest.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private void testAuthorityKeyIdentifier() throws IOException { System.out.println("X.509 Certificate Match on authorityKeyIdentifier"); // bad match X509CertSelector selector = new X509CertSelector(); byte[] b = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; AuthorityKeyIdentifierExtension a = new AuthorityKeyIdentifierExtension(new KeyIdentifier(b), null, null); selector.setAuthorityKeyIdentifier(a.getExtensionValue()); checkMatch(selector, cert, false); // good match DerInputStream in = new DerInputStream(cert.getExtensionValue("2.5.29.35")); byte[] encoded = in.getOctetString(); selector.setAuthorityKeyIdentifier(encoded); checkMatch(selector, cert, true); }
Example 4
Source File: X509CertSelectorTest.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private void testAuthorityKeyIdentifier() throws IOException { System.out.println("X.509 Certificate Match on authorityKeyIdentifier"); // bad match X509CertSelector selector = new X509CertSelector(); byte[] b = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; AuthorityKeyIdentifierExtension a = new AuthorityKeyIdentifierExtension(new KeyIdentifier(b), null, null); selector.setAuthorityKeyIdentifier(a.getExtensionValue()); checkMatch(selector, cert, false); // good match DerInputStream in = new DerInputStream(cert.getExtensionValue("2.5.29.35")); byte[] encoded = in.getOctetString(); selector.setAuthorityKeyIdentifier(encoded); checkMatch(selector, cert, true); }
Example 5
Source File: X509CertSelectorTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private void testAuthorityKeyIdentifier() throws IOException { System.out.println("X.509 Certificate Match on authorityKeyIdentifier"); // bad match X509CertSelector selector = new X509CertSelector(); byte[] b = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; AuthorityKeyIdentifierExtension a = new AuthorityKeyIdentifierExtension(new KeyIdentifier(b), null, null); selector.setAuthorityKeyIdentifier(a.getExtensionValue()); checkMatch(selector, cert, false); // good match DerInputStream in = new DerInputStream(cert.getExtensionValue("2.5.29.35")); byte[] encoded = in.getOctetString(); selector.setAuthorityKeyIdentifier(encoded); checkMatch(selector, cert, true); }
Example 6
Source File: X509CertSelectorTest.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
private void testAuthorityKeyIdentifier() throws IOException { System.out.println("X.509 Certificate Match on authorityKeyIdentifier"); // bad match X509CertSelector selector = new X509CertSelector(); byte[] b = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; AuthorityKeyIdentifierExtension a = new AuthorityKeyIdentifierExtension(new KeyIdentifier(b), null, null); selector.setAuthorityKeyIdentifier(a.getExtensionValue()); checkMatch(selector, cert, false); // good match DerInputStream in = new DerInputStream(cert.getExtensionValue("2.5.29.35")); byte[] encoded = in.getOctetString(); selector.setAuthorityKeyIdentifier(encoded); checkMatch(selector, cert, true); }
Example 7
Source File: X509CertSelectorTest.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
private void testAuthorityKeyIdentifier() throws IOException { System.out.println("X.509 Certificate Match on authorityKeyIdentifier"); // bad match X509CertSelector selector = new X509CertSelector(); byte[] b = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; AuthorityKeyIdentifierExtension a = new AuthorityKeyIdentifierExtension(new KeyIdentifier(b), null, null); selector.setAuthorityKeyIdentifier(a.getExtensionValue()); checkMatch(selector, cert, false); // good match DerInputStream in = new DerInputStream(cert.getExtensionValue("2.5.29.35")); byte[] encoded = in.getOctetString(); selector.setAuthorityKeyIdentifier(encoded); checkMatch(selector, cert, true); }