Running SignatureExampleRSA

The CipherExampleAES sample application uses the Entrust implementation of RSA Signature to sign and verify data using an RSA key pair.

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

java -classpath classes;../lib/enttoolkit.jar com.entrust.toolkit.examples.crypto.CipherExampleAES [<key_size>]

Parameter

Value

​<key_size>

The key size in bits, as a multiple of 512. Selecting a large key size will cause the sample to run very long.

For example:

C:\etjava\examples>java -classpath classes;../lib/enttoolkit.jar com.entrust.toolkit.examples.crypto.SignatureExampleRSA 2048
 
Installing providers... DONE
 
Generating key pair... DONE
 
Signing data... DONE
input plaintext: 00:01:02:03:04:05:06:07:08:09
output signature: 81:A7:5A:83:D5:97:5C:99:04:21:BE:19:5E:BE:1B:47:01:D3:7C:CE:7C
:87:A9:C0:D6:06:AA:21:B7:D5:66:3C:98:8E:FD:63:79:6D:A7:DC:16:A7:CE:A8:EB:2A:BA:D
D:BF:43:49:DF:8D:C6:75:BE:67:2B:93:A7:91:F4:E3:5F:14:C8:FC:6C:84:09:9B:67:2E:E3:
A3:C3:FB:49:D2:EF:45:0B:5E:65:25:45:DD:10:86:98:31:F7:2E:DB:38:AF:59:46:A9:B2:1F
:FC:9F:0D:2F:E8:29:48:6D:33:A5:71:1C:0B:02:9E:1A:4F:DB:9A:2B:5C:6C:64:74:56:0F:B
7:5B:BD:A2:4C:ED:81:E0:8B:5E:14:95:28:42:EE:72:D8:98:EE:05:7F:9D:C6:B7:0A:56:28:
85:B1:54:93:B6:4C:85:45:B0:64:D8:01:05:4B:73:B1:EB:27:E5:21:78:8F:5D:20:AF:61:33
:52:55:C2:2C:24:EF:36:69:01:17:9B:00:EE:0F:12:55:12:20:2A:E0:54:58:75:A9:F2:E3:4
E:73:BA:D1:B9:28:49:58:60:E0:50:38:38:6E:D1:90:3C:76:DE:2B:7C:E6:82:CF:06:9E:97:
EB:9F:C3:09:04:50:DF:04:3F:7C:0B:FE:84:A3:1B:46:11:27:61:9C:2B:DC
 
Verifying signature against signed data... DONE
signature verified: true
 
Verifying signature against modified signed data... DONE
signature verified: false