FairPlay KSM
1.0.0
FairPlay-kkm هو تنفيذ Netcore لبروتوكول Apple DRM. وفقًا لـ Apple ، يقدم FairPlay Streaming (FPS) بشكل آمن مفاتيح لأجهزة Apple Mobile و Apple TV و Safari على MacOS ، والتي ستمكن من تشغيل محتوى الفيديو المشفر.
يمكن استخدام هذا التنفيذ باعتباره Experitor Expeditor أو 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 ;
}
}
} نعم! افتح طلب سحب. : د
دييغو فرنانديز - [email protected]