public static RSAPublicKey loadPublicKeyByText(String publicKeyStr) {
        try {
            byte[] buffer = Base64.decodeBase64(publicKeyStr);
            // byte[] buffer = publicKeyStr.getBytes();
            KeyFactory keyFactory = KeyFactory.getInstance("RSA");
            X509EncodedKeySpec keySpec = new X509EncodedKeySpec(buffer);
            return (RSAPublicKey) keyFactory.generatePublic(keySpec);
        } catch (NoSuchAlgorithmException e) {
            logger.error("no such algorithm", e);
        } catch (InvalidKeySpecException e) {
            logger.error("invalid key spec", e);
        } catch (NullPointerException e) {
            logger.error("public key is null", e);
        }
        return null;
    }
get key from public

@param publicKeyStr get key string
inlong-sdk/dataproxy-sdk/src/main/java/org/apache/inlong/sdk/dataproxy/utils/EncryptUtil.java