Sign the transaction using the given second passphrase.

@param string $secondPassphrase

@return \ArkEcosystem\Crypto\Transactions\Builder\AbstractTransaction
974398
public function secondSign(string $secondPassphrase): self
    {
        $this->transaction = $this->transaction->secondSign(PrivateKey::fromPassphrase($secondPassphrase));
        $this->transaction->id = $this->transaction->getId();

        return $this;
    }
653020
public function levenshtein($first, $second)
    {
        $l = new \Atomescrochus\StringSimilarities\Levenshtein();

        return $l->compare($first, $second);
    }
791997
protected function generatePublicKey($path, $passphrase)
    {
        $processArgs = sprintf('rsa -pubout -in %s/private.pem -out %s/public.pem -passin pass:%s', $path, $path, $passphrase);

        $this->generateKey($processArgs);
    }
949929
public function setPassword($password)
    {
        if (null === $password) {
            return $this;
        }

        if (!is_string($password) || trim($password) == '') {
            throw new InvalidPasswordException();
        }

        $this->password = $password;

        return $this;
    }
1085972
public static function verify_password($pass1, $pass2) {
		$pass1 = trim($pass1);
		$pass2 = trim($pass2);
		# type twice the same
		if ($pass1 != $pass2)
			return AdminStoreError::PASSWORD_NOT_SAME;
		# must be longer than 3
		if (strlen($pass1) < 4)
			return AdminStoreError::PASSWORD_TOO_SHORT;
		return 0;
	}
511
protected function sendTransaction($signed, $paths, $checkFee = false) {
        return $this->sdk->sendTransaction($this->identifier, $signed, $paths, $checkFee);
    }
643390
public static function sign($message, PrivateKey $rsaPrivateKey)
    {
        $rsa = self::getRsa(RSA::SIGNATURE_PSS);

        $return = $rsa->loadKey($rsaPrivateKey->getKey());
        if ($return === false) {
            throw new InvalidKeyException('Signing failed due to invalid key');
        }

        return $rsa->sign($message);
    }
288877
public function findOneWithCurrencyPair(string $firstCurrencyCode, string $secondCurrencyCode): ?ExchangeRateInterface
    {
        $expr = $this->getEntityManager()->getExpressionBuilder();

        return $this->createQueryBuilder('o')
            ->addSelect('sourceCurrency')
            ->addSelect('targetCurrency')
            ->innerJoin('o.sourceCurrency', 'sourceCurrency')
            ->innerJoin('o.targetCurrency', 'targetCurrency')
            ->andWhere($expr->orX(
                'sourceCurrency.code = :firstCurrency AND targetCurrency.code = :secondCurrency',
                'targetCurrency.code = :firstCurrency AND sourceCurrency.code = :secondCurrency'
            ))
            ->setParameter('firstCurrency', $firstCurrencyCode)
            ->setParameter('secondCurrency', $secondCurrencyCode)
            ->getQuery()
            ->getOneOrNullResult()
        ;
    }
1314509
public function secondVerify(string $secondPublicKey): bool
    {
        $factory = new PublicKeyFactory;
        $secondPublicKey = $factory->fromHex($secondPublicKey);

        return $secondPublicKey->verify(
            Hash::sha256($this->toBytes(false)),
            SignatureFactory::fromHex($this->signSignature)
        );
    }
1163514
public static function fromPassphrase(string $passphrase, AbstractNetwork $network = null): string
    {
        return static::fromPrivateKey(PrivateKey::fromPassphrase($passphrase), $network);
    }
9481
public function signRequest(
        RequestInterface $request,
        SigningSecretKey $secretKey
    ): RequestInterface {
        $signature = \ParagonIE_Sodium_Compat::crypto_sign_detached(
            (string) $request->getBody(),
            $secretKey->getString(true)
        );
        return $request->withAddedHeader(
            (string) static::HEADER_SIGNATURE_NAME,
            Base64UrlSafe::encode($signature)
        );
    }
709293
protected function generatePrivateKey($path, $passphrase)
    {
        if ($passphrase) {
            $processArgs = sprintf('genrsa -out %s/private.pem -aes256 -passout pass:%s 4096', $path, $passphrase);
        } else {
            $processArgs = sprintf('genrsa -out %s/private.pem 4096', $path);
        }

        $this->generateKey($processArgs);
    }
1341230
public function extractPublicKey($private, $passphrase = null)
    {
        $this->clearBufferedMessages();

        if (false === ($resource = openssl_pkey_get_private($private, $passphrase))) {
            throw new RuntimeException(sprintf(
                'The private key could not be processed: %s',
                openssl_error_string()
            ));
        }

        if (false === ($details = openssl_pkey_get_details($resource))) {
            throw new RuntimeException(sprintf(
                'The details of the private key could not be extracted: %s',
                openssl_error_string()
            ));
        }

        openssl_free_key($resource);

        return $details['key'];
    }
1164236
public function DKIM_Sign($signHeader)
    {
        if (!defined('PKCS7_TEXT')) {
            if ($this->exceptions) {
                throw new Exception($this->lang('extension_missing') . 'openssl');
            }

            return '';
        }
        $privKeyStr = !empty($this->DKIM_private_string) ?
            $this->DKIM_private_string :
            file_get_contents($this->DKIM_private);
        if ('' != $this->DKIM_passphrase) {
            $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase);
        } else {
            $privKey = openssl_pkey_get_private($privKeyStr);
        }
        if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) {
            openssl_pkey_free($privKey);

            return base64_encode($signature);
        }
        openssl_pkey_free($privKey);

        return '';
    }
1144846
private function sign($data)
    {
        if (openssl_sign((string)$data, $signature, $this->privateKey->toString(), static::SIGNATURE_ALGORITHM) !== true) {
            throw new \Exception("Could not sign request: " . openssl_error_string());
        }

        return $signature;
    }
1114180
public function setPassword($password)
    {
        if ($this->isNew() && ($password === null || trim($password) == "")) {
            throw new InvalidArgumentException("customer password is mandatory on creation");
        }

        if ($password !== null && trim($password) != "") {
            $this->setAlgo("PASSWORD_BCRYPT");

            parent::setPassword(password_hash($password, PASSWORD_BCRYPT));
        }

        return $this;
    }
1236753
function _sign($key, $signatureAlgorithm)
    {
        switch (strtolower(get_class($key))) {
            case 'crypt_rsa':
                switch ($signatureAlgorithm) {
                    case 'md2WithRSAEncryption':
                    case 'md5WithRSAEncryption':
                    case 'sha1WithRSAEncryption':
                    case 'sha224WithRSAEncryption':
                    case 'sha256WithRSAEncryption':
                    case 'sha384WithRSAEncryption':
                    case 'sha512WithRSAEncryption':
                        $key->setHash(preg_replace('#WithRSAEncryption$#', '', $signatureAlgorithm));
                        $key->setSignatureMode(CRYPT_RSA_SIGNATURE_PKCS1);

                        $this->currentCert['signature'] = base64_encode("\0" . $key->sign($this->signatureSubject));
                        return $this->currentCert;
                }
            default:
                return false;
        }
    }