Package java.security.cert

Examples of java.security.cert.CertificateException


            }
            return certificateList.toArray( new X509Certificate[0] );
        }
        catch ( KeyStoreException e )
        {
            throw new CertificateException( Messages.StudioKeyStoreManager_CantReadTrustStore, e );
        }
    }
View Full Code Here


            KeyStore memoryKeyStore = getMemoryKeyStore();
            removeFromKeyStore( certificate, memoryKeyStore );
        }
        catch ( Exception e )
        {
            throw new CertificateException( Messages.StudioKeyStoreManager_CantRemoveCertificateFromTrustStore, e );
        }
    }
View Full Code Here

            fileKeyStore.store( new FileOutputStream( file ), password.toCharArray() );
        }
        catch ( Exception e )
        {
            e.printStackTrace();
            throw new CertificateException( Messages.StudioKeyStoreManager_CantRemoveCertificateFromTrustStore, e );
        }
    }
View Full Code Here

                    break;
                case Session:
                    ConnectionCorePlugin.getDefault().getSessionTrustStoreManager().addCertificate( chain[0] );
                    break;
                case Not:
                    throw new CertificateException( Messages.error__untrusted_certificate );
            }
        }
    }
View Full Code Here

                return ( X509TrustManager ) permanentTrustManager;
            }
        }
        catch ( Exception e )
        {
            throw new CertificateException( Messages.StudioTrustManager_CantCreateTrustManager, e );
        }

        return null;
    }
View Full Code Here

     *
     * @since 1.2
     */
    public static Collection<X509Certificate> decodeCertificate(File certs) throws CertificateException{
        if(!certs.exists()){
            throw new CertificateException("Certificate file " + certs.getAbsolutePath() + " does not exist");
        }
       
        if(!certs.canRead()){
            throw new CertificateException("Certificate file " + certs.getAbsolutePath() + " is not readable");
        }
       
        try{
            return decodeCertificate(DatatypeHelper.fileToByteArray(certs));
        }catch(IOException e){
            throw new CertificateException("Error reading certificate file " + certs.getAbsolutePath(), e);
        }
    }
View Full Code Here

    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

    {
        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

    {
        Signature signature = Signature.getInstance(c.getSignatureAlgorithm().getObjectId().getId(), sigProvider);

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

        signature.initVerify(key);

        signature.update(this.getTBSCertificate());
View Full Code Here

  public void checkClientTrusted(X509Certificate[] arg0, String arg1)
    throws CertificateException
  {
    if (DSA.equals(arg0[0]) || RSA.equals(arg0[0]))
      return;
    throw new CertificateException();
  }
View Full Code Here

TOP

Related Classes of java.security.cert.CertificateException

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.