void dispose(boolean doCancel) { refList.remove(this); try { if (doCancel) { UcryptoProvider.debug("Resource: cancel CipherCtxt " + id); int k = NativeCipher.nativeFinal(id, encrypt, null, 0); if (k < 0) { UcryptoProvider.debug( "Resource: error cancelling CipherCtxt " + id + " " + new UcryptoException(-k).getMessage()); } } else { UcryptoProvider.debug("Resource: untrace CipherCtxt " + id); } } finally { this.clear(); } }