This program downloads and decrypts Recordings and Compositions encrypted using Twilio's Programmable Video capabilities. For further information check the Official Twilio Documentation
- Java 8.
- If you are using Oracle's JDK, you need have installed the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files in your system.
The program requires the following arguments
- The encrypted
SourceSid
. When decrypting a Recording this must be a string of the formRTxx
. When decrypting a Composition it takes the formCJxx
. In bothxx
is a 32 bytes alphanumeric code. - Your Twilio's API key and secret (
SKxx:API_SECRET
) - The private key corresponding to the public key used by Twilio for encrypting the file. This key must be encoded according to the PKCS #8 standard. If you generated the key pair with
openssl
, you'll need to execute the following commandopenssl pkcs8 -in private_key.pem -topk8 -nocrypt -out private_key_pkcs8.pem
- The filename where the decrypted media will be stored. Remember to add the extension (
.mkv
,.mka
,.mp4
,.webm
, etc.)
- Compile the project
mvn clean package
- Execute the jar file with the appropriate arguments. For example, for a video track:
java -jar target/twilio-media-decrypter.jar SKxx:API_SECRET SourceSid privatekey-pkcs8.pem decrypted-filename.mkv