Code example for InvalidKeyException

Methods: getMessage

0
	 */ 
	protected void flush(boolean flushLastBlock, boolean flushNow) throws IOException {
		try { 
			flushToNetwork(flushLastBlock, flushNow);
		} catch (InvalidKeyException e) {
			throw new IOException("Cannot sign content -- invalid key!: " + e.getMessage());
		} catch (SignatureException e) {
			throw new IOException("Cannot sign content -- signature failure!: " + e.getMessage());
		} catch (NoSuchAlgorithmException e) {
			throw new IOException("Cannot sign content -- unknown algorithm!: " + e.getMessage());
		} catch (InterruptedException e) {
			throw new IOException("Low-level network failure!: " + e.getMessage());
		} catch (InvalidAlgorithmParameterException e) {
			throw new IOException("Cannot encrypt content -- bad algorithm parameter!: " + e.getMessage());
		} 
	} 
 
	@Override 
	public void write(byte[] b, int off, int len) throws IOException {
		try {