Java Code Examples for java.security.cert.X509CertSelector#setSubjectPublicKey()
The following examples show how to use
java.security.cert.X509CertSelector#setSubjectPublicKey() .
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 testSubjectPublicKey() throws IOException, GeneralSecurityException { System.out.println("X.509 Certificate Match on subject public key"); // bad match X509CertSelector selector = new X509CertSelector(); X509EncodedKeySpec keySpec = new X509EncodedKeySpec( Base64.getMimeDecoder().decode(testKey.getBytes())); KeyFactory keyFactory = KeyFactory.getInstance("DSA"); PublicKey pubKey = keyFactory.generatePublic(keySpec); selector.setSubjectPublicKey(pubKey); checkMatch(selector, cert, false); // good match selector.setSubjectPublicKey(cert.getPublicKey()); checkMatch(selector, cert, true); }
Example 2
Source File: X509CertSelectorTest.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private void testSubjectPublicKey() throws IOException, GeneralSecurityException { System.out.println("X.509 Certificate Match on subject public key"); // bad match X509CertSelector selector = new X509CertSelector(); X509EncodedKeySpec keySpec = new X509EncodedKeySpec( Base64.getMimeDecoder().decode(testKey.getBytes())); KeyFactory keyFactory = KeyFactory.getInstance("DSA"); PublicKey pubKey = keyFactory.generatePublic(keySpec); selector.setSubjectPublicKey(pubKey); checkMatch(selector, cert, false); // good match selector.setSubjectPublicKey(cert.getPublicKey()); checkMatch(selector, cert, true); }
Example 3
Source File: X509CertSelectorTest.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private void testSubjectPublicKey() throws IOException, GeneralSecurityException { System.out.println("X.509 Certificate Match on subject public key"); // bad match X509CertSelector selector = new X509CertSelector(); X509EncodedKeySpec keySpec = new X509EncodedKeySpec( Base64.getMimeDecoder().decode(testKey.getBytes())); KeyFactory keyFactory = KeyFactory.getInstance("DSA"); PublicKey pubKey = keyFactory.generatePublic(keySpec); selector.setSubjectPublicKey(pubKey); checkMatch(selector, cert, false); // good match selector.setSubjectPublicKey(cert.getPublicKey()); 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 testSubjectPublicKey() throws IOException, GeneralSecurityException { System.out.println("X.509 Certificate Match on subject public key"); // bad match X509CertSelector selector = new X509CertSelector(); X509EncodedKeySpec keySpec = new X509EncodedKeySpec( Base64.getMimeDecoder().decode(testKey.getBytes())); KeyFactory keyFactory = KeyFactory.getInstance("DSA"); PublicKey pubKey = keyFactory.generatePublic(keySpec); selector.setSubjectPublicKey(pubKey); checkMatch(selector, cert, false); // good match selector.setSubjectPublicKey(cert.getPublicKey()); checkMatch(selector, cert, true); }
Example 5
Source File: X509CertSelectorTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private void testSubjectPublicKey() throws IOException, GeneralSecurityException { System.out.println("X.509 Certificate Match on subject public key"); // bad match X509CertSelector selector = new X509CertSelector(); X509EncodedKeySpec keySpec = new X509EncodedKeySpec( Base64.getMimeDecoder().decode(testKey.getBytes())); KeyFactory keyFactory = KeyFactory.getInstance("DSA"); PublicKey pubKey = keyFactory.generatePublic(keySpec); selector.setSubjectPublicKey(pubKey); checkMatch(selector, cert, false); // good match selector.setSubjectPublicKey(cert.getPublicKey()); checkMatch(selector, cert, true); }
Example 6
Source File: X509CertSelectorTest.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
private void testSubjectPublicKey() throws IOException, GeneralSecurityException { System.out.println("X.509 Certificate Match on subject public key"); // bad match X509CertSelector selector = new X509CertSelector(); X509EncodedKeySpec keySpec = new X509EncodedKeySpec( Base64.getMimeDecoder().decode(testKey.getBytes())); KeyFactory keyFactory = KeyFactory.getInstance("DSA"); PublicKey pubKey = keyFactory.generatePublic(keySpec); selector.setSubjectPublicKey(pubKey); checkMatch(selector, cert, false); // good match selector.setSubjectPublicKey(cert.getPublicKey()); checkMatch(selector, cert, true); }
Example 7
Source File: X509CertSelectorTest.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
private void testSubjectPublicKey() throws IOException, GeneralSecurityException { System.out.println("X.509 Certificate Match on subject public key"); // bad match X509CertSelector selector = new X509CertSelector(); X509EncodedKeySpec keySpec = new X509EncodedKeySpec( Base64.getMimeDecoder().decode(testKey.getBytes())); KeyFactory keyFactory = KeyFactory.getInstance("DSA"); PublicKey pubKey = keyFactory.generatePublic(keySpec); selector.setSubjectPublicKey(pubKey); checkMatch(selector, cert, false); // good match selector.setSubjectPublicKey(cert.getPublicKey()); checkMatch(selector, cert, true); }
Example 8
Source File: TrustServiceStatusListSignatureVerifier.java From freehealth-connector with GNU Affero General Public License v3.0 | 4 votes |
private static X509CertSelector basedOnPublicKey(X509Certificate cert) { LOG.debug("Matching based on PublicKey [" + cert.getSubjectX500Principal().getName("RFC1779") + "]"); X509CertSelector selector = new X509CertSelector(); selector.setSubjectPublicKey(cert.getPublicKey()); return selector; }
Example 9
Source File: TrustServiceStatusListSignatureVerifier.java From freehealth-connector with GNU Affero General Public License v3.0 | 4 votes |
private static X509CertSelector basedOnPublicKey(X509Certificate cert) { LOG.debug("Matching based on PublicKey [" + cert.getSubjectX500Principal().getName("RFC1779") + "]"); X509CertSelector selector = new X509CertSelector(); selector.setSubjectPublicKey(cert.getPublicKey()); return selector; }
Example 10
Source File: TrustServiceStatusListSignatureVerifier.java From freehealth-connector with GNU Affero General Public License v3.0 | 4 votes |
private static X509CertSelector basedOnPublicKey(X509Certificate cert) { LOG.debug("Matching based on PublicKey [" + cert.getSubjectX500Principal().getName("RFC1779") + "]"); X509CertSelector selector = new X509CertSelector(); selector.setSubjectPublicKey(cert.getPublicKey()); return selector; }
Example 11
Source File: TrustServiceStatusListSignatureVerifier.java From freehealth-connector with GNU Affero General Public License v3.0 | 4 votes |
private static X509CertSelector basedOnPublicKey(X509Certificate cert) { LOG.debug("Matching based on PublicKey [" + cert.getSubjectX500Principal().getName("RFC1779") + "]"); X509CertSelector selector = new X509CertSelector(); selector.setSubjectPublicKey(cert.getPublicKey()); return selector; }
Example 12
Source File: TrustServiceStatusListSignatureVerifier.java From freehealth-connector with GNU Affero General Public License v3.0 | 4 votes |
private static X509CertSelector basedOnPublicKey(X509Certificate cert) { LOG.debug("Matching based on PublicKey [" + cert.getSubjectX500Principal().getName("RFC1779") + "]"); X509CertSelector selector = new X509CertSelector(); selector.setSubjectPublicKey(cert.getPublicKey()); return selector; }