我正在尝试使用streamingContentKeyRequestDataForApp:contentIdentifier:options:error:;AVAssetResourceLoadingRequest方法来获取SPC键,但是返回给我的不是预期的SPC值,而是nil。我主要引用提供的Fairplay应用程序示例。我使用编码的request URL主机字符串作为内容标识符,使用从SPC服务器检索的.DER证书作为应用程序数据。还有没有人遇到过这个问题?
NSString *hostString = [URL host];
NSData *assetId = [NSData dataWithBytes:[hostString cStringUsingEncoding:NSUTF8StringEncoding] length:[hostString lengthOfBytesUsingEncoding:NSUTF8StringEncoding]];
NSData *certificate = (obtained via Key Server).
NSError *error;
NSData *SPC = [loadingRequest streamingContentKeyRequestDataForApp:certificate contentIdentifier:assetId options:nil error:&error]
SPC在这里的输出是nil。完整的错误描述如下:
Error Domain=AVFoundationErrorDomain
Code=-11800 "The operation could not be completed"
UserInfo=0x170461980
{NSUnderlyingError=0x1740548e0 "The operation couldn’t be completed. (OSStatus error -12640.)",
NSLocalizedFailureReason=An unknown error occurred (-12640),
NSLocalizedDescription=The operation could not be completed}
发布于 2015-07-17 01:10:19
事实证明,使用SAMPLE-AES加密没有正确地加密测试流。
https://stackoverflow.com/questions/31254992
复制相似问题