Crypt/GPG.php
public function sign(
        $data,
        $mode = self::SIGN_MODE_NORMAL,
        $armor = self::ARMOR_ASCII,
        $textmode = self::TEXT_RAW
    ) {
        return $this->_sign($data, false, null, $mode, $armor, $textmode);
    }
public function sign(
        $data,
        $mode = self::SIGN_MODE_NORMAL,
        $armor = self::ARMOR_ASCII,
        $textmode = self::TEXT_RAW
    ) {
        return $this->_sign($data, false, null, $mode, $armor, $textmode);
    }
Signs data

Data may be signed using any one of the three available signing modes:
- {@link Crypt_GPG::SIGN_MODE_NORMAL}
- {@link Crypt_GPG::SIGN_MODE_CLEAR}
- {@link Crypt_GPG::SIGN_MODE_DETACHED}

@param string  $data     the data to be signed.
@param int     $mode     optional. The data signing mode to use. Should
be one of {@link Crypt_GPG::SIGN_MODE_NORMAL},
{@link Crypt_GPG::SIGN_MODE_CLEAR} or
{@link Crypt_GPG::SIGN_MODE_DETACHED}. If not
specified, defaults to
<kbd>Crypt_GPG::SIGN_MODE_NORMAL</kbd>.
@param boolean $armor    optional. If true, ASCII armored data is
returned; otherwise, binary data is returned.
Defaults to true. This has no effect if the
mode <kbd>Crypt_GPG::SIGN_MODE_CLEAR</kbd> is
used.
@param boolean $textmode optional. If true, line-breaks in signed data
are normalized. Use this option when signing
e-mail, or for greater compatibility between
systems with different line-break formats.
Defaults to false. This has no effect if the
mode <kbd>Crypt_GPG::SIGN_MODE_CLEAR</kbd> is
used as clear-signing always uses textmode.

@return string the signed data, or the signature data if a detached
signature is requested.

@throws Crypt_GPG_KeyNotFoundException if no signing key is specified.
See {@link Crypt_GPG::addSignKey()}.

@throws Crypt_GPG_BadPassphraseException if a specified passphrase is
incorrect or if a required passphrase is not specified.

@throws Crypt_GPG_Exception if an unknown or unexpected error occurs.
Use the <kbd>debug</kbd> option and file a bug report if these
exceptions occur.