All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hecloud.runtime.common.encryptor.Encryptor Maven / Gradle / Ivy

package com.hecloud.runtime.common.encryptor;

/**
 * 加密器接口
 *
 * @author LoveinBJ
 * @version 1.0
 * @since 2016.08.05
 */
public interface Encryptor {

    /**
     * 加密
     *
     * @param data 明文
     * @param key  密钥
     * @return 密文
     * @throws Exception 运行异常 异常
     */
    String encrypt(String data, String key) throws Exception;

    /**
     * 加密
     *
     * @param data 明文
     * @param key  密钥
     * @return 密文
     */
    byte[] encrypt(byte[] data, String key);

    /**
     * 解密
     *
     * @param cipherText 密文
     * @param key        密钥
     * @return 明文
     * @throws Exception 运行异常 异常
     */
    String decrypt(String cipherText, String key) throws Exception;

    /**
     * 解密
     *
     * @param cipherText 密文
     * @param key        密钥
     * @return 明文
     */
    byte[] decrypt(byte[] cipherText, String key);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy