CryptoSys PKI Pro Manual

X509_TextDump

Dumps details of an X.509 certificate (or a X.509 certificate revocation list (CRL) or a PKCS-10 certificate signing request (CSR)) to a text file.

VBA/VB6 Syntax

Public Declare Function X509_TextDump Lib "diCrPKI.dll" (ByVal strFileOut As String, ByVal strCertFile As String, ByVal nOptions As Long) As Long

nRet = X509_TextDump(strFileOut, strCertFile, nOptions)

C/C++ Syntax

long __stdcall X509_TextDump(const char *szFileOut, const char *szCertFile, long nOptions);

Parameters

szFileOut
[in] with the filename of text file to be created.
szCertFile
[in] with the filename of Certificate file (or base64 representation).
nOptions
[in] option flags:
PKI_X509_LATIN1 to try and convert UTF-8 attribute strings to Latin-1 (for display purposes).
PKI_X509_UTF8 to output attribute strings encoded in UTF-8 [New in v20.3]
PKI_X509_LDAP to output the distinguished name in LDAP string representation.
PKI_X509_DECIMAL to output the serial number in decimal format instead of hexadecimal.

Returns (VBA/C)

If successful, the return value is zero; otherwise it returns a nonzero error code.

.NET Equivalent

X509.TextDump Method

Python Equivalent

static X509.text_dump(outputfile, certfile, opts=0)

Remarks

The input file may be in binary BER/DER format or base64 PEM file format, or may be passed in base64 representation or as a PEM string. It produces a text file containing the basic details of an X.509 certificate, X.509 certificate revocation list (CRL) or PKCS-10 certificate signing request (CSR).

[New in v12.3] The notation [!] denotes a critical extension, e.g. Key Usage[!]:.

Example

Dim nRet As Long
Dim strInputFile As String
Dim strOutFile As String

strInputFile = "AliceRSASignByCarl.cer"
strOutFile = "dump-AliceRSASignByCarl.cer.txt"
Debug.Print "File=" & strInputFile
nRet = X509_TextDump(strOutFile, strInputFile, 0)
Debug.Print "X509_TextDump returns " & nRet

The above example produces a text file with the following contents:

X.509 CERTIFICATE
Version: 3
Serial Number:
  #x46346BC7800056BC11D36E2EC410B3B0
Issuer:
  CN=CarlRSA
Subject:
  CN=AliceRSA
Validity:
  NotBefore: 1999-09-19T01:08:47Z
  NotAfter:  2039-12-31T23:59:59Z
Subject Public Key Algorithm: rsaEncryption
  RSA key length: 1024 bits
  Modulus:
    E0 89 73 39 8D D8 F5 F5 E8 87 76 39 7F 4E B0 05 
    BB 53 83 DE 0F B7 AB DC 7D C7 75 29 0D 05 2E 6D 
    12 DF A6 86 26 D4 D2 6F AA 58 29 FC 97 EC FA 82 
    51 0F 30 80 BE B1 50 9E 46 44 F1 2C BB D8 32 CF 
    C6 68 6F 07 D9 B0 60 AC BE EE 34 09 6A 13 F5 F7 
    05 05 93 DF 5E BA 35 56 D9 61 FF 19 7F C9 81 E6 
    F8 6C EA 87 40 70 EF AC 6D 2C 74 9F 2D FA 55 3A 
    B9 99 77 02 A6 48 52 8C 4E F3 57 38 57 74 57 5F 
  Exponent:
    01 00 01 
X509v3 Extensions:
  Subject Type: End Entity
  Key Usage[!]:
    digitalSignature,nonRepudiation
  Authority Key Identifier:
    e9e09027ac78207a9ad34cf242374e22ae9e38bb
  Subject Key Identifier:
    77d2b4d1b74c8a8aa3ce459dceec3ca03ae3ff50
  Subject Alternative Name:
    RFC822 Name: AliceRSA@example.com
Signature Algorithm: sha1WithRSAEncryption
Signature Hash Algorithm: sha1
Signature Value:
  3E 70 47 A8 48 CC 13 58 8F CA 51 71 6B 4E 36 18 
  5D 04 7E 80 B1 8D 4D CC CA A3 8F CC 7D 56 C8 BC 
  CF 6E B3 1C 59 A9 20 AA 05 81 A8 4E 25 AD A7 70 
  14 75 2F F5 C7 9B D1 0E E9 63 D2 64 B7 C6 66 6E 
  73 21 54 DF F4 BA 25 5D 7D 49 D3 94 6B 22 36 74 
  73 B8 4A EC 2F 64 ED D3 3D D2 A7 42 C5 E8 37 8A 
  B4 DB 9F 67 E4 BD 9F F9 FE 74 EF EA F9 EE 63 6A 
  D8 3F 4B 25 09 B5 D8 1A 76 AE EB 9B DB 49 B0 22 
SHA-1 Thumbprint:
  b30c48855055c2e64ce3196492d4b83831a6b3cb
SHA-256 Thumbprint:
  10e79a9993c26a87f2109ec1e81e0ac3ada0ee1bac1fe57fd85450e2c7c2406b

See Also

X509_QueryCert ASN1_TextDump

[Contents] [Index]

[PREV: X509_SaveFileFromString...]   [Contents]   [Index]   
   [NEXT: X509_TextDumpToString...]

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-09-23T07:52:09Z.