Package org.sf.bee.commons.cryptograph

Examples of org.sf.bee.commons.cryptograph.BeeDesEncrypter.decrypt()


    }

    private String decrypt(final String value) {
        if (_encoded) {
            final BeeDesEncrypter encrypter = new BeeDesEncrypter(SECRET);
            final byte[] data = encrypter.decrypt(value);
            return null != data && data.length > 0 ? new String(data) : "{}";
        }
        return null != value ? value : "{}";
    }
View Full Code Here


    private byte[] decrypt(final byte[] data, final String secret)
            throws UnsupportedEncodingException {
        final String sdata = new String(data, "UTF8");
        if(StringUtils.hasText(secret)){
            final BeeDesEncrypter chipher = new BeeDesEncrypter(secret);
            return chipher.decrypt(sdata);
        } else {
            return BeeBase64.decode(sdata);
        }
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.