Searched refs:chain (Results 1 - 25 of 30) sorted by relevance

12

/libcore/luni/src/main/java/javax/net/ssl/
H A DX509TrustManager.java30 * Checks whether the specified certificate chain (partial or complete) can
34 * @param chain
35 * the certificate chain to validate.
39 * if the certificate chain can't be validated or isn't trusted.
41 * if the specified certificate chain is empty or {@code null},
45 public void checkClientTrusted(X509Certificate[] chain, String authType) argument
50 * Checks whether the specified certificate chain (partial or complete) can
54 * @param chain
55 * the certificate chain to validate.
59 * if the certificate chain ca
65 checkServerTrusted(X509Certificate[] chain, String authType) argument
[all...]
/libcore/xml/src/main/java/org/xmlpull/v1/
H A DXmlPullParserException.java36 public XmlPullParserException(String msg, XmlPullParser parser, Throwable chain) { argument
39 + (chain == null ? "" : "caused by: "+chain));
45 this.detail = chain;
/libcore/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/
H A DTrustManagerImpl.java56 * The CertPinManager, which validates the chain against a host-to-pin mapping
180 @Override public void checkClientTrusted(X509Certificate[] chain, String authType) argument
182 checkTrusted(chain, authType, null);
185 @Override public void checkServerTrusted(X509Certificate[] chain, String authType) argument
187 checkTrusted(chain, authType, null);
192 * chain is pinned appropriately for that host. If null, it does not check for pinned certs.
195 public List<X509Certificate> checkServerTrusted(X509Certificate[] chain, String authType, argument
197 return checkTrusted(chain, authType, host);
208 private List<X509Certificate> checkTrusted(X509Certificate[] chain, String authType, String host) argument
210 if (chain
312 cleanupCertChainAndFindTrustAnchors(X509Certificate[] chain, Set<TrustAnchor> trustAnchors) argument
[all...]
H A DPinListEntry.java40 * Determines whether a failed match here will prevent the chain from being accepted. If true,
41 * an unpinned chain will log and cause a match failure. If false, it will merely log.
91 * Checks the given chain against the pin list corresponding to this entry.
97 public boolean chainIsNotPinned(List<X509Certificate> chain) { argument
98 for (X509Certificate cert : chain) {
104 logPinFailure(chain);
139 private boolean chainContainsUserCert(List<X509Certificate> chain) { argument
143 for (X509Certificate cert : chain) {
151 private void logPinFailure(List<X509Certificate> chain) { argument
152 PinFailureLogger.log(cn, chainContainsUserCert(chain), enforcin
[all...]
H A DPinFailureLogger.java33 List<X509Certificate> chain) {
39 writeToLog(cn, chainContainsUserCert, pinIsEnforcing, chain);
46 List<X509Certificate> chain) {
54 for (X509Certificate cert : chain) {
31 log(String cn, boolean chainContainsUserCert, boolean pinIsEnforcing, List<X509Certificate> chain) argument
44 writeToLog(String cn, boolean chainContainsUserCert, boolean pinIsEnforcing, List<X509Certificate> chain) argument
H A DTrustedCertificateKeyStoreSpi.java58 String alias, Key key, char[] password, Certificate[] chain) {
62 @Override public void engineSetKeyEntry(String alias, byte[] key, Certificate[] chain) { argument
57 engineSetKeyEntry( String alias, Key key, char[] password, Certificate[] chain) argument
H A DCertPinManager.java66 * Given a hostname and a certificate chain this verifies that the chain includes
69 * If the chain doesn't include those certs and is in enforcing mode, then this method
72 public boolean chainIsNotPinned(String hostname, List<X509Certificate> chain) argument
79 return entry.chainIsNotPinned(chain);
H A DKeyManagerImpl.java154 final Certificate[] chain = entry.getCertificateChain();
155 final Certificate cert = chain[0];
192 // check that a certificate in the chain was issued by one of the specified issuers
193 loop: for (Certificate certFromChain : chain) {
H A DOpenSSLSessionImpl.java218 javax.security.cert.X509Certificate[] chain
223 chain[i] = javax.security.cert.X509Certificate.getInstance(encoded);
225 return chain;
H A DTrustedCertificateStore.java461 * Attempt to build a certificate chain from the supplied {@code leaf}
462 * argument through the chain of issuers as high up as known. If the chain
463 * can't be completed, the most complete chain available will be returned.
468 final List<X509Certificate> chain = new ArrayList<X509Certificate>();
469 chain.add(leaf);
472 X509Certificate cert = chain.get(i);
480 chain.add(issuer);
483 return chain;
/libcore/support/src/test/java/libcore/javax/net/ssl/
H A DTestTrustManager.java59 public void checkClientTrusted(X509Certificate[] chain, String authType) argument
62 + "chain=" + chain.length + " "
66 trustManager.checkClientTrusted(chain, authType);
80 public void checkServerTrusted(X509Certificate[] chain, String authType) argument
83 + "chain=" + chain.length + " "
87 trustManager.checkServerTrusted(chain, authType);
H A DTestSSLContext.java198 * certificate chain from the given KeyStore and a TrustManager
251 X509Certificate[] chain = (X509Certificate[]) serverChain;
252 trustManager.checkServerTrusted(chain, chain[0].getPublicKey().getAlgorithm());
258 X509Certificate[] chain = (X509Certificate[]) clientChain;
259 trustManager.checkClientTrusted(chain, chain[0].getPublicKey().getAlgorithm());
/libcore/luni/src/main/java/java/security/
H A DKeyStore.java256 * Returns the certificate chain for the entry with the given alias.
260 * @return the certificate chain for the entry with the given alias, or
307 * Associates the given alias with the key, password and certificate chain.
317 * @param chain
318 * the certificate chain.
322 * if {@code key} is a {@code PrivateKey} and {@code chain} does
328 Certificate[] chain) throws KeyStoreException {
333 // Certificate chain is required for PrivateKey
334 if (key != null && key instanceof PrivateKey && (chain == null || chain
327 setKeyEntry(String alias, Key key, char[] password, Certificate[] chain) argument
364 setKeyEntry(String alias, byte[] key, Certificate[] chain) argument
1178 private Certificate[] chain; field in class:KeyStore.PrivateKeyEntry
1200 PrivateKeyEntry(PrivateKey privateKey, Certificate[] chain) argument
[all...]
H A DKeyStoreSpi.java58 * Returns the certificate chain for the entry with the given alias.
62 * @return the certificate chain for the entry with the given alias, or
88 * Associates the given alias with the key, password and certificate chain.
98 * @param chain
99 * the certificate chain.
104 * if {@code key} is a {@code PrivateKey} and {@code chain} does
108 char[] password, Certificate[] chain) throws KeyStoreException;
111 * Associates the given alias with a key and a certificate chain.
119 * @param chain
120 * the certificate chain
107 engineSetKeyEntry(String alias, Key key, char[] password, Certificate[] chain) argument
127 engineSetKeyEntry(String alias, byte[] key, Certificate[] chain) argument
[all...]
/libcore/luni/src/test/java/org/apache/harmony/xnet/provider/jsse/
H A DTrustManagerImplTest.java93 // fail on short chain with only root trusted
95 // succeed on longer chain, learn intermediate
97 // now we can validate the short chain
178 private void assertValid(X509Certificate[] chain, X509TrustManager tm) throws Exception { argument
181 tmi.checkServerTrusted(chain, "RSA");
183 tm.checkServerTrusted(chain, "RSA");
186 private void assertValidPinned(X509Certificate[] chain, X509TrustManager tm, String hostname, argument
190 List<X509Certificate> checkedChain = tmi.checkServerTrusted(chain, "RSA", hostname);
193 tm.checkServerTrusted(chain, "RSA");
196 private void assertInvalid(X509Certificate[] chain, X509TrustManage argument
209 assertInvalidPinned(X509Certificate[] chain, X509TrustManager tm, String hostname) argument
[all...]
H A DCertPinManagerTest.java32 private X509Certificate[] chain; field in class:CertPinManagerTest
60 chain = (X509Certificate[]) pke.getCertificateChain();
61 X509Certificate root = chain[2];
62 X509Certificate server = chain[0];
97 // verify that the shorter chain doesn't work for a name matching the longer
98 assertTrue("short chain long uri failed",
100 // verify that the longer chain doesn't work for a name matching the shorter
101 assertTrue("long chain short uri failed",
103 // verify that the shorter chain works for the shorter domain
104 assertTrue("short chain shor
[all...]
/libcore/luni/src/test/java/libcore/javax/net/ssl/
H A DTrustManagerFactoryTest.java152 X509Certificate[] chain = (X509Certificate[]) pke.getCertificateChain();
155 tm.checkClientTrusted(chain, keyType);
160 tm.checkServerTrusted(chain, keyType);
165 tm.checkClientTrusted(chain, keyType);
166 tm.checkServerTrusted(chain, keyType);
209 // chain should be server/intermediate/root
211 X509Certificate[] chain = (X509Certificate[])pke.getCertificateChain();
212 assertEquals(3, chain.length);
218 keyStore.setCertificateEntry("alias", chain[1]);
237 tm.checkClientTrusted(chain, "RS
[all...]
/libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/
H A DKSPrivateKeyEntryTest.java58 * Test for <code>PrivateKeyEntry(PrivateKey privateKey, Certificate[] chain)</code>
73 * Test for <code>PrivateKeyEntry(PrivateKey privateKey, Certificate[] chain)</code>
75 * Assertion: throws NullPointerException when chain is null
76 * and throws IllegalArgumentException when chain length is 0
79 Certificate[] chain = null;
82 new KeyStore.PrivateKeyEntry(pk, chain);
83 fail("NullPointerException must be thrown when chain is null");
87 chain = new Certificate[0];
88 new KeyStore.PrivateKeyEntry(pk, chain);
89 fail("IllegalArgumentException must be thrown when chain lengt
[all...]
H A DKeyStorePrivateKeyEntryTest.java71 // If all the certificate in the chain is X509Certificate,
75 Certificate[] chain = privateKeyEntry.getCertificateChain();
76 assertTrue(chain instanceof X509Certificate[]);
H A DKeyStore2Test.java276 // testing for a certificate chain
351 assertNull("the certificate chain returned from getCertificateChain is NOT null",
632 Certificate[] chain = { new MyCertificate("DSA", testEncoding),
634 KeyStore.PrivateKeyEntry pkEntry = new KeyStore.PrivateKeyEntry(getPrivateKey(), chain);
664 Certificate[] chain = { new MyCertificate(type, testEncoding),
673 chain);
675 privateKey1, chain);
755 Certificate[] chain = { new MyCertificate(type, testEncoding),
768 KeyStore.PrivateKeyEntry pke1 = new KeyStore.PrivateKeyEntry(getPrivateKey(), chain);
769 KeyStore.PrivateKeyEntry pke2 = new KeyStore.PrivateKeyEntry(privateKey1, chain);
[all...]
/libcore/support/src/test/java/org/apache/harmony/security/tests/support/
H A DMyKeyStore.java93 Certificate[] chain) throws KeyStoreException {
98 if (chain != null) {
99 Chain.put(alias, chain);
104 public void engineSetKeyEntry(String alias, byte[] key, Certificate[] chain) argument
118 if (chain != null) {
119 Chain.put(alias, chain);
92 engineSetKeyEntry(String alias, Key key, char[] password, Certificate[] chain) argument
H A DMyKeyStoreSpi.java69 Certificate[] chain) throws KeyStoreException {
74 public void engineSetKeyEntry(String alias, byte[] key, Certificate[] chain) argument
68 engineSetKeyEntry(String alias, Key key, char[] password, Certificate[] chain) argument
H A DTestKeyStoreSpi.java198 Certificate[] chain) throws KeyStoreException {
207 if (chain == null || chain.length == 0) {
216 public void engineSetKeyEntry(String alias, byte[] key, Certificate[] chain) argument
197 engineSetKeyEntry(String alias, Key key, char[] password, Certificate[] chain) argument
/libcore/luni/src/test/java/tests/api/javax/net/ssl/
H A DHandshakeCompletedEventTest.java557 * chain it sees, so it can later be queried.
561 private X509Certificate[] chain; field in class:HandshakeCompletedEventTest.TestTrustManager
565 public void checkClientTrusted(X509Certificate[] chain, String authType) { argument
566 this.chain = chain;
570 public void checkServerTrusted(X509Certificate[] chain, String authType) { argument
571 this.chain = chain;
580 return chain;
588 java.security.cert.X509Certificate[] chain, Strin
587 checkClientTrusted( java.security.cert.X509Certificate[] chain, String authType) argument
593 checkServerTrusted( java.security.cert.X509Certificate[] chain, String authType) argument
[all...]
/libcore/luni/src/main/java/org/apache/harmony/security/utils/
H A DJarUtils.java178 LinkedList chain = new LinkedList();
179 chain.add(0, signer);
183 return (X509Certificate[])chain.toArray(new X509Certificate[1]);
194 chain.add(issuerCert);
201 return (X509Certificate[])chain.toArray(new X509Certificate[count]);

Completed in 7319 milliseconds

12