Sample code for 30+ languages & platforms
Tcl

Load CMS PKCS#7 Certificate (.p7b)

See more Certificates Examples

Loads a digital certificate from a Cryptographic Message Syntax Standard PKCS7 (.p7b) file and fetches information about the cert.

Chilkat Tcl Downloads

Tcl

load ./chilkat.dll

set success 0

set cert [new_CkCert]

# LoadFromFile will load virtually any certificate format file.
# It will auto-recognize the format and load appropiately.

set success [CkCert_LoadFromFile $cert "/Users/chilkat/testData/cer/chilkat.p7b"]
if {$success != 1} then {
    puts [CkCert_lastErrorText $cert]
    delete_CkCert $cert
    exit
}

# DN = "Distinguished Name"
puts "SubjectDN:[CkCert_subjectDN $cert]"

puts "Common Name:[CkCert_subjectCN $cert]"
puts "Issuer Common Name:[CkCert_issuerCN $cert]"

puts "Serial Number:[CkCert_serialNumber $cert]"

delete_CkCert $cert