src/MediaServices/MediaServicesRestProxy.php
public function getProtectionKey($protectionKeyId)
    {
        Validate::isString($protectionKeyId, 'protectionKeyId');

        $method = Resources::HTTP_GET;
        $path = "GetProtectionKey?ProtectionKeyId='{$protectionKeyId}'";
        $headers = [];
        $postParams = [];
        $queryParams = [];
        $statusCode = Resources::STATUS_OK;

        $response = $this->sendHttp(
            $method,
            $headers,
            $queryParams,
            $postParams,
            $path,
            $statusCode
        );

        $encoded = (string) simplexml_load_string($response->getBody());
        $encoded = implode("\n", str_split($encoded, 76));
        $encoded = "-----BEGIN CERTIFICATE-----\n".$encoded;
        $encoded .= "\n-----END CERTIFICATE-----";

        return $encoded;
    }
public function getProtectionKey($protectionKeyId)
    {
        Validate::isString($protectionKeyId, 'protectionKeyId');

        $method = Resources::HTTP_GET;
        $path = "GetProtectionKey?ProtectionKeyId='{$protectionKeyId}'";
        $headers = [];
        $postParams = [];
        $queryParams = [];
        $statusCode = Resources::STATUS_OK;

        $response = $this->sendHttp(
            $method,
            $headers,
            $queryParams,
            $postParams,
            $path,
            $statusCode
        );

        $encoded = (string) simplexml_load_string($response->getBody());
        $encoded = implode("\n", str_split($encoded, 76));
        $encoded = "-----BEGIN CERTIFICATE-----\n".$encoded;
        $encoded .= "\n-----END CERTIFICATE-----";

        return $encoded;
    }
public function getProtectionKey ( $ protectionKeyId ) { Validate :: isString ( $ protectionKeyId , 'protectionKeyId' ) ; $ method = Resources :: HTTP_GET ; $ path = "GetProtectionKey?ProtectionKeyId='{$protectionKeyId}'" ; $ headers = [ ] ; $ postParams = [ ] ; $ queryParams = [ ] ; $ statusCode = Resources :: STATUS_OK ; $ response = $ this -> sendHttp ( $ method , $ headers , $ queryParams , $ postParams , $ path , $ statusCode ) ; $ encoded = ( string ) simplexml_load_string ( $ response -> getBody ( ) ) ; $ encoded = implode ( "\n" , str_split ( $ encoded , 76 ) ) ; $ encoded = "-----BEGIN CERTIFICATE-----\n" . $ encoded ; $ encoded .= "\n-----END CERTIFICATE-----" ; return $ encoded ; }
Retrieve the specific X.509 certificate that should be used to encrypt your
user-defined content key.

@param string $protectionKeyId ProtectionKey id

@return string
Retrieve the specific X . 509 certificate that should be used to encrypt your user - defined content key .