Examples of CertificateException


Examples of java.security.cert.CertificateException

   */
  public void test_Constructor() {
    // Test for method java.security.cert.CertificateException()
    try {
      if (true) {
        throw new CertificateException();
      }
      fail("Should have thrown CertificateException");
    } catch (CertificateException e) {
      assertEquals("Initializer failed : " + e.toString(),
          "java.security.cert.CertificateException", e.toString());
View Full Code Here

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

Examples of java.security.cert.CertificateException

        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

Examples of java.security.cert.CertificateException

        }
    }

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

    {
        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

Examples of java.security.cert.CertificateException

    } 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

Examples of java.security.cert.CertificateException

                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

Examples of java.security.cert.CertificateException

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

Examples of java.security.cert.CertificateException

            KeyStore memoryKeyStore = getMemoryKeyStore();
            addToKeyStore( certificate, memoryKeyStore );
        }
        catch ( Exception e )
        {
            throw new CertificateException( Messages.StudioKeyStoreManager_CantAddCertificateToTrustStore, e );
        }
    }
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.