Examples of CertificateException


Examples of br.net.woodstock.rockframework.security.cert.CertificateException

          issuer = this.getIssuer(issuer.getIssuer(), certificates);
        }
      }
      return Collections.toArray(list, Certificate.class);
    } catch (Exception e) {
      throw new CertificateException(e);
    }
  }
View Full Code Here

Examples of java.security.cert.CertificateException

      {
    DERInputStream derInStream = new DERInputStream(inStream);
    DERObject derObject = derInStream.readObject();
    if ( derObject == null || ! ( derObject instanceof ASN1Sequence ) )
    {
        throw new CertificateException("input stream does not contain a ASN1 SEQUENCE while reading PkiPath encoded data to load CertPath" );
    }
    Enumeration enumx = ((ASN1Sequence)derObject).getObjects();
    InputStream certInStream;
    ByteArrayOutputStream outStream;
    DEROutputStream derOutStream;
    certificates = new ArrayList();
    CertificateFactory certFactory= CertificateFactory.getInstance( "X.509", "BC" );
    while ( enumx.hasMoreElements() ) {
        outStream = new ByteArrayOutputStream();
        derOutStream = new DEROutputStream(outStream);
   
              derOutStream.writeObject(enumx.nextElement());
              derOutStream.close();

        certInStream = new ByteArrayInputStream(outStream.toByteArray());
        certificates.add(0,certFactory.generateCertificate(certInStream));
    }
      }
      else
      {
    throw new CertificateException( "unsupported encoding" );
      }
  } catch ( IOException ex ) {
      throw new CertificateException( "IOException throw while decoding CertPath:\n" + ex.toString() );
  } catch ( NoSuchProviderException ex ) {
      throw new CertificateException( "BouncyCastle provider not found while trying to get a CertificateFactory:\n" + ex.toString() );
  }
    }
View Full Code Here

Examples of java.security.cert.CertificateException

   * @param authType The authentication type based on the client certificate.
   * @throws CertificateException Always.
   */
  public void checkClientTrusted(X509Certificate[] chain, String authType)
  throws CertificateException {
    throw new CertificateException("This trust manager _is_ for clients. "+
        "What other client should be trusted?");
  }
View Full Code Here

Examples of java.security.cert.CertificateException

   * @throws CertificateException If the server is not trusted.
   */
  public void checkServerTrusted(X509Certificate[] chain, String authType)
  throws CertificateException {
    if (!trustManager.isTrusted(chain)) {
      throw new CertificateException("The certificate chain is not "+
          "trusted!");
    }
  }
View Full Code Here

Examples of java.security.cert.CertificateException

                return readDERCertificate(in);
            }
        }
        catch (IOException e)
        {
            throw new CertificateException(e.toString());
        }
    }
View Full Code Here

Examples of java.security.cert.CertificateException

        {
            obj = iter.next();
            if ( obj != null ) {
                if ( ! ( obj instanceof X509Certificate ) )
                {
                    throw new CertificateException( "list contains none X509Certificate object while creating CertPath\n" + obj.toString() );
                }
            }
        }
        return new PKIXCertPath( certificates );
    }
View Full Code Here

Examples of java.security.cert.CertificateException

    {
        Signature   signature = null;

        if (!c.getSignatureAlgorithm().equals(c.getTBSCertificate().getSignature()))
        {
            throw new CertificateException("signature algorithm in TBS cert not same as outer cert");
        }

        try
        {
            signature = Signature.getInstance(c.getSignatureAlgorithm().getObjectId().getId(), "BC");
View Full Code Here

Examples of java.security.cert.CertificateException

    public static TrustManager[] getTrustManagerArray() {
        return new TrustManager[] { getInstance() };
    }

    public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
        throw new CertificateException("Client certs are not trusted by the custom SSL trust manager.");
    }
View Full Code Here

Examples of java.security.cert.CertificateException

                if (log.isInfoEnabled())
                    log.info("Failed to validate certificate path", e);
            }
        }

        throw new CertificateException("Certificate chain is not trusted");
    }
View Full Code Here

Examples of java.security.cert.CertificateException

          
        }
    }

    public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
        throw new CertificateException("Client certs are not trusted by the custom SSL trust manager.");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.