Java 8 KeyStoreException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 KeyStoreException class.

This code example shows how to use the following methods:getMessage
            { 
                validate(keyStore, keyStore.getCertificate(keyAlias));
            } 
            catch (KeyStoreException kse)
            { 
                LOG.debug(kse);
                throw new CertificateException("Unable to validate certificate" +
                        " for alias [" + keyAlias + "]: " + kse.getMessage(), kse);
            } 
            result = keyAlias;            
        } 
         
        return result;
    } 
     
    /** 
     * validates a specific certificate inside of the keystore being passed in 
     *  
     * @param keyStore 
     * @param cert 

6
CodeRank
This code example shows how to use the following methods:getMessage
			ks.load(fis, passwordBuffer);
			fis.close();
		} catch (final IOException e) {
			throw new CLIStatusException(e, CloudifyErrorMessages.INVALID_KEYSTORE_FILE.getName(), e.getMessage());
		} catch (final KeyStoreException e) {
			throw new CLIStatusException(e, CloudifyErrorMessages.INVALID_KEYSTORE_FILE.getName(), e.getMessage());
		} catch (final NoSuchAlgorithmException e) {
			throw new CLIStatusException(e, CloudifyErrorMessages.INVALID_KEYSTORE_FILE.getName(), e.getMessage());
		} catch (final CertificateException e) {
			throw new CLIStatusException(e, CloudifyErrorMessages.INVALID_KEYSTORE_FILE.getName(), e.getMessage());
		} 
	} 
} 
6
CodeRank
This code example shows how to use the following methods:getCause, getMessage
     * Test for <code>KeyStoreException(String, Throwable)</code> constructor 
     * Assertion: constructs KeyStoreException when <code>cause</code> is null 
     * <code>msg</code> is null 
     */ 
    public void testKeyStoreException06() { 
        KeyStoreException tE = new KeyStoreException(null, null);
        assertNull("getMessage() must return null", tE.getMessage());
        assertNull("getCause() must return null", tE.getCause());
    } 
 
    /** 
     * Test for <code>KeyStoreException(String, Throwable)</code> constructor 
     * Assertion: constructs KeyStoreException when <code>cause</code> is null 
     * <code>msg</code> is not null 
     */ 
    public void testKeyStoreException07() { 
        KeyStoreException tE;
        for (int i = 0; i < msgs.length; i++) {
            tE = new KeyStoreException(msgs[i], null);
            assertEquals("getMessage() must return: ".concat(msgs[i]), tE
6
CodeRank
This code example shows how to use the following methods:getMessage
            { 
                validate(keyStore, keyStore.getCertificate(keyAlias));
            } 
            catch (KeyStoreException kse)
            { 
                LOG.debug(kse);
                throw new CertificateException("Unable to validate certificate" +
                        " for alias [" + keyAlias + "]: " + kse.getMessage(), kse);
            } 
            result = keyAlias;            
        } 
         
        return result;
    } 
     
    /** 
     * validates a specific certificate inside of the keystore being passed in 
     *  
     * @param keyStore the keystore to validate against 
     * @param cert the certificate to validate 
6
CodeRank
This code example shows how to use the following methods:getCause, getMessage
     * Test for <code>KeyStoreException(Throwable)</code> constructor 
     * Assertion: constructs KeyStoreException when <code>cause</code> is null 
     */ 
    public void testKeyStoreException04() { 
        Throwable cause = null;
        KeyStoreException tE = new KeyStoreException(cause);
        assertNull("getMessage() must return null.", tE.getMessage());
        assertNull("getCause() must return null", tE.getCause());
    } 
 
    /** 
     * Test for <code>KeyStoreException(Throwable)</code> constructor 
     * Assertion: constructs KeyStoreException when <code>cause</code> is not 
     * null 
     */ 
    public void testKeyStoreException05() { 
        KeyStoreException tE = new KeyStoreException(tCause);
        if (tE.getMessage() != null) {
            String toS = tCause.toString();
            String getM = tE.getMessage();
6
CodeRank
This code example shows how to use the following methods:
    { 
        StoreEntry  entry = (StoreEntry)table.get(alias);
 
        if (entry != null && entry.getType() != CERTIFICATE)
        { 
            throw new KeyStoreException("key store already has a key entry with alias " + alias);
        } 
 
        table.put(alias, new StoreEntry(alias, cert));
    } 
 
    public void engineSetKeyEntry( 
        String alias,
        byte[] key,
        Certificate[] chain) 
        throws KeyStoreException 
    { 
        table.put(alias, new StoreEntry(alias, key, chain));
    } 
 
5
CodeRank
This code example shows how to use the following methods:getMessage
            { 
                validate(keyStore, keyStore.getCertificate(keyAlias));
            } 
            catch (KeyStoreException kse)
            { 
                LOG.debug(kse);
                throw new CertificateException("Unable to validate certificate" +
                        " for alias [" + keyAlias + "]: " + kse.getMessage(), kse);
            } 
            result = keyAlias;            
        } 
         
        return result;
    } 
     
    /** 
     * validates a specific certificate inside of the keystore being passed in 
     *  
     * @param keyStore 
     * @param cert 

5
CodeRank
This code example shows how to use the following methods:
    { 
        StoreEntry  entry = (StoreEntry)table.get(alias);
 
        if (entry != null && entry.getType() != CERTIFICATE)
        { 
            throw new KeyStoreException("key store already has a key entry with alias " + alias);
        } 
 
        table.put(alias, new StoreEntry(alias, cert));
    } 
 
    public void engineSetKeyEntry( 
        String alias,
        byte[] key,
        Certificate[] chain) 
        throws KeyStoreException 
    { 
        table.put(alias, new StoreEntry(alias, key, chain));
    } 
 
5
CodeRank
This code example shows how to use the following methods:getMessage
            return sslcontext;
        } catch (NoSuchAlgorithmException e) {
            LOGGER.error(e.getMessage(), e);
            throw new AuthSSLInitializationError("Unsupported algorithm exception: " + e.getMessage());
        } catch (KeyStoreException e) {
            LOGGER.error(e.getMessage(), e);
            throw new AuthSSLInitializationError("Keystore exception: " + e.getMessage());
        } catch (GeneralSecurityException e) {
            LOGGER.error(e.getMessage(), e);
            throw new AuthSSLInitializationError("Key management exception: " + e.getMessage());
        } catch (IOException e) {
            LOGGER.error(e.getMessage(), e);
            throw new AuthSSLInitializationError("I/O error reading keystore/truststore file: " + e.getMessage());
        } 
    } 
 
     public SSLContext getSSLContext() {
        if (this.sslcontext == null) {
            this.sslcontext = createSSLContext();
        } 
5
CodeRank
This code example shows how to use the following methods:getMessage
                } 
            } catch ( InvalidKeyException e ) {
                throw new RuntimeException( "Invalid key checking signature: " + e.getMessage(),
                                            e );
            } catch ( KeyStoreException e ) {
                throw new RuntimeException( "Error accessing Key Store: " + e.getMessage(),
                                            e );
            } catch ( NoSuchAlgorithmException e ) {
                throw new RuntimeException( "No algorithm available: " + e.getMessage(),
                                            e );
            } catch ( SignatureException e ) {
                throw new RuntimeException( "Signature Exception: " + e.getMessage(),
                                            e );
            } 
        } 
    } 
     
    public static ExtensionRegistry buildRegistry() { 
        ExtensionRegistry registry = ExtensionRegistry.newInstance();
        return registry;
5
CodeRank

Related Java 8 KeyStoreException Questions & Answers:

See Code Examples for Java 8 KeyStoreException Methods: