CryptoSys PKI Toolkit Manual
X509.GetCertFromP7Chain Method
Extracts 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
- index
- specifying which certificate (1,2,...) in the chain to extract, or 0 to return the count of certificates in the set
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. However, if
index is zero, it returns the count of certificates found in the list. If an error occurred, it returns a negative
error code.
Remarks
Refer to the manual for further information and remarks on the use of this function.
Examples (VB.NET)
See
Example1
See Also
VB6/C equivalent: X509_GetCertFromP7Chain
[Contents] [Index]