public function encryptWorkbook($encryptionType = 'XOR', $password = '', $keyLength = '')
    {
        //Build JSON to post
        $fieldsArray['EncriptionType'] = $encryptionType;
        $fieldsArray['KeyLength'] = $keyLength;
        $fieldsArray['Password'] = $password;
        $json = json_encode($fieldsArray);
        $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/encryption';
        $signedURI = Utils::sign($strURI);
        $responseStream = Utils::processCommand($signedURI, 'POST', 'json', $json);
        $json_response = json_decode($responseStream);
        if ($json_response->Code == 200)
            return true;
        else
            return false;

    }
public function encryptWorkbook($encryptionType = 'XOR', $password = '', $keyLength = '')
    {
        //Build JSON to post
        $fieldsArray['EncriptionType'] = $encryptionType;
        $fieldsArray['KeyLength'] = $keyLength;
        $fieldsArray['Password'] = $password;
        $json = json_encode($fieldsArray);
        $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() . '/encryption';
        $signedURI = Utils::sign($strURI);
        $responseStream = Utils::processCommand($signedURI, 'POST', 'json', $json);
        $json_response = json_decode($responseStream);
        if ($json_response->Code == 200)
            return true;
        else
            return false;

    }
public function encryptWorkbook ( $ encryptionType = 'XOR' , $ password = '' , $ keyLength = '' ) { //Build JSON to post $ fieldsArray [ 'EncriptionType' ] = $ encryptionType ; $ fieldsArray [ 'KeyLength' ] = $ keyLength ; $ fieldsArray [ 'Password' ] = $ password ; $ json = json_encode ( $ fieldsArray ) ; $ strURI = Product :: $ baseProductUri . '/cells/' . $ this -> getFileName ( ) . '/encryption' ; $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream = Utils :: processCommand ( $ signedURI , 'POST' , 'json' , $ json ) ; $ json_response = json_decode ( $ responseStream ) ; if ( $ json_response -> Code == 200 ) return true ; else return false ; }
Encrypt workbook.

@param string $encryptionType Type of the encryption.
@param string $password Document encryption password.
@param integer $keyLength The key length. This parameter is only for Excel97~2003 format

@return boolean
@throws Exception
Encrypt workbook .