Code example for BadPaddingException

Methods: getMessage

0
        try { 
            return cipher.doFinal(input);
        } catch (IllegalBlockSizeException e) {
            Assert.fail(e.getMessage());
        } catch (BadPaddingException e) {
            Assert.fail(e.getMessage());
        } 
        return null; 
    } 
} 
 
 
class CipherAsymmetricCryptHelper extends CipherHelper<KeyPair/*, U*/> {
 
    private static final String plainData = "some data to encrypt and decrypt test";
 
    CipherAsymmetricCryptHelper(String algorithmName) {
        super(algorithmName, plainData, Cipher.ENCRYPT_MODE,
                Cipher.DECRYPT_MODE);
    }