Code example for InvalidKeyException

Methods: getMessage, printStackTrace

0
			 * XXX(mdempsky): Could happen if the user's JRE doesn't support PBKDF2, 
			 * AES, and/or HMAC-SHA1.  Throw a better exception? 
			 */ 
			throw new TypeNotPresentException(e.getMessage(), e);
		} catch (InvalidKeyException e) {
			e.printStackTrace();
			/* Shouldn't happen: our key specs match our algorithms. */ 
			throw new TypeNotPresentException(e.getMessage(), e);
		} catch (InvalidKeySpecException e) {
			/* Shouldn't happen: our key specs match our algorithms. */ 
			throw new TypeNotPresentException(e.getMessage(), e);
		} catch (NoSuchPaddingException e) {
			/* Shouldn't happen: we don't specify any padding schemes. */ 
			throw new TypeNotPresentException(e.getMessage(), e);
		} 
	} 
 
	public void cryptUpdate(byte[] in, int length) {
		try { 
			/* 
			 * We must implement CTR mode by hand, because WinZip's AES encryption