public boolean dec(String pubfile, String prvfile, String encfile, String decfile) throws Exception { byte[] plt, prv_byte, pub_byte; CpabeEncryptedFile ciphertext; BswabeCph cph; BswabePrv prv; BswabePub pub; /* get BswabePub from pubfile */ pub_byte = Common.suckFile(pubfile); pub = new BswabePub(); pub.initFromBuffer(pub_byte); /* read ciphertext */ ciphertext = new CpabeEncryptedFile(pub, encfile); cph = ciphertext.getCph(); /* get BswabePrv form prvfile */ prv_byte = Common.suckFile(prvfile); prv = new BswabePrv(pub); prv.initFromBuffer(prv_byte); BswabeElementBoolean beb = Bswabe.dec(pub, prv, cph); if (beb.isSuccessful() == false) { return false; } plt = AESCoder.decrypt(beb.getElement().toBytes(), ciphertext.getAesBuf()); Common.spitFile(decfile, plt); return true; }