C Bridging module for Fairplay Server
First, you need the FairPlay Streaming Server SDK v4.4 from Apple (Requires Developer Program Membership).
Place the .h
files of the Reference Server Implementation into include
and the .c
files into source
(ignoring SKDCredentials.h).
Then you have to go to the file SKDServerUtils.c
and change line 480 to the following (inside method SKDServerRSADecryptKey
):
pKeyBio = BIO_new_mem_buf((void *)pKeyPem, pKeyPem_s);
As a next step, delete both the functions SKDServerFetchContentKeyAndIV()
and SKDServerGetASK()
in the same file.
Then use the following commands:
cmake .
cmake --build .
sudo cmake --install .
The you can run test.py
with python3 test.py
You need at least OpenSSL and Python installed (python3.9-dev libssl-dev
apt-packages)
By default, the KSM outputs lots of debug stuff. To disable, change PS_DEBUG
to 0
in SKDServerUtils.h
.
https://docs.python.org/3/extending/extending.html#compilation-and-linkage
Place the following items in test_data:
dev_private_key.pem
spc.bin