SignDoc SDK (C++)  5.0.0
SignDocDocumentLoader Class Reference

Create SignDocDocument objects. More...

#include <SignDocSDK-cpp.h>

Public Types

enum  RemainingDays { rd_product, rd_signing }
 Specify which expiry date shall be used by getRemainingDays(). More...
 
enum  Flags { f_map_into_memory = 0x01 }
 Flags for setFlags(). More...
 

Public Member Functions

 SignDocDocumentLoader ()
 Constructor. More...
 
 ~SignDocDocumentLoader ()
 Destructor. More...
 
ReturnCode loadFromMemory (const unsigned char *aData, size_t aSize, bool aCopy, std::unique_ptr< SignDocDocument > &aOutput)
 Load a document from memory. More...
 
ReturnCode loadFromFile (Encoding aEncoding, const char *aPath, bool aWritable, std::unique_ptr< SignDocDocument > &aOutput)
 Load a document from a file. More...
 
ReturnCode loadFromFile (const wchar_t *aPath, bool aWritable, std::unique_ptr< SignDocDocument > &aOutput)
 Load a document from a file. More...
 
ReturnCode createPDF (int aMajor, int aMinor, std::unique_ptr< SignDocDocument > &aOutput)
 Create an empty PDF document. More...
 
ReturnCode createPDFA (int aMajor, int aMinor, const char *aConformance, const unsigned char *aICCPtr, size_t aICCSize, std::unique_ptr< SignDocDocument > &aOutput)
 Create an empty PDF/A document. More...
 
SignDocDocument::DocumentType ping (InputStream &aStream)
 Determine the type of a document. More...
 
SignDocDocument::DocumentType ping (const unsigned char *aPtr, size_t aSize)
 Determine the type of a document. More...
 
bool loadFontConfigFile (Encoding aEncoding, const char *aPath)
 Load font configuration from a file. More...
 
bool loadFontConfigFile (const wchar_t *aPath)
 Load font configuration from a file. More...
 
bool loadFontConfigEnvironment (const char *aName)
 Load font configuration from files specified by an environment variable. More...
 
bool loadFontConfigStream (InputStream &aStream, Encoding aEncoding, const char *aDirectory)
 Load font configuration from a stream. More...
 
bool loadFontConfigStream (InputStream &aStream, const wchar_t *aDirectory)
 Load font configuration from a stream. More...
 
bool loadFontConfigBlob (const unsigned char *aPtr, size_t aSize, Encoding aEncoding, const char *aDirectory)
 Load font configuration from a blob. More...
 
bool loadFontConfigBlob (const unsigned char *aPtr, size_t aSize, const wchar_t *aDirectory)
 Load font configuration from a blob. More...
 
bool loadPdfFontConfigFile (Encoding aEncoding, const char *aPath)
 Load font configuration for rendering PDF documents from a file. More...
 
bool loadPdfFontConfigFile (const wchar_t *aPath)
 Load font configuration for rendering PDF documents from a file. More...
 
bool loadPdfFontConfigEnvironment (const char *aName)
 Load font configuration for rendering PDF documents from files specified by an environment variable. More...
 
bool loadPdfFontConfigStream (InputStream &aStream, Encoding aEncoding, const char *aDirectory)
 Load font configuration for rendering PDF documents from a stream. More...
 
bool loadPdfFontConfigStream (InputStream &aStream, const wchar_t *aDirectory)
 Load font configuration for rendering PDF documents from a stream. More...
 
bool loadPdfFontConfigBlob (const unsigned char *aPtr, size_t aSize, Encoding aEncoding, const char *aDirectory)
 Load font configuration for rendering PDF documents from a blob. More...
 
bool loadPdfFontConfigBlob (const unsigned char *aPtr, size_t aSize, const wchar_t *aDirectory)
 Load font configuration for rendering PDF documents from a blob. More...
 
void getFailedFontFiles (std::vector< std::string > &aOutput)
 Get the pathnames of font files that failed to load for the most recent loadFontConfig*() or loadPdfFontConfig*() call. More...
 
bool loadTrustedCertificatesFromFile (Encoding aEncoding, const char *aPath)
 Load trusted root CA certifcates from a file. More...
 
bool loadTrustedCertificatesFromFile (const wchar_t *aPath)
 Load trusted root CA certifcates from a file. More...
 
