src/MediaServices/Models/ContentKey.php
private function _generateEncryptedContentKey($aesKey, $protectionKey)
    {
        $cert = openssl_x509_read($protectionKey);

        $cryptedContentKey = '';
        openssl_public_encrypt(
            $aesKey,
            $cryptedContentKey,
            $cert,
            OPENSSL_PKCS1_OAEP_PADDING
        );

        $this->_encryptedContentKey = base64_encode($cryptedContentKey);
    }
private function _generateEncryptedContentKey($aesKey, $protectionKey)
    {
        $cert = openssl_x509_read($protectionKey);

        $cryptedContentKey = '';
        openssl_public_encrypt(
            $aesKey,
            $cryptedContentKey,
            $cert,
            OPENSSL_PKCS1_OAEP_PADDING
        );

        $this->_encryptedContentKey = base64_encode($cryptedContentKey);
    }
private function _generateEncryptedContentKey ( $ aesKey , $ protectionKey ) { $ cert = openssl_x509_read ( $ protectionKey ) ; $ cryptedContentKey = '' ; openssl_public_encrypt ( $ aesKey , $ cryptedContentKey , $ cert , OPENSSL_PKCS1_OAEP_PADDING ) ; $ this -> _encryptedContentKey = base64_encode ( $ cryptedContentKey ) ; }
Generate encryption content key. Encrypt aes key with protection key from WAMS.

@param string $aesKey        Content key to encrypt
@param string $protectionKey Protection key (public key) from WAMS
Generate encryption content key . Encrypt aes key with protection key from WAMS .