CryptoSys PKI Pro Manual

X509.GetCertFromP7Chain Method

Extract an X.509 certificate from a PKCS-7 "certs-only" certificate chain file, saving the output directly as a new file.

Syntax

[C#]
public static int GetCertFromP7Chain(
	string outputFile,
	string inputFile,
	int index
)
[VB.NET]
Public Shared Function GetCertFromP7Chain ( _
	outputFile As String, _
	inputFile As String, _
	index As Integer _
) As Integer

Parameters

outputFile
Name of output file to be created
inputFile
Name of the PKCS-7 "certs-only" file, or a string containing its PEM textual representation.
index
specifying which certificate (1,2,...) in the chain to extract.

Return Value

If successful and index is greater than zero, it returns the number of bytes written to the output file, which may be zero if no certificate could be found at the given index. If an error occurred, it returns a negative error code.

Remarks

[New in v12.2] To find the number of certificates in the chain, use GetCertCountInP7Chain. The old (deprecated) way to find the count of certificates was to set index to zero.

See Also

VB6/C equivalent: X509_GetCertFromP7Chain

[Contents] [Index]

[PREV: X509.GetCertCountInP7Chain Method...]   [Contents]   [Index]   
   [NEXT: X509.GetCertFromPFX Method...]

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