@Override public void checkServerTrusted( final X509Certificate[] chain, final String authType) throws CertificateException { if (!this.trustStrategy.isTrusted(chain, authType)) { this.trustManager.checkServerTrusted(chain, authType); } }
@Override public void checkServerTrusted( final X509Certificate[] chain, final String authType) throws CertificateException { if (!this.trustStrategy.isTrusted(chain, authType)) { this.trustManager.checkServerTrusted(chain, authType); } }
@Override public void checkServerTrusted( final X509Certificate[] chain, final String authType) throws CertificateException { if (!this.trustStrategy.isTrusted(chain, authType)) { this.trustManager.checkServerTrusted(chain, authType); } }
@Override public void checkServerTrusted( final X509Certificate[] chain, final String authType) throws CertificateException { if (!this.trustStrategy.isTrusted(chain, authType)) { this.trustManager.checkServerTrusted(chain, authType); } }
@Override public void checkServerTrusted(final X509Certificate[] x509Certificates, final String authType) throws CertificateException { X509TrustManager tm = null; try { tm = getDefaultTrustManager(); } catch (Exception e) { throw new RuntimeException("trust manager could not be initialized", e); } if (tm != null) { try { tm.checkServerTrusted(x509Certificates, authType); } catch (CertificateException ex) { if (!trustStrategy.isTrusted(x509Certificates, authType)) { throw new CertificateException("Server is not trusted neither by strategy nor by default trust manager"); } } } }
@Override public void checkClientTrusted(final X509Certificate[] x509Certificates, final String authType) throws CertificateException { X509TrustManager tm = null; try { tm = getDefaultTrustManager(); } catch (Exception e) { throw new RuntimeException("trust manager could not be initialized", e); } if (tm != null) { try { tm.checkClientTrusted(x509Certificates, authType); } catch (CertificateException ex) { if (!trustStrategy.isTrusted(x509Certificates, authType)) { throw new CertificateException("Client is not trusted neither by strategy nor by default trust manager"); } } } }
private void checkTrusted(final X509Certificate[] ownerCertChain) throws WonProtocolException { try { if (!trustStrategy.isTrusted(ownerCertChain, "CLIENT_CERT")) { throw new WonProtocolException("Client cannot be trusted!"); } } catch (CertificateException e) { new WonProtocolException(e); } }