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

com.anwen.mongo.encryptor.Base64Example Maven / Gradle / Ivy

There is a newer version: 2.1.5
Show newest version
package com.anwen.mongo.encryptor;

import java.util.Base64;

/**
 * base64加密
 *
 * @author anwen
 * @date 2024/6/29 下午1:23
 */
public class Base64Example implements Encryptor {

    @Override
    public String encrypt(String data, String key,String publicKey) throws Exception {
        return Base64.getEncoder().encodeToString(data.getBytes());
    }

    @Override
    public String decrypt(String data, String key, String privateKey) throws Exception {
        return new String(Base64.getDecoder().decode(data));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy