List of usage examples for javax.crypto IllegalBlockSizeException IllegalBlockSizeException
public IllegalBlockSizeException(String msg)
From source file:org.opensc.pkcs11.spi.PKCS11CipherSpi.java
@Override protected byte[] engineDoFinal(byte[] input, int off, int len) throws IllegalBlockSizeException, BadPaddingException { byte[] ret;//w ww . j a v a 2 s .c o m try { if (this.mode == Cipher.DECRYPT_MODE) if (this.count == 0) ret = doDecryptNative(this.worker.getPvh(), this.worker.getSlotHandle(), this.worker.getSessionHandle(), this.worker.getHandle(), input, off, len); else ret = doFinalDecryptNative(this.worker.getPvh(), this.worker.getSlotHandle(), this.worker.getSessionHandle(), this.worker.getHandle(), input, off, len); else if (this.count == 0) ret = doEncryptNative(this.worker.getPvh(), this.worker.getSlotHandle(), this.worker.getSessionHandle(), this.worker.getHandle(), input, off, len); else ret = doFinalEncryptNative(this.worker.getPvh(), this.worker.getSlotHandle(), this.worker.getSessionHandle(), this.worker.getHandle(), input, off, len); } catch (PKCS11Exception e) { log.error("PKCS11Exception caught:", e); throw new IllegalBlockSizeException("PKCS11Exception caught:" + e); } this.count = 0; return ret; }