summaryrefslogtreecommitdiff
path: root/demo/smime
diff options
context:
space:
mode:
authoryan11.meng <yan11.meng@samsung.com>2020-02-26 12:47:07 +0900
committeryan11.meng <yan11.meng@samsung.com>2020-02-26 12:47:07 +0900
commit13ec6f74c73b377d6233de42cc942846e976541b (patch)
tree894efb8d5e53dd68dd463f7b222406439f4f494d /demo/smime
parent5015799de7fb1dc08b584c0044d8393e4062ff34 (diff)
downloadpython-M2Crypto-13ec6f74c73b377d6233de42cc942846e976541b.tar.gz
python-M2Crypto-13ec6f74c73b377d6233de42cc942846e976541b.tar.bz2
python-M2Crypto-13ec6f74c73b377d6233de42cc942846e976541b.zip
Imported Upstream version 0.35.1
Change-Id: Id4a444b8c1d11fee1026b433a47ca5aabcf11622
Diffstat (limited to 'demo/smime')
-rw-r--r--demo/smime/README54
-rw-r--r--demo/smime/ca.pem20
-rw-r--r--demo/smime/clear.p767
-rw-r--r--demo/smime/client.p12bin1604 -> 0 bytes
-rw-r--r--demo/smime/client.pem36
-rw-r--r--demo/smime/client2.pem36
-rw-r--r--demo/smime/m2.se.p784
-rw-r--r--demo/smime/ns.p753
-rw-r--r--demo/smime/ns.se.p775
-rw-r--r--demo/smime/opaque.p747
-rw-r--r--demo/smime/sendsmime.py82
-rw-r--r--demo/smime/test.py192
-rw-r--r--demo/smime/unsmime.py50
13 files changed, 0 insertions, 796 deletions
diff --git a/demo/smime/README b/demo/smime/README
deleted file mode 100644
index 736e632..0000000
--- a/demo/smime/README
+++ /dev/null
@@ -1,54 +0,0 @@
- 29 Nov 2000
--------------
-- test.py works.
-
-- makesmime.py is sendsmime.py modified to not send
- SMTP, because I do not now have an SMTP server handy.
-
-- sendsmime.py should still work, because makesmime.py
- does.
-
-- unsmime.py doesn't work, possibly because the certificates
- used to generate the tested PKCS7 objects are no longer
- available.
-
-
-
- 20 Nov 2000
--------------
-
-This directory contains various programs and supporting files
-demonstrating M2Crypto's S/MIME functionality.
-
-- test.py exercises the various S/MIME functionality.
-- sendsmime.py (optionally) signs and/or encrypts a message,
- then sends the output via SMTP.
-- makesmime.py is exactly like sendsmime.py, except it writes
- its output to sys.stdout.
-- unsmime.py decrypts and verifies an S/MIME SignedAndEnveloped
- message. It handles the S/MIME output of Netscape Messenger
- successfully.
-
-- ca.pem is M2Crypto's test CA certificate.
-- client.pem and client2.pem contain user certificates and their
- corresponding private keys.
-
-- clear.p7 is a clear-signed S/MIME message.
-- opaque.p7 is a signed S/MIME message.
-- ns.p7 is a clear-signed S/MIME message produced by Messenger.
-- ns.se.p7 is a signed-then-encrypted S/MIME message produced
- by Messenger.
-- m2.se.p7 is a signed-then-encrypted S/MIME message produced
- by sendsmime.py.
-
-
-I tested with export and strong versions of Netscape Communicator
-4.7x.
-
-I have also done some interoperability testing with Sampo Kellomaki's
-smime tool.
-
-I am interested in interoperability testing with Outlook and other
-S/MIME tools. Write me <ngps@post1.com> if you want to collaborate.
-
-
diff --git a/demo/smime/ca.pem b/demo/smime/ca.pem
deleted file mode 100644
index b7c84a1..0000000
--- a/demo/smime/ca.pem
+++ /dev/null
@@ -1,20 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDWTCCAsKgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBgDELMAkGA1UEBhMCU0cx
-ETAPBgNVBAoTCE0yQ3J5cHRvMRQwEgYDVQQLEwtNMkNyeXB0byBDQTEkMCIGA1UE
-AxMbTTJDcnlwdG8gQ2VydGlmaWNhdGUgTWFzdGVyMSIwIAYJKoZIhvcNAQkBFhNu
-Z3BzQG5ldG1lbWV0aWMuY29tMB4XDTAxMTIxNTA1NTU0NloXDTA0MTIxNDA1NTU0
-NlowgYAxCzAJBgNVBAYTAlNHMREwDwYDVQQKEwhNMkNyeXB0bzEUMBIGA1UECxML
-TTJDcnlwdG8gQ0ExJDAiBgNVBAMTG00yQ3J5cHRvIENlcnRpZmljYXRlIE1hc3Rl
-cjEiMCAGCSqGSIb3DQEJARYTbmdwc0BuZXRtZW1ldGljLmNvbTCBnzANBgkqhkiG
-9w0BAQEFAAOBjQAwgYkCgYEAx8soJbS719LHK62VVVIQeC3oW0HvFArwPnA0LuEK
-q+LaqMOJg1rS7hvFdX03diV+XJw7cC0iECZYJNG4ii1xbY6KRmufkInaAwm54E3N
-e+YYVocaqUkcN6xVf6fwnLfPXbpFS/K2Umg11ObKMmi80JmiIdjcjRRCQZC7g1hf
-q+kCAwEAAaOB4DCB3TAdBgNVHQ4EFgQU6/qcBzEtQphfXLhiOHbt2KqBwMIwga0G
-A1UdIwSBpTCBooAU6/qcBzEtQphfXLhiOHbt2KqBwMKhgYakgYMwgYAxCzAJBgNV
-BAYTAlNHMREwDwYDVQQKEwhNMkNyeXB0bzEUMBIGA1UECxMLTTJDcnlwdG8gQ0Ex
-JDAiBgNVBAMTG00yQ3J5cHRvIENlcnRpZmljYXRlIE1hc3RlcjEiMCAGCSqGSIb3
-DQEJARYTbmdwc0BuZXRtZW1ldGljLmNvbYIBADAMBgNVHRMEBTADAQH/MA0GCSqG
-SIb3DQEBBAUAA4GBAD+I14GuS5vJmyv1k7mUMbAicsWRHZ+zrGOq9L/L2LsA+lKQ
-dAzEZE2+Zv8LBPJVltbJJhcFNJS/ZMAjEm4xlJuCpvXVMxd/M5AM29aqekWlIK7J
-vsdDL8IuzpRkMniUiNKPhmB6IPIOslvUKx6QofcE0wDh6pg4VvIbCjkpZ7gf
------END CERTIFICATE-----
diff --git a/demo/smime/clear.p7 b/demo/smime/clear.p7
deleted file mode 100644
index c878407..0000000
--- a/demo/smime/clear.p7
+++ /dev/null
@@ -1,67 +0,0 @@
-To: ngps@post1.com
-From: ngps@post1.com
-Subject: testing
-MIME-Version: 1.0
-Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="----F0DD27AD8CDFF9AB55B87EE3A626E6D7"
-
-This is an S/MIME signed message
-
-------F0DD27AD8CDFF9AB55B87EE3A626E6D7
-
-S/MIME - Secure Multipurpose Internet Mail Extensions [RFC 2311, RFC 2312] -
-provides a consistent way to send and receive secure MIME data. Based on the
-popular Internet MIME standard, S/MIME provides the following cryptographic
-security services for electronic messaging applications - authentication,
-message integrity and non-repudiation of origin (using digital signatures)
-and privacy and data security (using encryption).
-
-S/MIME is built on the PKCS #7 standard. [PKCS7]
-
-S/MIME is implemented in Netscape Messenger and Microsoft Outlook.
-
-------F0DD27AD8CDFF9AB55B87EE3A626E6D7
-Content-Type: application/x-pkcs7-signature; name="smime.p7s"
-Content-Transfer-Encoding: base64
-Content-Disposition: attachment; filename="smime.p7s"
-
-MIIHHAYJKoZIhvcNAQcCoIIHDTCCBwkCAQExCzAJBgUrDgMCGgUAMIICQwYJKoZI
-hvcNAQcBoIICNASCAjANClMvTUlNRSAtIFNlY3VyZSBNdWx0aXB1cnBvc2UgSW50
-ZXJuZXQgTWFpbCBFeHRlbnNpb25zIFtSRkMgMjMxMSwgUkZDIDIzMTJdIC0gDQpw
-cm92aWRlcyBhIGNvbnNpc3RlbnQgd2F5IHRvIHNlbmQgYW5kIHJlY2VpdmUgc2Vj
-dXJlIE1JTUUgZGF0YS4gQmFzZWQgb24gdGhlDQpwb3B1bGFyIEludGVybmV0IE1J
-TUUgc3RhbmRhcmQsIFMvTUlNRSBwcm92aWRlcyB0aGUgZm9sbG93aW5nIGNyeXB0
-b2dyYXBoaWMNCnNlY3VyaXR5IHNlcnZpY2VzIGZvciBlbGVjdHJvbmljIG1lc3Nh
-Z2luZyBhcHBsaWNhdGlvbnMgLSBhdXRoZW50aWNhdGlvbiwNCm1lc3NhZ2UgaW50
-ZWdyaXR5IGFuZCBub24tcmVwdWRpYXRpb24gb2Ygb3JpZ2luICh1c2luZyBkaWdp
-dGFsIHNpZ25hdHVyZXMpDQphbmQgcHJpdmFjeSBhbmQgZGF0YSBzZWN1cml0eSAo
-dXNpbmcgZW5jcnlwdGlvbikuDQoNClMvTUlNRSBpcyBidWlsdCBvbiB0aGUgUEtD
-UyAjNyBzdGFuZGFyZC4gW1BLQ1M3XQ0KDQpTL01JTUUgaXMgaW1wbGVt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EAJCYs+3
-w/lspCMJC0hOomxnt0vjyCCd0JeaEwihQGbOo9V0reXzrUy8yNkwo1w8mMSbIvqh
-+D5uTB0jKL/ml1EVLw3NJf68MYIBmjCCAZYCAQEwgYAwezELMAkGA1UEBhMCU0cx
-ETAPBgNVBAoTCE0yQ3J5cHRvMRQwEgYDVQQLEwtNMkNyeXB0byBDQTEkMCIGA1UE
-AxMbTTJDcnlwdG8gQ2VydGlmaWNhdGUgTWFzdGVyMR0wGwYJKoZIhvcNAQkBFg5u
-Z3BzQHBvc3QxLmNvbQIBAjAJBgUrDgMCGgUAoIGxMBgGCSqGSIb3DQEJAzELBgkq
-hkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTAyMTIwODE3NTIyMVowIwYJKoZIhvcN
-AQkEMRYEFI/KcwJXhIg0bRzYLfAtDhxRMzghMFIGCSqGSIb3DQEJDzFFMEMwCgYI
-KoZIhvcNAwcwDgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsOAwIH
-MA0GCCqGSIb3DQMCAgEoMA0GCSqGSIb3DQEBAQUABEBrhZ8JVqGZ+S7dh+xKDwbF
-yRXiOQWEa2uxD1O5fD02VfGEzDSrV1sPdQ8AcM3o+ny5AyC11E4Fns2cIkXwZEwz
-
-------F0DD27AD8CDFF9AB55B87EE3A626E6D7--
-
diff --git a/demo/smime/client.p12 b/demo/smime/client.p12
deleted file mode 100644
index b7b985a..0000000
--- a/demo/smime/client.p12
+++ /dev/null
Binary files differ
diff --git a/demo/smime/client.pem b/demo/smime/client.pem
deleted file mode 100644
index 0eeeefb..0000000
--- a/demo/smime/client.pem
+++ /dev/null
@@ -1,36 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDDDCCAnWgAwIBAgIBAjANBgkqhkiG9w0BAQQFADB7MQswCQYDVQQGEwJTRzER
-MA8GA1UEChMITTJDcnlwdG8xFDASBgNVBAsTC00yQ3J5cHRvIENBMSQwIgYDVQQD
-ExtNMkNyeXB0byB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Y7j/zcCAwEAAQJAUkHlWZmSUZMNf5nOpMkM
-hZ5E1v2Wjy4UFgRGDcTXbZm401Avwrc8006qQxQjoH94pVkwPYjEyAMubhusMFt4
-AQIhANeB4qzW/YsABYpt66x1ByiuUJE1p+QMLngeESJbc989AiEAweoMtXsNRJi4
-1xBzlKB9zljQfESYIt59SctURPfX/4MCICS9kwyOdplM/qTUCprTNM49saSf9iiN
-3xpBXgBygPWtAiEAmoIeDEB26vBxX1OJdKSIeXFE9a9GNYpn8/OiOq3smncCIGIg
-Hj9MtdZ/1uPk7jx5oZVfzN1DM7GYZHAeYeYhVR13
------END RSA PRIVATE KEY-----
------BEGIN CERTIFICATE REQUEST-----
-MIIBEzCBvgIBADBZMQswCQYDVQQGEwJTRzERMA8GA1UEChMITTJDcnlwdG8xGDAW
-BgNVBAMTD00yQ3J5cHRvIENsaWVudDEdMBsGCSqGSIb3DQEJARYObmdwc0Bwb3N0
-MS5jb20wXDANBgkqhkiG9w0BAQEFAANLADBIAkEAoz3zUF0dmxSU+1fso+eTdmjD
-Y71gWNeXWX28qsBJ0UFmq4JCtw7Gv4fJ0TZgQHVIrXgKrUvzsquu8eiVjuP/NwID
-AQABoAAwDQYJKoZIhvcNAQEEBQADQQAQho0UsOhmuUUhJrx7uXIEbo984OrOVpa6
-giAU7socmyjCzJvihmr/Nnqub+Md7rkSfDytGDN6CianGL5MROjr
------END CERTIFICATE REQUEST-----
diff --git a/demo/smime/client2.pem b/demo/smime/client2.pem
deleted file mode 100644
index 166919a..0000000
--- a/demo/smime/client2.pem
+++ /dev/null
@@ -1,36 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDDjCCAnegAwIBAgIBAzANBgkqhkiG9w0BAQQFADB7MQswCQYDVQQGEwJTRzER
-MA8GA1UEChMITTJDcnlwdG8xFDASBgNVBAsTC00yQ3J5cHRvIENBMSQwIgYDVQQD
-ExtNMkNyeXB0byBDZXJ0aWZpY2F0ZSBNYXN0ZXIxHTAbBgkqhkiG9w0BCQ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2IcW510e0laI0uwBj50djfHqvsU5ccuVLrxowngLGrFmM3G4lnMknR2NvH8
-0QIhAMsK0AwStUNM/KyvIMikHHBOE9PrK7ARgKvlKl+0ieWPAiEAyYwonIVAtr1f
-M8vmrc6TM2YxzSq4+jyYktaaNhYw11kCIA5pmhMBUPSSBm2LkNwtKgeewzGLw/If
-i+6nubZJbnBpAiEAvJQvy4PCsTkvQr+d7zJB+O2920IGId1gxMOXNtQ8jsECIGvn
-Uz54oonshmTg+Kj2DxnUKQEzFAmQLbtFslp1m47v
------END RSA PRIVATE KEY-----
------BEGIN CERTIFICATE REQUEST-----
-MIIBFTCBwAIBADBbMQswCQYDVQQGEwJTRzERMA8GA1UEChMITTJDcnlwdG8xGjAY
-BgNVBAMTEU0yQ3J5cHRvIENsaWVudCAyMR0wGwYJKoZIhvcNAQkBFg5uZ3BzQHBv
-c3QxLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQCf2qd5FhMo+iSZ7ehuIlrY
-1PPVnaRwXc0dWHrRCh39NX+riiU+tl0VHZMNa3rcuCfKByyB/e72meFwQaToi+e3
-AgMBAAGgADANBgkqhkiG9w0BAQQFAANBAHI5KXfL6kIRoNjR8G9/uKiPUt4uVBKF
-ecGp87M5t2a92Z0KpWOMXSHZ0LLQKqwWzALvWcPPIj6S8F6ENdwpfMk=
------END CERTIFICATE REQUEST-----
diff --git a/demo/smime/m2.se.p7 b/demo/smime/m2.se.p7
deleted file mode 100644
index 3a5bb1b..0000000
--- a/demo/smime/m2.se.p7
+++ /dev/null
@@ -1,84 +0,0 @@
-MIME-Version: 1.0
-Content-Disposition: attachment; filename="smime.p7m"
-Content-Type: application/x-pkcs7-mime; name="smime.p7m"
-Content-Transfer-Encoding: base64
-
-MIAGCSqGSIb3DQEHA6CAMIIOBwIBADGCAVkwggFVAgEAMIG9MIG3MQswCQYDVQQG
-EwJTRzEvMC0GA1UEChMmRmFzdCBTZWN1cmUgQ2hlYXAgQ2VydGlmaWNhdGVzIF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GupfGXz+fZysu3nFJ1oO86vMOFG/UU9
-24+jbRWklu0fyXZfeNzdY6arTLOX5Gpc9PRNZILoFHGyB2M9ZmMYz3hSNzY8acpk
-XDi+2ycHYeWFGxGCLio9Lc2H6IOMqJTTCpUduWvBX4tfysanUNjOuKJ3FWKWLxda
-IX1jJbPjvrQ3bg/NU/MqliLwFiMA1WkJd/paeK//J2tcOIMyhc40sigu4z65VoJ5
-AsMHlvh1dcfjz645NOx6JOpwdd04hoOxlMDtRTE/b8yjwaV2EVqXnI5WkNwCQESU
-ayIJiQqDfn35EFY8Wkmt7f6YGkpqoBDJkyNadsrcd2YVz9paAhgcM3XjC7zPi8AH
-g9UiTQiowRLcvnxkHK0LxelsQTE+ENL0rwYCt+qHBBJlcLVZhDF+qAchv+G5hmxp
-CClPyvbzOsx7ykcvItE2fpBWJu27l48dFxFviOKY7ecvJlpcTAX83N79k0aJpOC+
-TEPMdMZjIeGn004FiVj9Mo1899e2IlOlNdmj8Mv/jW4sFKpJ8m5fHv8i/ax7W33D
-0GNMrEghOH1w+QAAAAA=
-
-
-
diff --git a/demo/smime/ns.p7 b/demo/smime/ns.p7
deleted file mode 100644
index d2ab1ac..0000000
--- a/demo/smime/ns.p7
+++ /dev/null
@@ -1,53 +0,0 @@
-From: Ng Pheng Siong <ngps@post1.com>
-X-Mailer: Mozilla 4.5 [en] (WinNT; I)
-X-Accept-Language: en
-MIME-Version: 1.0
-To: ngps@post1.com
-Subject: S/MIME signing
-Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="------------msD996346BF03A805B450DC20D"
-
-This is a cryptographically signed message in MIME format.
-
---------------msD996346BF03A805B450DC20D
-Content-Type: text/plain; charset=us-ascii
-Content-Transfer-Encoding: 7bit
-
-smime -vs- pgp
-war over?
---------------msD996346BF03A805B450DC20D
-Content-Type: application/x-pkcs7-signature; name="smime.p7s"
-Content-Transfer-Encoding: base64
-Content-Disposition: attachment; filename="smime.p7s"
-Content-Description: S/MIME C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346BF03A805B450DC20D--
-
diff --git a/demo/smime/ns.se.p7 b/demo/smime/ns.se.p7
deleted file mode 100644
index a7a75f5..0000000
--- a/demo/smime/ns.se.p7
+++ /dev/null
@@ -1,75 +0,0 @@
-MIME-Version: 1.0
-Content-Type: application/x-pkcs7-mime; name="smime.p7m"
-Content-Transfer-Encoding: base64
-Content-Disposition: attachment; filename="smime.p7m"
-Content-Description: S/MIME Encrypted Message
-
-MIAGCSqGSIb3DQEHA6CAMIACAQAxggKyMIIBVQIBADCBvTCBtzELMAkGA1UEBhMCU0cxLzAt
-BgNVBAoTJkZhc3QgU2VjdXJlIENoZWFwIENlcnRpZmljYXRlcyBQdGUgTHRkMTIwMAYDVQQL
-EylGYXN0IFNlY3VyZSBDaGVhcCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEkMCIGA1UEAxMb
-RmFzdCBTZWN1cmUgQ2hlYXAgS2V5TWFzdGVyMR0wGwYJKoZIhvcNAQkBFg5uZ3BzQHBvc3Qx
-LmNvbQIBAzANBgkqhkiG9w0BAQEFAASBgERIsZhX2nmvB4kOtcfqUpuWjK9njs8YixtPSS4w
-ugmAx3LhBMTgY1OlsbKi7etVPwEU2jSqgkwCHPeYeOQt6M9aQ66tcue7/fWjfMBfZ+tetwOb
-kpqlw//GyjhkJx2QBGPuw3Ye84ll1KA7x/CGxmk8g0YBHoLo9Xy1W1XHVUanMIIBVQIBADCB
-vTCBtzELMAkGA1UEBhMCU0cxLzAtBgNVBAoTJkZhc3QgU2VjdXJlIENoZWFwIENlcnRpZmlj
-YXRlcyBQdGUgTHRkMTIwMAYDVQQLEylGYXN0IFNlY3VyZSBDaGVhcCBDZXJ0aWZpY2F0aW9u
-IEF1dGhvcml0eTEkMCIGA1UEAxMbRmFzdCBTZWN1cmUgQ2hlYXAgS2V5TWFzdGVyMR0wGwYJ
-KoZIhvcNAQkBFg5uZ3BzQHBvc3QxLmNvbQIBBzANBgkqhkiG9w0BAQEFAASBgKFEdyFcaj2z
-7LB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dgsC3+9/jYECG3bevzH5HiDBBBHiuTo8yYJ
-1FFJ/y4nIIXaBDC92swMrVUYZUpoNUjf02DsBiVP53Fon+CnKnEQ8gBCncIkb8DBnlZYeZd2
-XISBWmEECNOMqXZKxL2vBBDDg2nHASKLEobcHqmPoIQFBBhcrb6prkWNKColNlf5ss49ocnK
-68UgsNEECNJJEPZOUMW1BBApQ6CzF2t+QiJTdQwoApPzBBg8ZCeSHgypK9CWcWb2iMWiFuKc
-KUmIuskECFr2TQ/U6cWbBAisYHDp2/w4kgQISMieG/GdQlAEEGLN6GdGVz2wf1Hx93PJ4VsE
-EJRdLeaU3FsCwXEICvSKZPMEEIcEdqQkAhmsxfNoKA90QlUECDdUY0tvC48sBBBNOevphvxS
-0dwE2Lzf6gLGBAjoSuhhSYuZBAQIRKWk1TxshoAECFUuzdHGuR3zBBjlvJQjSDrEPqg7unh2
-ZaNy11cUKB07vPMECIbZbuiAcb81BBCyb6N/Aymqo24VwyE9/lTDBCCR0Sn7D8OfmpwUp0MJ
-zEdp+4eTPVu9W6bNj5cTwcG0VQQI9Z1/nYjZ93cECCZ7u+8p0rP8BAg6S5MaaL8mTQQIMt+W
-TF2XgOMEQLOZQ0FOc4oD9mBoXzN/NDmlEz0QWnZPnO/7OhVcuKPi6rtE+5RfdGDL/qxWGU6G
-0qvFT0zTodnwjpzKnYAnoeMEUDPxz4djUsMXhHzpye9vc7N2/B8QUBubRaFPp/FoLv3jjwga
-+AawOtkkW1uLku0m6zdN7YYzXTsKlMhwDd3nZS4Vm/v11AnFChiDC2LFmLw0BCC/X36boypP
-pTObDByKlN6IldnnPEi4tl/6Cxr2+28LWgQohCdg9nl3s5COEnwQW+ggcvKodHHK9SdVRscS
-J4ykS0lWZ0ns4/g6/wQIKIXduWxdKJMAAAAAAAAAAAAA
-
diff --git a/demo/smime/opaque.p7 b/demo/smime/opaque.p7
deleted file mode 100644
index a242446..0000000
--- a/demo/smime/opaque.p7
+++ /dev/null
@@ -1,47 +0,0 @@
-To: ngps@post1.com
-From: ngps@mpost1.com
-Subject: testing
-MIME-Version: 1.0
-Content-Disposition: attachment; filename="smime.p7m"
-Content-Type: application/x-pkcs7-mime; name="smime.p7m"
-Content-Transfer-Encoding: base64
-
-MIIHHAYJKoZIhvcNAQcCoIIHDTCCBwkCAQExCzAJBgUrDgMCGgUAMIICQwYJKoZI
-hvcNAQcBoIICNASCAjANClMvTUlNRSAtIFNlY3VyZSBNdWx0aXB1cnBvc2UgSW50
-ZXJuZXQgTWFpbCBFeHRlbnNpb25zIFtSRkMgMjMxMSwgUkZDIDIzMTJdIC0gDQpw
-cm92aWRlcyBhIGNvbnNpc3RlbnQgd2F5IHRvIHNlbmQgYW5kIHJlY2VpdmUgc2Vj
-dXJlIE1JTUUgZGF0YS4gQmFzZWQgb24gdGhlDQpwb3B1bGFyIEludGVybmV0IE1J
-TUUgc3RhbmRhcmQsIFMvTUlNRSBwcm92aWRlcyB0aGUgZm9sbG93aW5nIGNyeXB0
-b2dyYXBoaWMNCnNlY3VyaXR5IHNlcnZpY2VzIGZvciBlbGVjdHJvbmljIG1lc3Nh
-Z2luZyBhcHBsaWNhdGlvbnMgLSBhdXRoZW50aWNhdGlvbiwNCm1lc3NhZ2UgaW50
-ZWdyaXR5IGFuZCBub24tcmVwdWRpYXRpb24gb2Ygb3JpZ2luICh1c2luZyBkaWdp
-dGFsIHNpZ25hdHVyZXMpDQphbmQgcHJpdmFjeSBhbmQgZGF0YSBzZWN1cml0eSAo
-dXNpbmcgZW5jcnlwdGlvbikuDQoNClMvTUlNRSBpcyBidWlsdCBvbiB0aGUgUEtD
-UyAjNyBzdGFuZGFyZC4gW1BLQ1M3XQ0KDQpTL01JTUUgaXMgaW1wbGVtZW50ZWQg
-aW4gTmV0c2NhcGUgTWVzc2VuZ2VyIGFuZCBNaWNyb3NvZnQgT3V0bG9vay4NCqCC
-AxAwggMMMIICdaADAgECAgECMA0GCSqGSIb3DQEBBAUAMHsxCzAJBgNVBAYTAlNH
-MREwDwYD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AoTCE0yQ3J5cHRvMRQwEgYDVQQLEwtNMkNyeXB0byBDQTEkMCIGA1UE
-AxMbTTJDcnlwdG8gQ2VydGlmaWNhdGUgTWFzdGVyMR0wGwYJKoZIhvcNAQkBFg5u
-Z3BzQHBvc3QxLmNvbQIBAjAJBgUrDgMCGgUAoIGxMBgGCSqGSIb3DQEJAzELBgkq
-hkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTAyMTIwODE3NTIyMVowIwYJKoZIhvcN
-AQkEMRYEFI/KcwJXhIg0bRzYLfAtDhxRMzghMFIGCSqGSIb3DQEJDzFFMEMwCgYI
-KoZIhvcNAwcwDgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsOAwIH
-MA0GCCqGSIb3DQMCAgEoMA0GCSqGSIb3DQEBAQUABEBrhZ8JVqGZ+S7dh+xKDwbF
-yRXiOQWEa2uxD1O5fD02VfGEzDSrV1sPdQ8AcM3o+ny5AyC11E4Fns2cIkXwZEwz
-
diff --git a/demo/smime/sendsmime.py b/demo/smime/sendsmime.py
deleted file mode 100644
index 9cc446b..0000000
--- a/demo/smime/sendsmime.py
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/usr/bin/env python
-
-"""S/MIME sender.
-
-Copyright (c) 2000 Ng Pheng Siong. All rights reserved."""
-
-from M2Crypto import BIO, Rand, SMIME, X509
-import smtplib, string, sys
-
-def sendsmime(from_addr, to_addrs, subject, msg, from_key, from_cert=None, to_certs=None, smtpd='localhost'):
-
- msg_bio = BIO.MemoryBuffer(msg)
- sign = from_key
- encrypt = to_certs
-
- s = SMIME.SMIME()
- if sign:
- s.load_key(from_key, from_cert)
- p7 = s.sign(msg_bio, flags=SMIME.PKCS7_TEXT)
- msg_bio = BIO.MemoryBuffer(msg) # Recreate coz sign() has consumed it.
-
- if encrypt:
- sk = X509.X509_Stack()
- for x in to_certs:
- sk.push(X509.load_cert(x))
- s.set_x509_stack(sk)
- s.set_cipher(SMIME.Cipher('rc2_40_cbc'))
- tmp_bio = BIO.MemoryBuffer()
- if sign:
- s.write(tmp_bio, p7)
- else:
- tmp_bio.write(msg)
- p7 = s.encrypt(tmp_bio)
-
- out = BIO.MemoryBuffer()
- out.write('From: %s\r\n' % from_addr)
- out.write('To: %s\r\n' % string.join(to_addrs, ", "))
- out.write('Subject: %s\r\n' % subject)
- if encrypt:
- s.write(out, p7)
- else:
- if sign:
- s.write(out, p7, msg_bio, SMIME.PKCS7_TEXT)
- else:
- out.write('\r\n')
- out.write(msg)
- out.close()
-
- smtp = smtplib.SMTP()
- smtp.connect(smtpd)
- smtp.sendmail(from_addr, to_addrs, out.read())
- smtp.quit()
-
- # XXX Cleanup the stack and store.
-
-
-msg = """
-S/MIME - Secure Multipurpose Internet Mail Extensions [RFC 2311, RFC 2312] -
-provides a consistent way to send and receive secure MIME data. Based on the
-popular Internet MIME standard, S/MIME provides the following cryptographic
-security services for electronic messaging applications - authentication,
-message integrity and non-repudiation of origin (using digital signatures)
-and privacy and data security (using encryption).
-
-S/MIME is built on the PKCS #7 standard. [PKCS7]
-
-S/MIME is implemented in Netscape Messenger and Microsoft Outlook.
-"""
-
-
-if __name__ == '__main__':
- Rand.load_file('../randpool.dat', -1)
- sendsmime(from_addr = 'ngps@post1.com',
- to_addrs = ['jerry','ngps@post1.com'],
- subject = 'S/MIME testing',
- msg = msg,
- from_key = 'client2.pem',
- #from_key = None,
- #to_certs = None)
- to_certs = ['client.pem'])
- Rand.save_file('../randpool.dat')
-
diff --git a/demo/smime/test.py b/demo/smime/test.py
deleted file mode 100644
index a59cf9f..0000000
--- a/demo/smime/test.py
+++ /dev/null
@@ -1,192 +0,0 @@
-#!/usr/bin/env python
-
-"""S/MIME demo.
-
-Copyright (c) 2000 Ng Pheng Siong. All rights reserved."""
-
-from M2Crypto import BIO, Rand, SMIME, X509
-
-ptxt = """
-S/MIME - Secure Multipurpose Internet Mail Extensions [RFC 2311, RFC 2312] -
-provides a consistent way to send and receive secure MIME data. Based on the
-popular Internet MIME standard, S/MIME provides the following cryptographic
-security services for electronic messaging applications - authentication,
-message integrity and non-repudiation of origin (using digital signatures)
-and privacy and data security (using encryption).
-
-S/MIME is built on the PKCS #7 standard. [PKCS7]
-
-S/MIME is implemented in Netscape Messenger and Microsoft Outlook.
-"""
-
-def makebuf():
- buf = BIO.MemoryBuffer(ptxt)
- return buf
-
-def sign():
- print 'test sign & save...',
- buf = makebuf()
- s = SMIME.SMIME()
- s.load_key('client.pem')
- p7 = s.sign(buf)
- out = BIO.openfile('clear.p7', 'w')
- out.write('To: ngps@post1.com\n')
- out.write('From: ngps@post1.com\n')
- out.write('Subject: testing\n')
- buf = makebuf() # Recreate buf, because sign() has consumed it.
- s.write(out, p7, buf)
- out.close()
-
- buf = makebuf()
- p7 = s.sign(buf)
- out = BIO.openfile('opaque.p7', 'w')
- out.write('To: ngps@post1.com\n')
- out.write('From: ngps@mpost1.com\n')
- out.write('Subject: testing\n')
- s.write(out, p7)
- out.close()
- print 'ok'
-
-def verify_clear():
- print 'test load & verify clear...',
- s = SMIME.SMIME()
- x509 = X509.load_cert('client.pem')
- sk = X509.X509_Stack()
- sk.push(x509)
- s.set_x509_stack(sk)
- st = X509.X509_Store()
- st.load_info('ca.pem')
- s.set_x509_store(st)
- p7, data = SMIME.smime_load_pkcs7('clear.p7')
- v = s.verify(p7)
- if v:
- print 'ok'
- else:
- print 'not ok'
-
-def verify_opaque():
- print 'test load & verify opaque...',
- s = SMIME.SMIME()
- x509 = X509.load_cert('client.pem')
- sk = X509.X509_Stack()
- sk.push(x509)
- s.set_x509_stack(sk)
- st = X509.X509_Store()
- st.load_info('ca.pem')
- s.set_x509_store(st)
- p7, data = SMIME.smime_load_pkcs7('opaque.p7')
- v = s.verify(p7, data)
- if v:
- print 'ok'
- else:
- print 'not ok'
-
-def verify_netscape():
- print 'test load & verify netscape messager output...',
- s = SMIME.SMIME()
- #x509 = X509.load_cert('client.pem')
- sk = X509.X509_Stack()
- #sk.push(x509)
- s.set_x509_stack(sk)
- st = X509.X509_Store()
- st.load_info('ca.pem')
- s.set_x509_store(st)
- p7, data = SMIME.smime_load_pkcs7('ns.p7')
- v = s.verify(p7, data)
- print '\n', v, '\n...ok'
-
-
-def sv():
- print 'test sign/verify...',
- buf = makebuf()
- s = SMIME.SMIME()
-
- # Load a private key.
- s.load_key('client.pem')
-
- # Sign.
- p7 = s.sign(buf)
-
- # Output the stuff.
- bio = BIO.MemoryBuffer()
- s.write(bio, p7, buf)
-
- # Plumbing for verification: CA's cert.
- st = X509.X509_Store()
- st.load_info('ca.pem')
- s.set_x509_store(st)
-
- # Plumbing for verification: Signer's cert.
- x509 = X509.load_cert('client.pem')
- sk = X509.X509_Stack()
- sk.push(x509)
- s.set_x509_stack(sk)
-
- # Verify.
- p7, buf = SMIME.smime_load_pkcs7_bio(bio)
- v = s.verify(p7, flags=SMIME.PKCS7_DETACHED)
-
- if v:
- print 'ok'
- else:
- print 'not ok'
-
-def ed():
- print 'test encrypt/decrypt...',
- buf = makebuf()
- s = SMIME.SMIME()
-
- # Load target cert to encrypt to.
- x509 = X509.load_cert('client.pem')
- sk = X509.X509_Stack()
- sk.push(x509)
- s.set_x509_stack(sk)
-
- # Add a cipher.
- s.set_cipher(SMIME.Cipher('bf_cbc'))
-
- # Encrypt.
- p7 = s.encrypt(buf)
-
- # Load target's private key.
- s.load_key('client.pem')
-
- # Decrypt.
- data = s.decrypt(p7)
-
- if data:
- print 'ok'
- else:
- print 'not ok'
-
-
-def zope_test():
- print 'test zophistry...'
- f = open('client.pem')
- cert_str = f.read()
- key_bio = BIO.MemoryBuffer(cert_str)
- cert_bio = BIO.MemoryBuffer(cert_str) # XXX Kludge.
- s = SMIME.SMIME()
- s.load_key_bio(key_bio, cert_bio)
- # XXX unfinished...
-
-
-def leak_test():
- # Seems ok, not leaking.
- while 1:
- ed()
- #sv()
-
-
-if __name__ == '__main__':
- Rand.load_file('../randpool.dat', -1)
- ed()
- sign()
- verify_opaque()
- verify_clear()
- #verify_netscape()
- sv()
- #zope_test()
- #leak_test()
- Rand.save_file('../randpool.dat')
-
diff --git a/demo/smime/unsmime.py b/demo/smime/unsmime.py
deleted file mode 100644
index ffc40ad..0000000
--- a/demo/smime/unsmime.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env python
-
-"""S/MIME demo.
-
-Copyright (c) 2000 Ng Pheng Siong. All rights reserved."""
-
-from M2Crypto import BIO, Rand, SMIME, X509
-import sys
-
-def decrypt_verify(p7file, recip_key, signer_cert, ca_cert):
- s = SMIME.SMIME()
-
- # Load decryption private key.
- s.load_key(recip_key)
-
- # Extract PKCS#7 blob from input.
- p7, bio = SMIME.smime_load_pkcs7_bio(p7file)
-
- # Decrypt.
- data = s.decrypt(p7)
-
- # Because we passed in a SignAndEnveloped blob, the output
- # of our decryption is a Signed blob. We now verify it.
-
- # Load the signer's cert.
- sk = X509.X509_Stack()
- s.set_x509_stack(sk)
-
- # Load the CA cert.
- st = X509.X509_Store()
- st.load_info(ca_cert)
- s.set_x509_store(st)
-
- # Verify.
- p7, bio = SMIME.smime_load_pkcs7_bio(BIO.MemoryBuffer(data))
- if bio is not None:
- # Netscape Messenger clear-signs, when also encrypting.
- data = s.verify(p7, bio)
- else:
- # M2Crypto's sendsmime.py opaque-signs, when also encrypting.
- data = s.verify(p7)
-
- print data
-
-
-if __name__ == '__main__':
- Rand.load_file('../randpool.dat', -1)
- decrypt_verify(BIO.File(sys.stdin), 'client.pem', 'client2.pem','ca.pem')
- Rand.save_file('../randpool.dat')
-