bool loadTrustedCertificatesFromStream (InputStream &aStream)
 Load trusted root CA certifcates from a stream. More...
 
bool loadTrustedCertificatesFromMemory (const unsigned char *aPtr, size_t aSize)
 Load trusted root CA certifcates from a blob. More...
 
bool initLogging (Encoding aEncoding, const char *aLevel, const char *aPathname)
 Initialize logging. More...
 
const char * getErrorMessage (Encoding aEncoding) const
 Get an error message for the last load*(), ping(), or initLogging() call. More...
 
const wchar_t * getErrorMessageW () const
 Get an error message for the last load*(), ping(), or initLogging() call. More...
 
bool registerDocumentHandler (SignDocDocumentHandler *aHandler)
 Register a document handler. More...
 
void setFlags (unsigned aFlags)
 Set flags modifying the behavior of this SignDocDocumentLoader object and of the SignDocDocument objects created by it. More...
 
 SignDocDocumentLoader (SIGNDOC_DocumentLoader *aP)
 Internal function. More...
 
SIGNDOC_DocumentLoader * getImpl ()
 Internal function. More...
 
const SIGNDOC_DocumentLoader * getImpl () const
 Internal function. More...
 
void setImpl (SIGNDOC_DocumentLoader *aP)
 Internal function. More...
 

Static Public Member Functions

static bool setLicenseKey (const void *aKeyPtr, size_t aKeySize, const char *aProduct, const char *aVersion, const void *aTokenPtr, size_t aTokenSize)
 Initialize license management with license key. More...
 
static bool generateLicenseToken (const char *aProduct, std::vector< unsigned char > &aOutput)
 Generate a license token for other SDKs also covered by the license key passed to setLicenseKey(). More...
 
static int getRemainingDays (RemainingDays aWhat)
 Get the number of days until the license will expire. More...
 
static bool getVersionNumber (std::string &aVersion)
 Get the version number of SignDocShared or SignDoc SDK. More...
 
static bool getComponentVersionNumber (const char *aComponent, std::string &aVersion)
 Get the version number of a SignDoc SDK component. More...
 
static int getLicenseTextCount ()
 Get the number of license texts. More...
 
static const char * getLicenseText (int aIndex)
 Get a license text. More...
 

Detailed Description

Create SignDocDocument objects.

Use getErrorMessage() to get more information after a function call failed.

As the error message is stored in this object, each thread should have its own instance of SignDocDocumentLoader or synchronization should be used.

Unless you need differently configured SignDocDocumentLoader objects, you should have only one SignDocDocumentLoader object per process (but see above). Loading font configuration files can be expensive, in particular if many fonts have to be scanned.

To be able to load documents, you have to register at least one document handler by passing a pointer to a SignDocDocumentHandler object to registerDocumentHandler().

Member Enumeration Documentation

enum Flags

Flags for setFlags().

Enumerator
f_map_into_memory 

Map input files into memory.

If this flag is set, loadFromFile() and other functions will try to map their input file into memory. Doing that may improve performance (on Android, in particular) but read errors and truncating the file will crash the process.

This flag is just a hint and may be ignored.

Specify which expiry date shall be used by getRemainingDays().

Enumerator
rd_product 

Use the expiry date for the product.

rd_signing 

Use the expiry date for signing documents.

Constructor & Destructor Documentation

Constructor.

~SignDocDocumentLoader ( )
inline

Destructor.

SignDocDocumentLoader ( SIGNDOC_DocumentLoader *  aP)
inline

Internal function.

Member Function Documentation

ReturnCode createPDF ( int  aMajor,
int  aMinor,
std::unique_ptr< SignDocDocument > &  aOutput 
)
inline

Create an empty PDF document.

The PDF document is invalid until you add at least one page.

Parameters
[in]aMajorMajor PDF version, must be 1 or 2.
[in]aMinorMinor PDF version, must be 0 through 7 (if aMajor is 1) or 0 (if aMajor is 2).
[out]aOutputA pointer to a new SignDocDocument object representing the document will be stored here. The caller is responsible for destroying the object.
Returns
rc_ok iff successful.
See also
getErrorMessage()
ReturnCode createPDFA ( int  aMajor,
int  aMinor,
const char *  aConformance,
const unsigned char *  aICCPtr,
size_t  aICCSize,
std::unique_ptr< SignDocDocument > &  aOutput 
)
inline

