Code example for DefaultHandler

0
		InputStream is = cipherTransformer.createInputStream(new ByteArrayInputStream(encryptedData));
		 
		SAXParserFactory factory = SAXParserFactory.newInstance();
		SAXParser saxParser = factory.newSAXParser();
		 
		saxParser.parse(is, new DefaultHandler());	
		 
		// Success if it does not throw an exception 
 
		// Regular CipherInputStream does NOT work with GCM mode 
		// GcmCompatibleCipherInputStream fixes this! 
		 
		// See http://bouncy-castle.1462172.n4.nabble.com/Using-AES-GCM-NoPadding-with-javax-crypto-CipherInputStream-td4655271.html 
		// and http://bouncy-castle.1462172.n4.nabble.com/using-GCMBlockCipher-with-CipherInputStream-td4655147.html 
	}	 
	 
	private void doTestEncryption(List<CipherSpec> cipherSpecs) throws InvalidKeySpecException, NoSuchAlgorithmException, IOException, CipherException, InvalidKeyException {
		Transformer encryptCipherTransformer = new CipherTransformer(cipherSpecs, masterKey);
		Transformer decryptCipherTransformer = new CipherTransformer(cipherSpecs, masterKey);