Running SMimeSend for S/MIME v3

The SMimeSend sample application for S/MIME v3 sends the following S/MIME messages to a single recipient.

  • Plain messages.

  • Implicitly signed messages.

  • Messages encrypted with the following algorithms:

    • AlgorithmID.rc2_CBC, 40

    • AlgorithmID.rc2_CBC, 64

    • AlgorithmID.rc2_CBC, 128

    • AlgorithmID.des_CBC, 128

    • AlgorithmID.des_EDE3_CBC, 128

  • Implicitly signed and encrypted messages with attachment.

  • Certificate request.

  • application/pkcs10 messages with the request as the second part.

To run this sample application, execute the following command line in the etjava/examples directory.

java -classpath ../lib/enttoolkit.jar;<jakarta.mail.jar>;<jakarta.activation.jar>;[<other-mail-providers>] com.entrust.toolkit.examples.smimev3.SMimeSend

Parameter

Value

<jakarta.mail.jar>

<dependency>
<groupId>jakarta.mail</groupId>
<artifactId>jakarta.mail-api</artifactId>
<version>2.0.1</version>
</dependency>

<jakarta.activation.jar>

<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>jakarta.activation</artifactId>
<version>2.0.1</version>
</dependency>

<other-mail-providers>

<dependency>
<groupId>org.eclipse.angus</groupId>
<artifactId>angus-mail</artifactId>
<version>2.0.3</version>
</dependency>
<dependency>
<groupId>org.eclipse.angus</groupId>
<artifactId>angus-activation</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>org.eclipse.angus</groupId>
<artifactId>pop3</artifactId>
<version>2.0.3</version>
</dependency>

For example:

c:\etjava\examples>java -classpath classes;..\lib\enttoolkit.jar;c:\java\lib\mail.jar;c:\java\lib\pop3.jar;c:\java\lib\activation.jar;c:\java\lib\angus-mail.jar com.entrust.toolkit.examples.smimev3.SMimeSend
 
File Entrust.ini is missing: Entrust.ini (The system cannot find the file specif
ied)Working offline, using certificate file data/userdata/RSAUser2Encryption.cer as
recipient
Recipient's Certificate trusted!
Algorithm :RSA
Version: 3
Serial number: 1064926582
Signature algorithm: sha1WithRSAEncryption
Issuer: ou=PKI7,o=Java Toolkit Samples,c=CA
Valid not before: Wed Oct 01 10:52:20 EDT 2003
not after: Wed Oct 01 11:22:20 EDT 2008
Subject: cn=RSA User1,ou=PKI7,o=Java Toolkit Samples,c=CA
public exponent: 10001
modulus: d11a844dfab25ab9fbbcc9876e291c9c3460f812c5fb8c4d4e780633890c0199dea5b5f
31cb784f9e11894757a6837c76eaa1ef9bc516aa6ea6a1518ca8aa078b3d18cd06173377fcacb4ce
902126866be0209d0fd26636b7152cf66b19ef325512821390f22879d8ffc826fe007aa8194c2f65
51ea9e2d003dc8d00a0a19f7f
 
Extension 1: not critical AuthorityKeyIdentifier
KeyIdentifier: 57:71:8E:26:B1:5D:87:4F:77:9A:4D:0D:58:EF:F5:5B:8B:5D:D7:C7
 
Extension 2: not critical EntrustVersInfo
version: V7.0 00001101
 
Extension 3: not critical CRLDistributionPoints
DistributionPoint: directoryName: cn=CRL1,ou=PKI7,o=Java Toolkit Samples,c=CA
 
Extension 4: not critical BasicConstraints
CA: no
 
Extension 5: not critical PrivateKeyUsagePeriod
not before: Wed Oct 01 10:52:20 EDT 2003
not after : Mon Apr 02 08:22:20 EDT 2007
 
Extension 6: not critical KeyUsage
digitalSignature
 