Create an empty PDF/A document.

The PDF document is invalid until you add at least one page.

Parameters
[in]aMajorMajor PDF version, must be 1.
[in]aMinorMinor PDF version, must be 0 through 7.
[in]aConformancePDF/A conformance. The string pointed to by this argument must consist of two characters:
  • A digit (1 through 3) specifying the part of PDF/A the document shall conform to.
  • A letter ('A' or 'B' if the digit is '1', 'A', 'B', or 'U' of the digit is '2' or '3') specifying the PDF/A conformance.
For instance, use "2B" for PDF/A-2b.
[in]aICCPtrA pointer to the first octet of the ICC profile of the PDF/A output intent or nullptr if no output intent shall be added to the document.
[in]aICCSizeNumber of octets pointed to by aICCPtr or 0 if aICCPtr is nullptr.
[out]aOutputA pointer to a new SignDocDocument object representing the document will be stored here. The caller is responsible for destroying the object.
Returns
rc_ok iff successful.
See also
getErrorMessage()
bool generateLicenseToken ( const char *  aProduct,
std::vector< unsigned char > &  aOutput 
)
inlinestatic

Generate a license token for other SDKs also covered by the license key passed to setLicenseKey().

Parameters
[in]aProductThe name of the product which shall be able to use the license key without providing a product version.
[out]aOutputThe token will be stored here.
Returns
true if successful, false on error.
See also
setLicenseKey()
bool getComponentVersionNumber ( const char *  aComponent,
std::string &  aVersion 
)
inlinestatic

Get the version number of a SignDoc SDK component.

Parameters
[in]aComponentThe component. Currently supported are "sppdf", "splm2", and "spooc".
[out]aVersionThe version number will be stored here. It consists of 3 or 4 integers separated by dots, .e.g., "1.9.27".
Returns
true if successful, false on error.
See also
getVersionNumber()
const char * getErrorMessage ( Encoding  aEncoding) const
inline

Get an error message for the last load*(), ping(), or initLogging() call.

Parameters
[in]aEncodingThe encoding to be used for the error message.
Returns
A pointer to a string describing the reason for the failure of the last call of load*(), ping() or initLogging(). The string is empty if the last call succeeded. The pointer is valid until this object is destroyed or a member function of this object is called.
See also
getErrorMessageW(), loadFontConfigBlob(), loadFontConfigEnvironment(), loadFontConfigFile(), loadFontConfigStream(), loadFontConfigStream(), loadFromFile(), loadFromMemory(), loadPdfFontConfigBlob(), loadPdfFontConfigEnvironment(), loadPdfFontConfigFile(), loadPdfFontConfigStream(), ping()
const wchar_t * getErrorMessageW ( ) const
inline

Get an error message for the last load*(), ping(), or initLogging() call.

Returns
A pointer to a string describing the reason for the failure of the last call of load*(), ping() or initLogging(). The string is empty if the last call succeeded. The pointer is valid until this object is destroyed or a member function of this object is called.
See also
getErrorMessage(), loadFontConfigBlob(), loadFontConfigEnvironment(), loadFontConfigFile(), loadFontConfigStream(), loadFontConfigStream(), loadFromFile(), loadFromMemory(), loadPdfFontConfigBlob(), loadPdfFontConfigEnvironment(), loadPdfFontConfigFile(), loadPdfFontConfigStream(), ping()
void getFailedFontFiles ( std::vector< std::string > &  aOutput)
inline

Get the pathnames of font files that failed to load for the most recent loadFontConfig*() or loadPdfFontConfig*() call.

This includes files that could not be found and files that could not be loaded. In the former case, the pathname may contain wildcard characters.

Note that loadFontConfig*() and loadPdfFontConfig() no longer fail if a specified font file cannot be found or loaded.

Parameters
[out]aOutputThe pathnames will be stored here.
See also
loadFontConfigEnvironment(), loadFontConfigBlob(), loadFontConfigFile(), loadFontConfigStream(), loadPdfFontConfigBlob(), loadPdfFontConfigEnvironment(), loadPdfFontConfigFile(), loadPdfFontConfigStream()
SIGNDOC_DocumentLoader* getImpl ( )
inline

Internal function.

const SIGNDOC_DocumentLoader* getImpl ( ) const
inline

Internal function.

