使用 aws 弹性转码器对我的音频文件进行转码时,我选择了“无存储”。现在我有加密密钥 - xxxxxxxxxxxxxxxxxx 加密密钥 MD5- xxxxxxxxxxxxx 加密初始化向量 -xxxxxxxxxx
所以我使用 awskms 使用此代码解密加密密钥
public ByteBuffer decryptAes(String aes) {
Map<String, String> enccontext = new HashMap<>();
enccontext.put("service", "elastictranscoder.amazonaws.com");
ByteBuffer encrypted = getBytebuffer(Base64.getDecoder().decode(aes));
DecryptRequest reqq = new DecryptRequest().withCiphertextBlob(encrypted).withEncryptionContext(enccontext);
ByteBuffer buf = awskms.decrypt(reqq).withKeyId(keyId).getPlaintext();
return buf;
}
我有一个 m3u8 文件,其密钥为 #EXT-X-KEY:METHOD=AES-128,URI="https://[mysite]/api/public/amazoncode",IV=0xdbe2882930b143e62b3e6e587a2269f8
所以我的困惑是如何将解密密钥发送到 m3u8?,到目前为止我有这个,但它似乎不起作用
// this is the endpoint for https://[mysite]/api/public/amazoncode
@GetMapping(value = "amazoncode")
public ByteBuffer getAmazonCode(){
return amazonClient.decryptAes([the encryption code that i got from amazon]);
}
那么发送解密的字节缓冲区以便我的 m3u8 可以通过从我的端点获取解密数据密钥开始播放的适当响应体是什么?