Extension 7: not critical SubjectKeyIdentifier
3A:4D:A9:E2:FD:E0:BB:3C:E6:9C:00:8B:3A:1E:74:1E:FE:AC:85:19
 
Certificate Fingerprint: 54:8B:03:08:AF:E4:8F:91:A4:9D:4A:EF:6F:08:1E:7F
 
Version: 3
Serial number: 1064926513
Signature algorithm: sha1WithRSAEncryption
Issuer: ou=PKI7,o=Java Toolkit Samples,c=CA
Valid not before: Tue Sep 30 08:25:18 EDT 2003
not after: Sat Sep 30 08:55:18 EDT 2023
Subject: ou=PKI7,o=Java Toolkit Samples,c=CA
public exponent: 10001
modulus: d2007e92bea0e55636020a3e3275cb98d0f5d95113948d854bfe88826f000593f813ef9
d8f2d7ee1e3b25c078a768db290fd02c6d02b71ef836a0ece63a94e1044d0abecaedb4b331c63d0b
bec74792f54234c9b6a431370cf39a3213a66c284b2b2745f899ccdc4a5d2d29dd61d1d8f81193b3
8b45c8073be52a40fda5571521106922f7a8355a7f036e0d7b9d16f9004354a35e0e994b662d1149
75b2cef4bb1d4cf00d04b3a96acf170d399a9419cffc046517e8fe83a1842c93de82ededff1028b6
9606edd03443ec43d32168dad959993e73549169fde2998a90a0088cd7ac98af8e28fd2ca0b23da2
acfdda3d31c38c13eb2a38f1943697787d4c30c69
 
Extension 1: not critical AuthorityKeyIdentifier
KeyIdentifier: 57:71:8E:26:B1:5D:87:4F:77:9A:4D:0D:58:EF:F5:5B:8B:5D:D7:C7
 
Extension 2: not critical EntrustVersInfo
version: V7.0:4.0 00001001
 
Extension 3: not critical CRLDistributionPoints
DistributionPoint: directoryName: cn=CRL1,ou=PKI7,o=Java Toolkit Samples,c=CA
 
Extension 4: not critical BasicConstraints
CA: yes
 
Extension 5: not critical PrivateKeyUsagePeriod
not before: Tue Sep 30 08:25:18 EDT 2003
not after : Sat Sep 30 08:55:18 EDT 2023
 
Extension 6: not critical KeyUsage
keyCertSign | cRLSign
 
Extension 7: not critical SubjectKeyIdentifier
57:71:8E:26:B1:5D:87:4F:77:9A:4D:0D:58:EF:F5:5B:8B:5D:D7:C7
 
Certificate Fingerprint: 8D:16:98:C8:E3:8E:B9:D9:F1:21:B7:9A:15:08:BF:B0
 
Version: 3
Serial number: 1064926586
Signature algorithm: sha1WithRSAEncryption
Issuer: ou=PKI7,o=Java Toolkit Samples,c=CA
Valid not before: Wed Oct 01 10:54:25 EDT 2003
not after: Wed Oct 01 11:24:25 EDT 2008
Subject: cn=RSA User2,ou=PKI7,o=Java Toolkit Samples,c=CA
public exponent: 10001
modulus: af6c5c6cd0e1c7895c622fb958d5cb4d89e01baa13d95a5081216023e1d7fc4bf7b4cdb
71539f0d436d40cf277c3eb3e7ea397818ff38fac0718cc0d7482b06b61b8b5a6c81cbc895bab038
b72bfd822aed99c85daf7eb9870f130d26f655bea2e29a60700197a628a45e59f45a03a32954b5b6
7b6bf5a42d3da7fb80ee20ffd
 
Extension 1: not critical AuthorityKeyIdentifier
KeyIdentifier: 57:71:8E:26:B1:5D:87:4F:77:9A:4D:0D:58:EF:F5:5B:8B:5D:D7:C7
 
Extension 2: not critical EntrustVersInfo
version: V7.0 00001101
 
