package com.jjt.nccloud.utils;

import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

import java.io.IOException;

/**
 * Base64¹¤¾ßÀà
 *
 * @author liyang
 *
 */
public class Base64Util {

    /**
     * Base64±àÂë
     */
	public static String encryptBASE64(byte[] key) {
        return (new BASE64Encoder()).encodeBuffer(key);
    }

    /**
     * Base64½âÂë
     * @throws IOException
     */
	public static byte[] decryptBASE64(String key) throws IOException {
        return (new BASE64Decoder()).decodeBuffer(key);
    }

}