const char * getLicenseText ( int  aIndex)
inlinestatic

Get a license text.

SignDoc SDK includes several Open Source components. You can retrieve the license texts one by one.

Parameters
[in]aIndexThe zero-based index of the license text.
Returns
A pointer to the null-terminated license text. Lines are terminated by LF characters. If aIndex is invalid, nullptr will be returned.
See also
getLicenseTextCount()
int getLicenseTextCount ( )
inlinestatic

Get the number of license texts.

SignDoc SDK includes several Open Source components. You can retrieve the license texts one by one.

Returns
The number of license texts.
See also
getLicenseText()
int getRemainingDays ( RemainingDays  aWhat)
inlinestatic

Get the number of days until the license will expire.

Parameters
[in]aWhatSelect which expiry date shall be used (rd_product or rd_signing).
Returns
-1 if the license has already expired or is invalid, 0 if the license will expire today, a positive value for the number of days the license is still valid. For licenses without expiry date, that will be several millions of days.
bool getVersionNumber ( std::string &  aVersion)
inlinestatic

Get the version number of SignDocShared or SignDoc SDK.

Parameters
[out]aVersionThe version number will be stored here. It consists of 3 integers separated by dots, .e.g., "1.16.7"
Returns
true if successful, false on error.
See also
getComponentVersionNumber()
bool initLogging ( Encoding  aEncoding,
const char *  aLevel,
const char *  aPathname 
)
inline

Initialize logging.

This function initializes logging for all threads of the current process. This function is non-static to enable getErrorMessage(); the logging configuration is not restricted to this SignDocDocumentLoader object.

Parameters
[in]aEncodingThe encoding of the string pointed to by aPathname.
[in]aLevelThe logging level: "0" (log nothing) through "5" (log everything), optionally followed by "T" to log process and thread IDs.
[in]aPathnameThe pathname of the log file. See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps.
Returns
true iff successful.
See also
getErrorMessage()
bool loadFontConfigBlob ( const unsigned char *  aPtr,
size_t  aSize,
Encoding  aEncoding,
const char *  aDirectory 
)
inline

Load font configuration from a blob.

Suitable fonts are required for putting text containing characters that cannot be encoded using WinAnsiEncoding into text fields, FreeText annotations, DigSig appearances, watermarks, and pages of PDF documents. See section Font Configuration.

The font configuration applies to all SignDocDocument objects created by this object.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters
[in]aPtrA pointer to the first octet of a blob containing the XML document.
[in]aSizeThe number of octets pointed to by aPtr.
[in]aEncodingThe encoding of the string pointed to by aDirectory.
[in]aDirectoryRelative font pathnames will be relative to this directory. The directory must exist and must be readable. If nullptr is passed, relative font pathnames will make this function fail. See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps.
Returns
true if successful, false on error.
See also
getFailedFontFiles(), loadFontConfigBlob(), loadFontConfigEnvironment(), loadFontConfigFile()
bool loadFontConfigBlob ( const unsigned char *  aPtr,
size_t  aSize,
const wchar_t *  aDirectory 
)
inline

Load font configuration from a blob.

Suitable fonts are required for putting text containing characters that cannot be encoded using WinAnsiEncoding into text fields, FreeText annotations, DigSig appearances, watermarks, and pages of PDF documents. See section Font Configuration.

The font configuration applies to all SignDocDocument objects created by this object.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters
[in]aPtrA pointer to the first octet of a blob containing the XML document.
[in]aSizeThe number of octets pointed to by aPtr.
[in]aDirectoryRelative font pathnames will be relative to this directory. The directory must exist and must be readable. If nullptr is passed, relative font pathnames will make this function fail. See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps.
Returns
true if successful, false on error.
See also
getFailedFontFiles(), loadFontConfigBlob(), loadFontConfigEnvironment(), loadFontConfigFile()
bool loadFontConfigEnvironment ( const char *  aName)
inline

Load font configuration from files specified by an environment variable.

Suitable fonts are required for putting text containing characters that cannot be encoded using WinAnsiEncoding into text fields, FreeText annotations, DigSig appearances, watermarks, and pages of PDF documents. See section Font Configuration.

Under Windows, directories are separated by semicolons. Under Unix, directories are separated by colons.

