@Override public byte[] processBlock(final byte[] in, final int inOff, final int len) throws InvalidCipherTextException { byte[] content = new byte[getInputBlockSize()]; System.arraycopy(in, inOff, content, content.length - len, len); try { P11Identity identity = param.p11CryptService().getIdentity(param.identityId()); return identity.sign(PKCS11Constants.CKM_RSA_X_509, null, content); } catch (XiSecurityException | P11TokenException ex) { throw new InvalidCipherTextException(ex.getMessage(), ex); } }