CryptoSys PKI Pro Manual

SMIME_Extract

Extract the body from an S/MIME entity.

VBA/VB6 Syntax

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

nRet = SMIME_Extract(strFileOut, strFileOut, nOptions)

C/C++ Syntax

long __stdcall SMIME_Extract(const char *szFileOut, const char *szFileIn, long nOptions);

Parameters

szFileOut
[in] string specifying the filename of the output file to be created.
szFileIn
[in] string specifying the filename of the input file.
nOptions
[in] Zero (0) for defaults.
PKI_SMIME_ENCODE_BASE64 to encode the output in base64 encoding (default is binary).

Returns (VBA/C)

A positive number giving the size of the output file in bytes; or a negative error code.

.NET Equivalent

Smime.Extract Method

C++ (STL) Equivalent

static int dipki::Smime::Extract (const std::string &outputFile, const std::string &inputFile, Encoding encoding=Encoding::Default)

Python Equivalent

static Smime.extract(outputfile, inputfile, opts=0)

Remarks

This is designed to extract the body from an S/MIME entity with a content type of application/pkcs7-mime with base64 or binary transfer encoding. In practice, it will extract the body from almost any type of S/MIME (or MIME) file, except one with quoted-printable transfer encoding.

Example

nRet = SMIME_Extract("cmsalice2bob-extracted.p7m", "cmsalice2bob-smime-env.txt", 0)

In this example, the input S/MIME file cmsalice2bob-smime-env.txt was created from a CMS enveloped-data file using SMIME_Wrap. The output should be a binary file identical to the original binary CMS file.

See Also

SMIME_Wrap

[Contents] [Index]

[PREV: SIG_VerifyFile...]   [Contents]   [Index]   
   [NEXT: SMIME_Query...]

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