The font configuration applies to all SignDocDocument objects created by this object.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters
[in]aNameThe name of the environment variable.
Returns
true if successful, false on error.
See also
getFailedFontFiles(), loadFontConfigBlob(), loadFontConfigFile(), loadFontConfigStream()
bool loadFontConfigFile ( Encoding  aEncoding,
const char *  aPath 
)
inline

Load font configuration from a file.

Suitable fonts are required for putting text containing characters that cannot be encoded using WinAnsiEncoding into text fields, FreeText annotations, DigSig appearances, watermarks, and pages of PDF documents. See section Font Configuration.

The font configuration applies to all SignDocDocument objects created by this object.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters
[in]aEncodingThe encoding of the string pointed to by aPath.
[in]aPathThe pathname of the file. See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps.
Returns
true if successful, false on error.
See also
getFailedFontFiles(), loadFontConfigEnvironment(), loadFontConfigStream()
bool loadFontConfigFile ( const wchar_t *  aPath)
inline

Load font configuration from a file.

Suitable fonts are required for putting text containing characters that cannot be encoded using WinAnsiEncoding into text fields, FreeText annotations, DigSig appearances, watermarks, and pages of PDF documents. See section Font Configuration.

The font configuration applies to all SignDocDocument objects created by this object.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters
[in]aPathThe pathname of the file.
Returns
true if successful, false on error.
See also
getFailedFontFiles(), loadFontConfigBlob(), loadFontConfigEnvironment(), loadFontConfigStream()
bool loadFontConfigStream ( InputStream aStream,
Encoding  aEncoding,
const char *  aDirectory 
)
inline

Load font configuration from a stream.

Suitable fonts are required for putting text containing characters that cannot be encoded using WinAnsiEncoding into text fields, FreeText annotations, DigSig appearances, watermarks, and pages of PDF documents. See section Font Configuration.

The font configuration applies to all SignDocDocument objects created by this object.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters
[in]aStreamThe font configuration will be read from this stream. This function reads the input completely, it doesn't stop at the end tag.
[in]aEncodingThe encoding of the string pointed to by aDirectory.
[in]aDirectoryRelative font pathnames will be relative to this directory. The directory must exist and must be readable. If nullptr is passed, relative font pathnames will make this function fail. See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps.
Returns
true if successful, false on error.
See also
getFailedFontFiles(), loadFontConfigBlob(), loadFontConfigEnvironment(), loadFontConfigFile()
bool loadFontConfigStream ( InputStream aStream,
const wchar_t *  aDirectory 
)
inline

Load font configuration from a stream.

Suitable fonts are required for putting text containing characters that cannot be encoded using WinAnsiEncoding into text fields, FreeText annotations, DigSig appearances, watermarks, and pages of PDF documents. See section Font Configuration.

The font configuration applies to all SignDocDocument objects created by this object.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters
[in]aStreamThe font configuration will be read from this stream. This function reads the input completely, it doesn't stop at the end tag.
[in]aDirectoryRelative font pathnames will be relative to this directory. The directory must exist and must be readable. If nullptr is passed, relative font pathnames will make this function fail. See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps.
Returns
true if successful, false on error.
See also
getFailedFontFiles(), loadFontConfigBlob(), loadFontConfigEnvironment(), loadFontConfigFile()
ReturnCode loadFromFile ( Encoding  aEncoding,
const char *  aPath,
bool  aWritable,
std::unique_ptr< SignDocDocument > &  aOutput 
)
inline

Load a document from a file.

Signing the document will overwrite the document, but see string parameter "OutputPath" of SignDocSignatureParameters.

You can open FDF files that reference a PDF file; the referenced PDF file will be opened and the FDF file will be applied to the loaded copy (using sff_font_fail). If the pathname of the referenced PDF file is not an absolute pathname, it will be interpreted as being relative to the directory containing the FDF file.

The file will remain open until the document is saved or the SignDocDocument object is closed or destroyed.

Parameters
[in]aEncodingThe encoding of the string pointed to by aPath.
[in]aPathPathname of the document file. See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps.
[in]aWritableOpen for writing (used for signing TIFF documents in place, ignored for PDF documents).
[out]aOutputA pointer to a new SignDocDocument object representing the document will be stored here. The caller is responsible for destroying the object.
Returns
rc_ok iff successful.
See also
getErrorMessage(), loadFromMemory(), SignDocDocument::applyFdf(), SignDocSignatureParameters::setInteger()
ReturnCode loadFromFile ( const wchar_t *  aPath,
bool  aWritable,
std::unique_ptr< SignDocDocument > &  aOutput 
)
inline

