【问题标题】:Fairplay SPC request returns nilFairplay SPC 请求返回 nil
【发布时间】:2015-07-06 20:27:16
【问题描述】:

我正在尝试使用 [AVAssetResourceLoadingRequest streamingContentKeyRequestDataForApp:contentIdentifier:options:error:];方法来获取 SPC 密钥,但我得到 nil 而不是预期的 SPC 值返回给我。我主要参考提供的示例 Fairplay 应用程序。我使用编码的请求 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}  

【问题讨论】:

    标签: ios objective-c fairplay


    【解决方案1】:

    事实证明,测试流没有使用 SAMPLE-AES 加密正确加密。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-04-07
      • 2012-01-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-10
      • 1970-01-01
      相关资源
      最近更新 更多