>>> message = encodedMIMEText('Hi\nBye')
>>> signed = sign(message, signers=['pgp-mime@invalid.com'])
>>> signed.set_boundary('boundsep')
- >>> print(signed.as_string()) # doctest: +ELLIPSIS, +REPORT_UDIFF
+ >>> print(signed.as_string().replace(
+ ... 'micalg="pgp-sha1"; protocol="application/pgp-signature"',
+ ... 'protocol="application/pgp-signature"; micalg="pgp-sha1"'))
+ ... # doctest: +ELLIPSIS, +REPORT_UDIFF
Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha1"; boundary="boundsep"
MIME-Version: 1.0
Content-Disposition: inline
>>> message.attach(encodedMIMEText('Part B'))
>>> signed = sign(message, signers=['pgp-mime@invalid.com'])
>>> signed.set_boundary('boundsep')
- >>> print(signed.as_string()) # doctest: +ELLIPSIS, +REPORT_UDIFF
+ >>> print(signed.as_string().replace(
+ ... 'micalg="pgp-sha1"; protocol="application/pgp-signature"',
+ ... 'protocol="application/pgp-signature"; micalg="pgp-sha1"'))
+ ... # doctest: +ELLIPSIS, +REPORT_UDIFF
Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha1"; boundary="boundsep"
MIME-Version: 1.0
Content-Disposition: inline
>>> message['To'] = 'pgp-mime-test <pgp-mime@invalid.com>'
>>> encrypted = encrypt(message, always_trust=True)
>>> encrypted.set_boundary('boundsep')
- >>> print(encrypted.as_string()) # doctest: +ELLIPSIS, +REPORT_UDIFF
+ >>> print(encrypted.as_string().replace(
+ ... 'micalg="pgp-sha1"; protocol="application/pgp-encrypted"',
+ ... 'protocol="application/pgp-encrypted"; micalg="pgp-sha1"'))
+ ... # doctest: +ELLIPSIS, +REPORT_UDIFF
Content-Type: multipart/encrypted; protocol="application/pgp-encrypted"; micalg="pgp-sha1"; boundary="boundsep"
MIME-Version: 1.0
Content-Disposition: inline
>>> encrypted = encrypt(
... message, recipients=['pgp-mime@invalid.com'], always_trust=True)
>>> encrypted.set_boundary('boundsep')
- >>> print(encrypted.as_string()) # doctest: +ELLIPSIS, +REPORT_UDIFF
+ >>> print(encrypted.as_string().replace(
+ ... 'micalg="pgp-sha1"; protocol="application/pgp-encrypted"',
+ ... 'protocol="application/pgp-encrypted"; micalg="pgp-sha1"'))
+ ... # doctest: +ELLIPSIS, +REPORT_UDIFF
Content-Type: multipart/encrypted; protocol="application/pgp-encrypted"; micalg="pgp-sha1"; boundary="boundsep"
MIME-Version: 1.0
Content-Disposition: inline
>>> encrypted = sign_and_encrypt(
... message, signers=['pgp-mime@invalid.com'], always_trust=True)
>>> encrypted.set_boundary('boundsep')
- >>> print(encrypted.as_string()) # doctest: +ELLIPSIS, +REPORT_UDIFF
+ >>> print(encrypted.as_string().replace(
+ ... 'micalg="pgp-sha1"; protocol="application/pgp-encrypted"',
+ ... 'protocol="application/pgp-encrypted"; micalg="pgp-sha1"'))
+ ... # doctest: +ELLIPSIS, +REPORT_UDIFF
Content-Type: multipart/encrypted; protocol="application/pgp-encrypted"; micalg="pgp-sha1"; boundary="boundsep"
MIME-Version: 1.0
Content-Disposition: inline
... message, signers=['pgp-mime@invalid.com'],
... recipients=['pgp-mime@invalid.com'], always_trust=True)
>>> encrypted.set_boundary('boundsep')
- >>> print(encrypted.as_string()) # doctest: +ELLIPSIS, +REPORT_UDIFF
+ >>> print(encrypted.as_string().replace(
+ ... 'micalg="pgp-sha1"; protocol="application/pgp-encrypted"',
+ ... 'protocol="application/pgp-encrypted"; micalg="pgp-sha1"'))
+ ... # doctest: +ELLIPSIS, +REPORT_UDIFF
Content-Type: multipart/encrypted; protocol="application/pgp-encrypted"; micalg="pgp-sha1"; boundary="boundsep"
MIME-Version: 1.0
Content-Disposition: inline