Load a document from a file.

Signing the document will overwrite the document, but see string parameter "OutputPath" of SignDocSignatureParameters.

You can open FDF files that reference a PDF file; the referenced PDF file will be opened and the FDF file will be applied to the loaded copy (using sff_font_fail). If the pathname of the referenced PDF file is not an absolute pathname, it will be interpreted as being relative to the directory containing the FDF file.

The file will remain open until the document is saved or the SignDocDocument object is closed or destroyed.

Parameters
[in]aPathPathname of the document file.
[in]aWritableOpen for writing (used for signing TIFF documents in place, ignored for PDF documents).
[out]aOutputA pointer to a new SignDocDocument object representing the document will be stored here. The caller is responsible for destroying the object.
Returns
rc_ok iff successful.
See also
getErrorMessage(), loadFromMemory(), SignDocDocument::applyFdf(), SignDocSignatureParameters::setInteger()
ReturnCode loadFromMemory ( const unsigned char *  aData,
size_t  aSize,
bool  aCopy,
std::unique_ptr< SignDocDocument > &  aOutput 
)
inline

Load a document from memory.

Parameters
[in]aDataPointer to the first octet of the document. This array of octets must live at least as long as the returned object unless aCopy is true.
[in]aSizeSize of the document (number of octets).
[in]aCopytrue to make a copy of the array of octets pointed to by aData.
[out]aOutputA pointer to a new SignDocDocument object representing the document will be stored here. The caller is responsible for destroying the object.
Returns
rc_ok iff successful.
See also
getErrorMessage(), loadFromFile()
bool loadPdfFontConfigBlob ( const unsigned char *  aPtr,
size_t  aSize,
Encoding  aEncoding,
const char *  aDirectory 
)
inline

Load font configuration for rendering PDF documents from a blob.

Additional fonts may be required for rendering PDF documents. The font configuration for rendering PDF documents contains mappings from font names to font files. See section Font Configuration.

The font configuration for rendering PDF documents is global, ie, it affects all PDF documents, no matter by which SignDocDocumentLoader object they have been created.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters
[in]aPtrA pointer to the first octet of a blob containing the XML document.
[in]aSizeThe number of octets pointed to by aPtr.
[in]aEncodingThe encoding of the string pointed to by aDirectory.
[in]aDirectoryRelative font pathnames will be relative to this directory. The directory must exist and must be readable. If nullptr is passed, relative font pathnames will make this function fail. See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps.
Returns
true if successful, false on error.
See also
getFailedFontFiles(), loadPdfFontConfigBlobW(), loadPdfFontConfigEnvironment(), loadPdfFontConfigFile(), loadPdfFontConfigStream()
bool loadPdfFontConfigBlob ( const unsigned char *  aPtr,
size_t  aSize,
const wchar_t *  aDirectory 
)
inline

Load font configuration for rendering PDF documents from a blob.

Additional fonts may be required for rendering PDF documents. The font configuration for rendering PDF documents contains mappings from font names to font files. See section Font Configuration.

The font configuration for rendering PDF documents is global, ie, it affects all PDF documents, no matter by which SignDocDocumentLoader object they have been created.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters
[in]aPtrA pointer to the first octet of a blob containing the XML document.
[in]aSizeThe number of octets pointed to by aPtr.
[in]aDirectoryRelative font pathnames will be relative to this directory. The directory must exist and must be readable. If nullptr is passed, relative font pathnames will make this function fail. See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps.
Returns
true if successful, false on error.
See also
getFailedFontFiles(), loadPdfFontConfigBlob(), loadPdfFontConfigEnvironment(), loadPdfFontConfigFile(), loadPdfFontConfigStream()
bool loadPdfFontConfigEnvironment ( const char *  aName)
inline

Load font configuration for rendering PDF documents from files specified by an environment variable.

Additional fonts may be required for rendering PDF documents. The font configuration for rendering PDF documents contains mappings from font names to font files. See section Font Configuration.

The font configuration for rendering PDF documents is global, ie, it affects all PDF documents, no matter by which SignDocDocumentLoader object they have been created.

Under Windows, directories are separated by semicolons. Under Unix, directories are separated by colons.

