public static byte[] loadPublicKeyByFileBinary(String path) throws Exception {
        try {
            File file = new File(path);
            int len = 0;
            if (file.exists()) {
                len = (int) file.length();
            } else {
                // error
            }

            DataInputStream dis = new DataInputStream(new BufferedInputStream(new FileInputStream(path)));
            byte[] content = new byte[len];
            while (dis.read(content) != -1) {

            }

            dis.close();
            return content;
        } catch (IOException e) {
            throw new Exception("key error");
        } catch (NullPointerException e) {
            throw new Exception("npe error");
        }
    }
load key

@param path path

@throws Exception exception
inlong-sdk/dataproxy-sdk/src/main/java/org/apache/inlong/sdk/dataproxy/utils/EncryptUtil.java