public function sign($plaintext, $fingerprint)
    {
        if ($fingerprint === null || !isset($this->keys[$fingerprint])) {
            throw new InvalidKeyPairIdException('Invalid keypair fingerprint given', 1299095799);
        }

        $signature = '';
        openssl_sign($plaintext, $signature, $this->keys[$fingerprint]['privateKey']->getKeyString());

        return $signature;
    }
public function sign($plaintext, $fingerprint)
    {
        if ($fingerprint === null || !isset($this->keys[$fingerprint])) {
            throw new InvalidKeyPairIdException('Invalid keypair fingerprint given', 1299095799);
        }

        $signature = '';
        openssl_sign($plaintext, $signature, $this->keys[$fingerprint]['privateKey']->getKeyString());

        return $signature;
    }
public function sign ( $ plaintext , $ fingerprint ) { if ( $ fingerprint === null || ! isset ( $ this -> keys [ $ fingerprint ] ) ) { throw new InvalidKeyPairIdException ( 'Invalid keypair fingerprint given' , 1299095799 ) ; } $ signature = '' ; openssl_sign ( $ plaintext , $ signature , $ this -> keys [ $ fingerprint ] [ 'privateKey' ] -> getKeyString ( ) ) ; return $ signature ; }
Signs the given plaintext with the private key identified by the given fingerprint

@param string $plaintext The plaintext to sign
@param string $fingerprint The fingerprint to identify the private key (RSA public key fingerprint)
@return string The signature of the given plaintext
@throws InvalidKeyPairIdException If the given fingerprint identifies no valid keypair
Signs the given plaintext with the private key identified by the given fingerprint