See section Font Configuration.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters
[in]aNameThe name of the environment variable.
Returns
true if successful, false on error.
See also
getFailedFontFiles(), loadPdfFontConfigBlob(), loadPdfFontConfigFile()
bool loadPdfFontConfigFile ( Encoding  aEncoding,
const char *  aPath 
)
inline

Load font configuration for rendering PDF documents from a file.

Additional fonts may be required for rendering PDF documents. The font configuration for rendering PDF documents contains mappings from font names to font files. See section Font Configuration.

The font configuration for rendering PDF documents is global, ie, it affects all PDF documents, no matter by which SignDocDocumentLoader object they have been created.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters
[in]aEncodingThe encoding of the string pointed to by aPath.
[in]aPathThe pathname of the file. See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps.
Returns
true if successful, false on error.
See also
getFailedFontFiles(), loadPdfFontConfigBlob(), loadPdfFontConfigEnvironment(), loadPdfFontConfigStream()
bool loadPdfFontConfigFile ( const wchar_t *  aPath)
inline

Load font configuration for rendering PDF documents from a file.

Additional fonts may be required for rendering PDF documents. The font configuration for rendering PDF documents contains mappings from font names to font files. See section Font Configuration.

The font configuration for rendering PDF documents is global, ie, it affects all PDF documents, no matter by which SignDocDocumentLoader object they have been created.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters
[in]aPathThe pathname of the file.
Returns
true if successful, false on error.
See also
getFailedFontFiles(), loadPdfFontConfigBlob(), loadPdfFontConfigEnvironment(), loadPdfFontConfigStream()
bool loadPdfFontConfigStream ( InputStream aStream,
Encoding  aEncoding,
const char *  aDirectory 
)
inline

Load font configuration for rendering PDF documents from a stream.

Additional fonts may be required for rendering PDF documents. The font configuration for rendering PDF documents contains mappings from font names to font files. See section Font Configuration.

The font configuration for rendering PDF documents is global, ie, it affects all PDF documents, no matter by which SignDocDocumentLoader object they have been created.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters
[in]aStreamThe font configuration will be read from this stream. This function reads the input completely, it doesn't stop at the end tag.
[in]aEncodingThe encoding of the string pointed to by aDirectory.
[in]aDirectoryRelative font pathnames will be relative to this directory. The directory must exist and must be readable. If nullptr is passed, relative font pathnames will make this function fail. See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps.
Returns
true if successful, false on error.
See also
getFailedFontFiles(), loadPdfFontConfigBlob(), loadPdfFontConfigEnvironment(), loadPdfFontConfigFile()
bool loadPdfFontConfigStream ( InputStream aStream,
const wchar_t *  aDirectory 
)
inline

Load font configuration for rendering PDF documents from a stream.

Additional fonts may be required for rendering PDF documents. The font configuration for rendering PDF documents contains mappings from font names to font files. See section Font Configuration.

The font configuration for rendering PDF documents is global, ie, it affects all PDF documents, no matter by which SignDocDocumentLoader object they have been created.

Use getFailedFontFiles() after calling this function to get the pathnames of any fonts that could not be loaded.

Parameters
[in]aStreamThe font configuration will be read from this stream. This function reads the input completely, it doesn't stop at the end tag.
[in]aDirectoryRelative font pathnames will be relative to this directory. The directory must exist and must be readable. If nullptr is passed, relative font pathnames will make this function fail. See Using SignDoc SDK in Windows Store apps for restrictions on pathnames in Windows Store apps.
Returns
true if successful, false on error.
See also
getFailedFontFiles(), loadPdfFontConfigBlob(), loadPdfFontConfigEnvironment(), loadPdfFontConfigFile()
bool loadTrustedCertificatesFromFile ( Encoding  aEncoding,
const char *  aPath 
)
inline

Load trusted root CA certifcates from a file.

The loaded certificates are used for all SignDocDocument objects created by this object. They are used for signature verification and HTTPS connections. For iOS, they replace the system's trusted anchors, for other operating systems, they are used in addition to the operating system's trusted root CA certificates.

The file must contain either a single DER-encoded X.509 certificate or at least one PEM-encoded X.509 certificate.

Calls to loadTrustedCertificatesFromFile(), loadTrustedCertificatesFromMemory(), and loadTrustedCertificatesFromStream() are cumulative.

