Package com.volcengine.ark.runtime.utils
Class ResponseDecryptUtil
- java.lang.Object
-
- com.volcengine.ark.runtime.utils.ResponseDecryptUtil
-
public class ResponseDecryptUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description ResponseDecryptUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddecryptChoiceContent(byte[] key, byte[] nonce, Map<String,Object> choice)解密单个choice内容 - 非流式static voiddecryptStreamChoiceContent(Map<String,Object> choice, byte[] key, byte[] nonce)解密流式choice的内容static StringdecryptStreamChunk(String data, byte[] key, byte[] nonce)解密流式数据块static StringgetEncryptedContentFromChoice(Map<String,Object> choice)从choice获取加密内容 - 非流式static StringgetEncryptedContentFromStreamChoice(Map<String,Object> choice)从流式choice中获取加密内容static booleanhasValidChoices(Map<String,Object> chunkData)检查chunk数据是否包含有效的choicesstatic booleanshouldDecryptChoice(Map<String,Object> choice)判断choice是否需要解密 - 非流式static booleanshouldDecryptStreamChoice(Map<String,Object> choice)检查是否应该解密流式choicestatic voidupdateStreamChoiceContent(Map<String,Object> choice, String content)更新流式choice的内容
-
-
-
Method Detail
-
decryptStreamChunk
public static String decryptStreamChunk(String data, byte[] key, byte[] nonce) throws Exception
解密流式数据块- Throws:
Exception
-
hasValidChoices
public static boolean hasValidChoices(Map<String,Object> chunkData)
检查chunk数据是否包含有效的choices
-
decryptStreamChoiceContent
public static void decryptStreamChoiceContent(Map<String,Object> choice, byte[] key, byte[] nonce)
解密流式choice的内容
-
shouldDecryptStreamChoice
public static boolean shouldDecryptStreamChoice(Map<String,Object> choice)
检查是否应该解密流式choice
-
getEncryptedContentFromStreamChoice
public static String getEncryptedContentFromStreamChoice(Map<String,Object> choice)
从流式choice中获取加密内容
-
updateStreamChoiceContent
public static void updateStreamChoiceContent(Map<String,Object> choice, String content)
更新流式choice的内容
-
shouldDecryptChoice
public static boolean shouldDecryptChoice(Map<String,Object> choice)
判断choice是否需要解密 - 非流式
-
decryptChoiceContent
public static void decryptChoiceContent(byte[] key, byte[] nonce, Map<String,Object> choice)解密单个choice内容 - 非流式
-
-