Package org.apache.commons.ssl

Examples of org.apache.commons.ssl.TrustMaterial


     * @throws CertificateException thrown if the certificates can not be decoded
     */
    @SuppressWarnings("unchecked")
    public static Collection<X509Certificate> decodeCertificate(byte[] certs) throws CertificateException {
        try {
            TrustMaterial tm = new TrustMaterial(certs);
            return tm.getCertificates();
        } catch (Exception e) {
            throw new CertificateException("Unable to decode X.509 certificates", e);
        }
    }
View Full Code Here


      // setup trustStore
      File TrustMaterial = new File(trustStoreFilePath);
      char[] trustStorePasswordPasswordInCharArray = trustStorePassword
          .toCharArray();
     
      TrustMaterial trustMaterial = new TrustMaterial(TrustMaterial,
          trustStorePasswordPasswordInCharArray);

      httpSecureProtocol.setKeyMaterial(keyMaterial);
      httpSecureProtocol.setTrustMaterial(trustMaterial);
      httpSecureProtocol.setCheckCRL(true);
View Full Code Here

     * @throws CertificateException thrown if the certificates can not be decoded
     */
    @SuppressWarnings("unchecked")
    public static Collection<X509Certificate> decodeCertificate(byte[] certs) throws CertificateException {
        try {
            TrustMaterial tm = new TrustMaterial(certs);
            return tm.getCertificates();
        } catch (Exception e) {
            throw new CertificateException("Unable to decode X.509 certificates", e);
        }
    }
View Full Code Here

     * @throws CertificateException thrown if the certificates can not be decoded
     */
    @SuppressWarnings("unchecked")
    public static Collection<X509Certificate> decodeCertificate(byte[] certs) throws CertificateException {
        try {
            TrustMaterial tm = new TrustMaterial(certs);
            return tm.getCertificates();
        } catch (Exception e) {
            throw new CertificateException("Unable to decode X.509 certificates", e);
        }
    }
View Full Code Here

        if (truststoreUrl != null) {
            char[] tsPass = null;
            if (truststorePassword != null) {
                tsPass = truststorePassword.toCharArray();
            }
            TrustMaterial tm = new KeyMaterial(truststoreUrl, tsPass);
            super.setTrustMaterial(tm);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.ssl.TrustMaterial

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.