Extension 3: not critical CRLDistributionPoints
DistributionPoint: directoryName: cn=CRL1,ou=PKI7,o=Java Toolkit Samples,c=CA
 
Extension 4: not critical BasicConstraints
CA: no
 
Extension 5: not critical KeyUsage
keyEncipherment
 
Extension 6: not critical SubjectKeyIdentifier
04:67:03:52:FA:FE:AD:1B:32:DE:58:45:84:A2:47:A0:DB:D2:9A:94
 
Certificate Fingerprint: 08:60:50:37:A0:60:F1:B3:00:01:7F:57:69:4C:13:4B
 
Version: 3
Serial number: 1064926583
Signature algorithm: sha1WithRSAEncryption
Issuer: ou=PKI7,o=Java Toolkit Samples,c=CA
Valid not before: Wed Oct 01 10:52:20 EDT 2003
not after: Wed Oct 01 11:22:20 EDT 2008
Subject: cn=RSA User1,ou=PKI7,o=Java Toolkit Samples,c=CA
public exponent: 10001
modulus: b267ff25e83a54447a31b1c8048347bb8d9786bbac08c87a1c624b35d98e2f3c7db4f5b
e08291b8268001b8d56a6b5fcb845afa334eca7103cd5c5e563fb964f005a54a3ae3cdca1c452dff
d1c9b3a31d38fdacf5ae503dfe0636570b7cc056f3f56de48abd59a259df3d51865a442a8018ac09
1adb6617ad046850ec228eb17
 
Extension 1: not critical AuthorityKeyIdentifier
KeyIdentifier: 57:71:8E:26:B1:5D:87:4F:77:9A:4D:0D:58:EF:F5:5B:8B:5D:D7:C7
 
Extension 2: not critical EntrustVersInfo
version: V7.0 00001101
 
Extension 3: not critical CRLDistributionPoints
DistributionPoint: directoryName: cn=CRL1,ou=PKI7,o=Java Toolkit Samples,c=CA
 
Extension 4: not critical BasicConstraints
CA: no
 
Extension 5: not critical KeyUsage
keyEncipherment
 
Extension 6: not critical SubjectKeyIdentifier
5F:EE:6E:7A:37:F4:53:BD:B8:2C:9D:44:75:BE:23:39:8D:31:EB:52
 
Certificate Fingerprint: 87:30:47:95:31:D7:E8:53:3D:25:47:FD:F9:B0:8F:C4
sending plain message...
sending plain message compressed...
sending explicitly signed message...
sending explicitly signed message compressed...
sending implicitly signed message...
sending implicitly signed message compressed...
sending encrypted message [RC2/40]...
sending encrypted message [RC2/40] compressed...
sending encrypted message [RC2/64]...
sending encrypted message [RC2/64] compressed...
sending encrypted message [RC2/128]...
sending encrypted message [RC2/128] compressed...
sending encrypted message [TripleDES]...
sending encrypted message [TripleDES] compressed...
sending implicitly signed and encrypted message [RC2/40]...
sending implicitly signed and encrypted message [RC2/40] compressed...
sending explicitly signed and encrypted message [RC2/40]...
sending explicitly signed and encrypted message [RC2/40] compressed...
sending certs-only message
sending certs-only message compressed...
sending message with certs-only part
sending message with certs-only part compressed...
sending application/pkcs10 message...
sending application/pkcs10 message compressed...
sending message with pkcs10 part...
sending message with pkcs10 part compressed...
sending compressed message...
sending signed and compressed data with sample alg_null compression
sending signed and compressed data with zlib_compression compression
sending signed and compressed message using different wrapped example...
sending signed and encrypted message using different wrapped example...
sending signed and encrypted message using different wrapped example...
sending signed, encrypted and compressed message using different wrapped example...
sending encrypted, signed and compressed message using different wrapped example...
sending compressed, encrypted, compressed, signed and compressed message using different wrapped example...
OK!
 
Hit the <RETURN> key.