Namshi\JOSE\Signer\OpenSSL\PublicKey::sign PHP Method

sign() public method

public sign ( $input, $key, $password = null )
    public function sign($input, $key, $password = null)
    {
        $keyResource = $this->getKeyResource($key, $password);
        if (!$this->supportsKey($keyResource)) {
            throw new InvalidArgumentException('Invalid key supplied.');
        }
        $signature = null;
        openssl_sign($input, $signature, $keyResource, $this->getHashingAlgorithm());
        return $signature;
    }