FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=17006&edit=1

ID: 17006
Updated by: mike@silverorange.com
Reported By: mike at silverorange dot com
Summary: Add support for --textmode option of GnuPG
-Status: Assigned
+Status: Closed
Type: Feature/Change Request
Package: Crypt_GPG
Package Version: CVS
PHP Version: Irrelevant
Assigned To: gauthierm
Roadmap Versions:
New Comment:

-Status: Assigned
+Status: Closed
This bug has been fixed in SVN.

If this was a documentation problem, the fix will appear on
pear.php.net by the end of next Sunday (CET).

If this was a problem with the pear.php.net website, the change should
be live shortly.

Otherwise, the fix will appear in the package's next release.

Thank you for the report and for helping us make PEAR better.




Previous Comments:
------------------------------------------------------------------------

[2010-02-27 02:12:53] gauthierm

-Assigned To:
+Assigned To: gauthierm


------------------------------------------------------------------------

[2010-01-25 21:48:53] gauthierm

Thanks for the patch. The patch is now applied in SVN.

------------------------------------------------------------------------

[2010-01-23 09:53:39] joeyschulze

This patch (and feature request) allows to create digitally signed
mails. For mails --textmode has to be added to the commandline to cope
with CR/CRLF conversions. The attached patch is by Michael Gauthier and
me.

------------------------------------------------------------------------

[2010-01-23 09:49:10] joeyschulze

Added #patch
bug:17006;patch:crypt_gpg-textmode.patch;revision:1264240150;.

------------------------------------------------------------------------

[2010-01-17 21:53:51] gauthierm

Description:
------------
This will make it easier to implement pgp-signed mail.

Hi Michael!
Does the gpg --clearsign --armor option do the same thing
as --textmode?

No. --clearsign will return data enclosed in a GPG frame.

What is needed for signed MIME mail is a detached signature.
I can send you an example if you like.
If so, Crypt_GPG already supports such signatures as:

$gpg = new Crypt_GPG();
$gpg->addSignKey('foo@example.com', 'passphrase');
$gpg->sign('Foo bar', Crypt_GPG::SIGN_MODE_CLEAR, true);
If --textmode is different, does it make sense to allow it for other
methods that return PGP data as well (encryption and key
export)?

From the documentation the option seems to make sense when
signing data that could be text and not only binary data - such
as MIME containers, mail and stuff.

Here is what gpg(1) says about this option:

-t, --textmode

--no-textmode
Treat input files as text and store them in the
OpenPGP canoni-
cal text form with standard "CRLF" line endings. This
also sets
the necessary flags to inform the recipient that the
encrypted
or signed data is text and may need its line endings
converted
back to whatever the local system uses. This option
is useful
when communicating between two platforms that
have different
line ending conventions (UNIX-like to Mac, Mac to
Windows, etc).
--no-textmode disables this option, and is the
default.

If -t (but not --textmode) is used together with
armoring and
signing, this enables clearsigned messages. This
kludge is
needed for command-line compatibility with
command-line versions
of PGP; normally you would use --sign or --clearsign
to select
the type of the signature.

It doesn't seem to be useful for exporting keys. It could be
useful for encryption.
In SVN, you may notice there are also new methods for
encrypt+sign and
decrypt+verify. I'm still working on unit tests for those, but I'd like
to do a 1.1.x release soon.
That sounds good.

Regards,

Joey

------------------------------------------------------------------------

Search Discussions

  • Mike at Mar 1, 2010 at 10:51 am
    Edit report at http://pear.php.net/bugs/bug.php?id=17006&edit=1

    ID: 17006
    Updated by: mike@silverorange.com
    Reported By: mike at silverorange dot com
    Summary: Add support for --textmode option of GnuPG
    Status: Open
    Type: Feature/Change Request
    Package: Crypt_GPG
    Package Version: CVS
    PHP Version: Irrelevant
    -Assigned To:
    +Assigned To: gauthierm
    Roadmap Versions:
    New Comment:

    -Assigned To:
    +Assigned To: gauthierm



    Previous Comments:
    ------------------------------------------------------------------------

    [2010-01-25 21:48:53] gauthierm

    Thanks for the patch. The patch is now applied in SVN.

    ------------------------------------------------------------------------

    [2010-01-23 09:53:39] joeyschulze

    This patch (and feature request) allows to create digitally signed
    mails. For mails --textmode has to be added to the commandline to cope
    with CR/CRLF conversions. The attached patch is by Michael Gauthier and
    me.

    ------------------------------------------------------------------------

    [2010-01-23 09:49:10] joeyschulze

    Added #patch
    bug:17006;patch:crypt_gpg-textmode.patch;revision:1264240150;.

    ------------------------------------------------------------------------

    [2010-01-17 21:53:51] gauthierm

    Description:
    ------------
    This will make it easier to implement pgp-signed mail.

    Hi Michael!
    Does the gpg --clearsign --armor option do the same thing
    as --textmode?

    No. --clearsign will return data enclosed in a GPG frame.

    What is needed for signed MIME mail is a detached signature.
    I can send you an example if you like.
    If so, Crypt_GPG already supports such signatures as:

    $gpg = new Crypt_GPG();
    $gpg->addSignKey('foo@example.com', 'passphrase');
    $gpg->sign('Foo bar', Crypt_GPG::SIGN_MODE_CLEAR, true);
    If --textmode is different, does it make sense to allow it for other
    methods that return PGP data as well (encryption and key
    export)?

    From the documentation the option seems to make sense when
    signing data that could be text and not only binary data - such
    as MIME containers, mail and stuff.

    Here is what gpg(1) says about this option:

    -t, --textmode

    --no-textmode
    Treat input files as text and store them in the
    OpenPGP canoni-
    cal text form with standard "CRLF" line endings. This
    also sets
    the necessary flags to inform the recipient that the
    encrypted
    or signed data is text and may need its line endings
    converted
    back to whatever the local system uses. This option
    is useful
    when communicating between two platforms that
    have different
    line ending conventions (UNIX-like to Mac, Mac to
    Windows, etc).
    --no-textmode disables this option, and is the
    default.

    If -t (but not --textmode) is used together with
    armoring and
    signing, this enables clearsigned messages. This
    kludge is
    needed for command-line compatibility with
    command-line versions
    of PGP; normally you would use --sign or --clearsign
    to select
    the type of the signature.

    It doesn't seem to be useful for exporting keys. It could be
    useful for encryption.
    In SVN, you may notice there are also new methods for
    encrypt+sign and
    decrypt+verify. I'm still working on unit tests for those, but I'd like
    to do a 1.1.x release soon.
    That sounds good.

    Regards,

    Joey

    ------------------------------------------------------------------------

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedMar 1, '10 at 10:18a
activeMar 1, '10 at 10:51a
posts2
users1
websitepear.php.net

1 user in discussion

Mike: 2 posts

People

Translate

site design / logo © 2022 Grokbase