FairPlay KSM
1.0.0
FairPlay-KSM은 Apple DRM 프로토콜의 Netcore 구현입니다. Apple에 따르면 FPS (FairPlay Streaming)는 Apple Mobile Devices, Apple TV 및 Safari의 키를 안전하게 제공하여 암호화 된 비디오 컨텐츠를 재생할 수 있습니다.
이 구현은 라이센스 신선한 또는 SPC-CKC 디버거 (부분적으로 구현)로 사용할 수 있습니다.
FairPlay는 NUGET 패키지로 패키지되어 있으므로 프로젝트에 FoolishTech.FairPlay 패키지 만 포함하면됩니다.
dotnet add package FoolishTech.FairPlay
모듈을 사용하기 전에 Apple에 배포 패키지를 요청해야합니다.
그런 다음 자신의 HTTP 라이센스 서버를 실행할 수 있습니다. 우리의 예를 확인하십시오.
using System ;
using System . Text ;
using System . Threading . Tasks ;
using FoolishTech . FairPlay ;
using FoolishTech . FairPlay . Models ;
using FoolishTech . FairPlay . Interfaces ;
using FoolishTech . FairPlay . Exceptions ;
namespace FoolishTech . SimpleExpeditor
{
public class HardcodedKeyLocator : IContentKeyLocator
{
Task < IContentKey > IContentKeyLocator . FetchContentKey ( byte [ ] contentId , object info /* Object passed on GenerateCKC */ )
{
string id = Encoding . UTF8 . GetString ( contentId ) ;
if ( id . Equals ( "twelve" ) ) return Task . FromResult < IContentKey > ( new FPStaticKey ( "3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C3C" , "D5FBD6B82ED93E4EF98AE40931EE33B7" ) ) ;
else throw new ArgumentOutOfRangeException ( nameof ( contentId ) , $ "We can't find key for content id $ { contentId } " ) ;
}
}
public class SimpleFairPlay
{
public async Task < byte [ ] > Resolve ( byte [ ] spc )
{
try {
FPProvider provider = new FPProvider ( new byte [ ] { /* Certificate+PrivKey P12 */ } , "" /* P12 Passphrase */ , new byte [ ] { /* ASK */ } ) ;
IContentKeyLocator locator = new HardcodedKeyLocator ( ) ;
FPServer server = new FPServer ( provider , locator ) ;
return await server . GenerateCKC ( spc , new Object ( ) ) ;
} catch ( FPKeyLocatorException ) {
// Exception throwed on IContentKeyLocator
} catch ( Exception ) {
// Any other exception.
}
return null ;
}
}
} 예! 풀 풀 요청. :디
Diego Fernández- [email protected]