Parameters
[in]aEncodingThe encoding of the string pointed to by aPath.
[in]aPathThe pathname of the file.
Returns
true if successful, false on error.
See also
loadTrustedCertificatesFromMemory(), loadTrustedCertificatesFromStream()
bool loadTrustedCertificatesFromFile ( const wchar_t *  aPath)
inline

Load trusted root CA certifcates from a file.

The loaded certificates are used for all SignDocDocument objects created by this object. They are used for signature verification and HTTPS connections. For iOS, they replace the system's trusted anchors, for other operating systems, they are used in addition to the operating system's trusted root CA certificates.

The file must contain either a single DER-encoded X.509 certificate or at least one PEM-encoded X.509 certificate.

Parameters
[in]aPathThe pathname of the file.
Returns
true if successful, false on error.
See also
loadTrustedCertificatesFromMemory(), loadTrustedCertificatesFromStream()
bool loadTrustedCertificatesFromMemory ( const unsigned char *  aPtr,
size_t  aSize 
)
inline

Load trusted root CA certifcates from a blob.

The loaded certificates are used for all SignDocDocument objects created by this object. They are used for signature verification and HTTPS connections. For iOS, they replace the system's trusted anchors, for other operating systems, they are used in addition to the operating system's trusted root CA certificates.

The blob must contain either a single DER-encoded X.509 certificate or at least one PEM-encoded X.509 certificate.

Parameters
[in]aPtrA pointer to the first octet of a blob containing the certificates.
[in]aSizeThe number of octets pointed to by aPtr.
Returns
true if successful, false on error.
See also
loadTrustedCertificatesFromFile(), loadTrustedCertificatesFromStream()
bool loadTrustedCertificatesFromStream ( InputStream aStream)
inline

Load trusted root CA certifcates from a stream.

The loaded certificates are used for all SignDocDocument objects created by this object. They are used for signature verification and HTTPS connections. For iOS, they replace the system's trusted anchors, for other operating systems, they are used in addition to the operating system's trusted root CA certificates.

The stream must contain either a single DER-encoded X.509 certificate or at least one PEM-encoded X.509 certificate.

Parameters
[in]aStreamThe certificates will be read from this stream.
Returns
true if successful, false on error.
See also
loadTrustedCertificatesFromFile(), loadTrustedCertificatesFromMemory()
SignDocDocument::DocumentType ping ( InputStream aStream)
inline

Determine the type of a document.

Parameters
[in]aStreamA seekable stream for the document.
Returns
The type of the document, SignDocDocument::dt_unknown on error.
SignDocDocument::DocumentType ping ( const unsigned char *  aPtr,
size_t  aSize 
)
inline

Determine the type of a document.

Parameters
[in]aPtrA pointer to the first octet of a blob containing the document.
[in]aSizeThe size of hte blob.
Returns
The type of the document, SignDocDocument::dt_unknown on error.
bool registerDocumentHandler ( SignDocDocumentHandler aHandler)
inline

Register a document handler.

The behavior is undefined if multiple handlers for the same document type are registered.

Parameters
[in]aHandlerAn instance of a document handler. This object takes ownerswhip of the object.
Returns
true iff successful.
void setFlags ( unsigned  aFlags)
inline

Set flags modifying the behavior of this SignDocDocumentLoader object and of the SignDocDocument objects created by it.

Parameters
[in]aFlagsThe flags, see enum Flags.
void setImpl ( SIGNDOC_DocumentLoader *  aP)
inline

Internal function.

bool setLicenseKey ( const void *  aKeyPtr,
size_t  aKeySize,
const char *  aProduct,
const char *  aVersion,
const void *  aTokenPtr,
size_t  aTokenSize 
)
inlinestatic

Initialize license management with license key.

License management must be initialized before the non-static methods of SignDocDocumentLoader can be used.

Parameters
[in]aKeyPtrPointer to the first character of the license key.
[in]aKeySizeSize in octets of the license key, not including any terminating NUL character.
[in]aProductShould be nullptr.
[in]aVersionShould be nullptr.
[in]aTokenPtrnullptr or pointer to the first octet of the token. Should be nullptr.
[in]aTokenSizeSize in octets of the token. Should be 0.
Returns
true if successful, false on error.
See also
generateLicenseToken()

The documentation for this class was generated from the following file: