Package java.security.cert

Examples of java.security.cert.CertificateException


  public void test_ConstructorLjava_lang_String() {
    // Test for method
    // java.security.cert.CertificateException(java.lang.String)
    try {
      if (true) {
        throw new CertificateException("Some error message");
      }
      fail("Should have thrown CertificateException");
    } catch (CertificateException e) {
      assertEquals("Initializer failed",
          "Some error message", e.getMessage());
View Full Code Here


        return keystores.size();
    }

    public void checkClientTrusted(X509Certificate[] certs, String alg) throws CertificateException {
        if (!isTrusted(certs)) {
            throw new CertificateException("No trusted certificate found");
        }
    }
View Full Code Here

        }
    }

    public void checkServerTrusted(X509Certificate[] certs, String alg) throws CertificateException {
        if (!isTrusted(certs)) {
            throw new CertificateException("No trusted certificate found");
        }
    }
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

    } catch (InvalidKeyException e) {
      throw (InvalidKeyException) new InvalidKeyException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e);
    } catch (SignatureException e) {
      throw (SignatureException) new SignatureException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e);
    } catch (CertificateException e) {
      throw (CertificateException) new CertificateException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e);
    } catch (NoSuchAlgorithmException e) {
      throw (NoSuchAlgorithmException) new NoSuchAlgorithmException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e);
    } catch (NoSuchProviderException e) {
      throw (NoSuchProviderException) new NoSuchProviderException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e);
    }
View Full Code Here

                memoryKeyStore = KeyStore.getInstance( "JKS" ); //$NON-NLS-1$
                memoryKeyStore.load( null, null );
            }
            catch ( Exception e )
            {
                throw new CertificateException( Messages.StudioKeyStoreManager_CantReadTrustStore, e );
            }
        }
        return memoryKeyStore;
    }
View Full Code Here

            return fileKeyStore;
        }
        catch ( Exception e )
        {
            throw new CertificateException( Messages.StudioKeyStoreManager_CantReadTrustStore, e );
        }
    }
View Full Code Here

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

            File file = ConnectionCorePlugin.getDefault().getStateLocation().append( filename ).toFile();
            fileKeyStore.store( new FileOutputStream( file ), password.toCharArray() );
        }
        catch ( Exception e )
        {
            throw new CertificateException( Messages.StudioKeyStoreManager_CantAddCertificateToTrustStore, e );
        }
    }
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.