Running EnumCertificates

The EnumCertificates sample application accesses certificates stored in Microsoft CryptoAPI.

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

java -classpath classes;<path to enttoolkit.jar> com.entrust.toolkit.examples.capi.EnumCertificates [<container>]

Parameter

Value

<container>

The identifier of a key container. If this optional parameter is omitted, the sample application lists the certificates in all the Microsoft CryptoAPI containers.

For example:

The output below only shows the first two certificates of over 100 found.

C:\etjava\examples>java -classpath classes;..\lib\enttoolkit.jar com.entrust.toolkit.examples.capi.EnumCertificates Root
 
Listing certificates for certificate store 'Root'
Details of certificate 1
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: d2007e92bea0e55636020a3e3275cb98d0f5d95113948d854bfe88826f000593f813e
f9d8f2d7ee1e3b25c078a768db290fd02c6d02b71ef836a0ece63a94e1044d0abecaedb4b331c6
3d0bbec74792f54234c9b6a431370cf39a3213a66c284b2b2745f899ccdc4a5d2d29dd61d1d8f8
1193b38b45c8073be52a40fda5571521106922f7a8355a7f036e0d7b9d16f9004354a35e0e994b
662d114975b2cef4bb1d4cf00d04b3a96acf170d399a9419cffc046517e8fe83a1842c93de82ed
edff1028b69606edd03443ec43d32168dad959993e73549169fde2998a90a0088cd7ac98af8e28
fd2ca0b23da2acfdda3d31c38c13eb2a38f1943697787d4c30c69
 
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
 
-------------------------------------------------------
Details of certificate 2
Version: 3
Serial number: 161735313838342892179587228130098753125
Signature algorithm: sha1WithRSAEncryption
Issuer: cn=Microsoft Root Certificate Authority,dc=microsoft,dc=com
Valid not before: Wed May 09 19:19:22 EDT 2001
not after: Sun May 09 19:28:13 EDT 2021
Subject: cn=Microsoft Root Certificate Authority,dc=microsoft,dc=com
public exponent: 10001
modulus: f35dfa8067d45aa7a90c2c9020d035083c7584cdb707899c89dadecec360fa91685a
9e94712918767cc2e0c82576940e58fa043436e6dfaff780bae9580b2b93e59d05e3772291f73
4643c22911d5ee10990bc14fefc755819e179b70792a3ae885908d89f07ca0358fc68296d32d7
d2a8cb4bfce10b48324fe6ebb8ad4fe45c6f139499db95d575dba81ab79491b4775bf5480c8f6
a797d1470047d6daf90f5da70d847b7bf9b2f6ce705b7e11160ac7991147cc5d6a6e4e17ed5c3
7ee592d23c00b53682de79e16df3b56ef89f33c9cb527d739836db8ba16ba295979ba3dec24d2
6ff0696672506c8e7ace4ee1233953199c835084e34ca7953d5b5be6332594036c0a54e044d3d
db5b0733e458bfef3f5364d842593557fd0f457c24044d9ed6387411972290ce684474926fd54
b6fb086e3c73642a0d0fcc1c05af9a361b9304771960a16b091c04295ef107f286ae32a1fb1e4
cd033f777104c720fc490f1d4588a4d7cb7e88ad8e2dec45dbc45104c92afcec869e9a11975bd
ece5388e6e2b7fdac95c22840dbef0490df813339d9b245a5238706a5558931bb062d600e4118
7d1f2eb597cb11eb15d524a594ef151489fd4b73fa325bfcd13300f95962700732ea2eab402d7
bcadd21671b30998f16aa23a841d1b06e119b36c4de40749ce15865c1601e7a5b38c88fbb0426
7cd41640e5b66b6caa86fd00bfcec135
 
Extension 1: critical BasicConstraints
CA: yes
 
Extension 2: not critical 1.3.6.1.4.1.311.21.1
UnknownExtension: OBJECT ID = 1.3.6.1.4.1.311.21.1
INTEGER = 0
 
 
Extension 3: not critical KeyUsage
digitalSignature | nonRepudiation | keyCertSign | cRLSign
 
Extension 4: not critical SubjectKeyIdentifier
0E:AC:82:60:40:56:27:97:E5:25:13:FC:2A:E1:0A:53:95:59:E4:A4
 
Certificate Fingerprint: E1:C0:7E:A0:AA:BB:D4:B7:7B:84:C2:28:11:78:08:A7