// Path: jlib/jibe/src/main/java/hamaster/gradesgin/util/Hex.java
// public final static int bytesToInt(byte[] bytes) {
//     return bytesToInt(bytes,0);
// }
// 
// Path: jlib/jibe/src/main/java/hamaster/gradesgin/util/Hex.java
// public final static byte[] intToByte(int i) {
//     byte[] bt = new byte[4];
//     bt[0] = (byte) ((0xff000000 & i) >> 24);
//     bt[1] = (byte) ((0xff0000 & i) >> 16);
//     bt[2] = (byte) ((0xff00 & i) >> 8);
//     bt[3] = (byte) (0xff & i);
//     return bt;
// }
// 
// Path: jlib/jibe/src/main/java/hamaster/gradesgin/util/MemoryUtil.java
// final public class MemoryUtil {
// 
//     /**
//      * 在新的线程中安全擦除内存块，这个方法在执行后会快速返回<br>
//      * 此方法与在新线程中执行immediateSecureBuffers方法等效
//      * @param buffers 待擦除的内存块
//      */
//     public final static void fastSecureBuffers(byte[] ... buffers) {
//         new SecureBufferThread(buffers).start();
//     }
// 
//     /**
//      * 立刻安全擦除内存块
//      * @param buffers 待擦除的内存块
//      */
//     public final static void immediateSecureBuffers(byte[] ... buffers) {
//         BigInteger i = new BigInteger(Long.toHexString(System.nanoTime()), 16);
//         Random random = new SecureRandom(i.toByteArray());
//         for (byte[] buffer : buffers) {
//             if (buffer != null)
//                 random.nextBytes(buffer);
//         }
//     }
// }


import static hamaster.gradesgin.util.Hex.bytesToInt;
import static hamaster.gradesgin.util.Hex.intToByte;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.security.PublicKey;
import java.util.Arrays;
import hamaster.gradesgin.util.MemoryUtil;
    public String getAlgorithm() {
        return "IBE";
    }

    /*
     * (non-Javadoc)
     * @see java.security.Key#getFormat()
     */
    @Override
    public String getFormat() {
        return null;
    }

    /*
     * (non-Javadoc)
     * @see java.security.Key#getEncoded()
     */
    @Override
    public byte[] getEncoded() {
        return null;
    }

    /**
     * 序列化字段：<br>
     * 用户ID摘要 20字节<br>
     * 用户ID长度 4字节<br>
     * 用户ID字符串
     * @see hamaster.gradesgin.ibe.IBEConstraints#writeExternal(java.io.OutputStream)
     */
    @Override
// Path: jlib/jibe/src/main/java/hamaster/gradesgin/util/Hex.java
// public final static int bytesToInt(byte[] bytes) {
//     return bytesToInt(bytes,0);
// }
// 
// Path: jlib/jibe/src/main/java/hamaster/gradesgin/util/Hex.java
// public final static byte[] intToByte(int i) {
//     byte[] bt = new byte[4];
//     bt[0] = (byte) ((0xff000000 & i) >> 24);
//     bt[1] = (byte) ((0xff0000 & i) >> 16);
//     bt[2] = (byte) ((0xff00 & i) >> 8);
//     bt[3] = (byte) (0xff & i);
//     return bt;
// }
// 
// Path: jlib/jibe/src/main/java/hamaster/gradesgin/util/MemoryUtil.java
// final public class MemoryUtil {
// 
//     /**
//      * 在新的线程中安全擦除内存块，这个方法在执行后会快速返回<br>
//      * 此方法与在新线程中执行immediateSecureBuffers方法等效
//      * @param buffers 待擦除的内存块
//      */
//     public final static void fastSecureBuffers(byte[] ... buffers) {
//         new SecureBufferThread(buffers).start();
//     }
// 
//     /**
//      * 立刻安全擦除内存块
//      * @param buffers 待擦除的内存块
//      */
//     public final static void immediateSecureBuffers(byte[] ... buffers) {
//         BigInteger i = new BigInteger(Long.toHexString(System.nanoTime()), 16);
//         Random random = new SecureRandom(i.toByteArray());
//         for (byte[] buffer : buffers) {
//             if (buffer != null)
//                 random.nextBytes(buffer);
//         }
//     }
// }


// Path: jlib/jibe/src/main/java/hamaster/gradesgin/ibe/IBEPublicKey.java
import static hamaster.gradesgin.util.Hex.bytesToInt;
import static hamaster.gradesgin.util.Hex.intToByte;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.security.PublicKey;
import java.util.Arrays;
import hamaster.gradesgin.util.MemoryUtil;

    public String getAlgorithm() {
        return "IBE";
    }

    /*
     * (non-Javadoc)
     * @see java.security.Key#getFormat()
     */
    @Override
    public String getFormat() {
        return null;
    }

    /*
     * (non-Javadoc)
     * @see java.security.Key#getEncoded()
     */
    @Override
    public byte[] getEncoded() {
        return null;
    }

    /**
     * 序列化字段：<br>
     * 用户ID摘要 20字节<br>
     * 用户ID长度 4字节<br>
     * 用户ID字符串
     * @see hamaster.gradesgin.ibe.IBEConstraints#writeExternal(java.io.OutputStream)
     */
    @Override
    public void writeExternal(OutputStream out) throws IOException {