Ejemplo n.º 1
0
 private function createContentKeyObject($keySeed, $keyId)
 {
     if (!$keyId) {
         throw new KalturaAPIException(KalturaErrors::MISSING_MANDATORY_PARAMETER, "keyId");
     }
     $contentKeyVal = kPlayReadyAESContentKeyGenerator::generatePlayReadyContentKey($keySeed, $keyId);
     $contentKey = new PlayReadyContentKey();
     $contentKey->setKeyId($keyId);
     $contentKey->setContentKey($contentKeyVal);
     return $contentKey;
 }
 /**
  * @param mixed               $writer
  * @param PlayReadyContentKey $contentKey
  */
 private static function serializeContentKey($writer, $contentKey)
 {
     if ($contentKey instanceof ContentEncryptionKeyFromHeader) {
         $writer->startElement('ContentKey');
         $writer->writeAttributeNS('i', 'type', null, 'ContentEncryptionKeyFromHeader');
         $writer->endElement();
     }
     if ($contentKey instanceof ContentEncryptionKeyFromKeyIdentifier) {
         $writer->startElement('ContentKey');
         $writer->writeAttributeNS('i', 'type', null, 'ContentEncryptionKeyFromKeyIdentifier');
         $writer->writeElement('KeyIdentifier', $contentKey->getKeyIdentifier());
         $writer->endElement();
     }
 }