summaryrefslogtreecommitdiff
path: root/tests/sample-p7.pem
blob: 46034f0970b27d680d2172b9ccf91ef9f7dafde8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
MIME-Version: 1.0
Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha-256"; boundary="----38FBD2321B4A76C8BE88AFD029CDED23"

This is an S/MIME signed message

------38FBD2321B4A76C8BE88AFD029CDED23
This directory contains unit tests for M2Crypto.

To run all tests, make sure you have installed setuptools and then issue the
following command from the M2Crypto root directory:

python setup.py test

To run tests in a single file, for example test_ssl.py, do this:

python setup.py test --test-suite=tests.test_ssl


Look also in the demo directory for other samples.


To create new test certificates:

mkdir certs
cd certs

Making the CA. You may want to use a locally edited openssl.cnf to
make sure that X509v3 Basic Constraints CA:TRUE gets set (by default
it may be false). By default duration may only be just one year; should
set this for at least 3 years.

CA.sh -newca
cp demoCA/cacert.pem ../ca.pem

Making the server certificate and private key. make sure commonName
field is localhost.

CA.sh -newreq
CA.sh -signreq
cp newcert.pem ../server.pem
openssl rsa <newkey.pem >>../server.pem

Making the x509 certificate and key.

CA.sh -newreq
CA.sh -signreq
cp newcert.pem ../x509.pem
openssl rsa <newkey.pem >>../x509.pem
openssl x509 -in ../x509.pem -out ../x509.der -outform DER

Making the signer certificate. Make sure the email address is 
signer@example.com.

CA.sh -newreq
CA.sh -signreq
cp newcert.pem ../signer.pem
openssl rsa <newkey.pem >../signer_key.pem

Making the recipient certificate. Make sure the email address is 
recipient@example.com.

CA.sh -newreq
CA.sh -signreq
cp newcert.pem ../recipient.pem
openssl rsa <newkey.pem >../recipient_key.pem


Finally run the tests and edit for new values.

------38FBD2321B4A76C8BE88AFD029CDED23
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"

MIIEhQYJKoZIhvcNAQcCoIIEdjCCBHICAQExDzANBglghkgBZQMEAgEFADALBgkq
hkiG9w0BBwGgggJkMIICYDCCAcmgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBPMQsw
CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8GA1UEChMITTJDcnlw
dG8xGDAWBgNVBAMTD0hlaWtraSBUb2l2b25lbjAeFw0xNTExMjYyMTMzMTJaFw0y
NTExMjMyMTMzMTJaMG8xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlh
MREwDwYDVQQKEwhNMkNyeXB0bzESMBAGA1UEAxMJUmVjaXBpZW50MSQwIgYJKoZI
hvcNAQkBFhVyZWNpcGllbnRAZXhhbXBsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQAD
gY0AMIGJAoGBAJaMhIx8GBrTwmJdDwilmD2LkUw0b80Vr1Ycffk2pgE8nGPPIGT6
dySl4cv+j1rAqJAbmaMCakPv+TGseQH5zEYRfKrRh9+V1PGkesv8TC6LMyL1M/hT
augiSBiW8kk5/zOZA+U9wiJS8TOWILzRyCG7S3U9Kz1RTqoP1XNdZkS/AgMBAAGj
LDAqMAkGA1UdEwQCMAAwHQYDVR0OBBYEFFON3U+KXkkZq9wvnavqx8PK9vXUMA0G
CSqGSIb3DQEBBQUAA4GBABCx3TS7lz4+2ODeapnJvoy3gMcdMNs6aNWk2QJ2K3Zi
AIYwWgYDZZK5AKRClF90xpRELowHVfPBbnoKF2ZW71Cvo1/x95dmKdO0FBM0eZaY
rVjbIOb8+nCsHCKQv3vD6uOKCr26SP/lyVCDGNkeYTDAx2zqM/7Q/Kga8Zuj3JEQ
MYIB5TCCAeECAQEwVDBPMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZv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