public function signStream($stream, $privateKey)
    {
        try {
            $virgilSourceStream = new VirgilStreamDataSource($stream);
            $virgilSourceStream->reset();

            return (new CryptoVirgilStreamSigner($this->hashAlgorithm))->sign(
                $virgilSourceStream,
                $privateKey
            );
        } catch (Exception $exception) {
            throw new ContentSigningException($exception->getMessage(), $exception->getCode());
        }
    }
public function signStream($stream, $privateKey)
    {
        try {
            $virgilSourceStream = new VirgilStreamDataSource($stream);
            $virgilSourceStream->reset();

            return (new CryptoVirgilStreamSigner($this->hashAlgorithm))->sign(
                $virgilSourceStream,
                $privateKey
            );
        } catch (Exception $exception) {
            throw new ContentSigningException($exception->getMessage(), $exception->getCode());
        }
    }
public function signStream ( $ stream , $ privateKey ) { try { $ virgilSourceStream = new VirgilStreamDataSource ( $ stream ) ; $ virgilSourceStream -> reset ( ) ; return ( new CryptoVirgilStreamSigner ( $ this -> hashAlgorithm ) ) -> sign ( $ virgilSourceStream , $ privateKey ) ; } catch ( Exception $ exception ) { throw new ContentSigningException ( $ exception -> getMessage ( ) , $ exception -> getCode ( ) ) ; } }
Sign stream with a private key

@param resource $stream
@param string   $privateKey

@return string

@throws ContentSigningException
Sign stream with a private key