original_string: public function privateKeyToDer($privateKey, $privateKyePassword = '')
      {
          try {
              if (strlen($privateKyePassword) === 0) {
                  return CryptoVirgilKeyPair::privateKeyToDER($privateKey);
              }
  
              return CryptoVirgilKeyPair::privateKeyToDER(
                  $this->encryptPrivateKey($privateKey, $privateKyePassword),
                  $privateKyePassword
              );
          } catch (Exception $exception) {
              throw new PrivateKeyToDerConvertingException($exception->getMessage(), $exception->getCode());
          }
      }
code: public function privateKeyToDer($privateKey, $privateKyePassword = '')
      {
          try {
              if (strlen($privateKyePassword) === 0) {
                  return CryptoVirgilKeyPair::privateKeyToDER($privateKey);
              }
  
              return CryptoVirgilKeyPair::privateKeyToDER(
                  $this->encryptPrivateKey($privateKey, $privateKyePassword),
                  $privateKyePassword
              );
          } catch (Exception $exception) {
              throw new PrivateKeyToDerConvertingException($exception->getMessage(), $exception->getCode());
          }
      }
code_tokens: public function privateKeyToDer ( $ privateKey , $ privateKyePassword = '' ) { try { if ( strlen ( $ privateKyePassword ) === 0 ) { return CryptoVirgilKeyPair :: privateKeyToDER ( $ privateKey ) ; } return CryptoVirgilKeyPair :: privateKeyToDER ( $ this -> encryptPrivateKey ( $ privateKey , $ privateKyePassword ) , $ privateKyePassword ) ; } catch ( Exception $ exception ) { throw new PrivateKeyToDerConvertingException ( $ exception -> getMessage ( ) , $ exception -> getCode ( ) ) ; } }
docstring: Converts private key to DER format.
  
  @param string $privateKey
  @param string $privateKyePassword
  
  @return string
  
  @throws PrivateKeyToDerConvertingException
docstring_tokens: Converts private key to DER format .