Module: Miscellaneous
Definition in file FileUtils.h.
#include "PKIFdll.h"
#include "PKIFException.h"
Go to the source code of this file.
Defines | |
#define | _FILEUTILS_H_ |
Functions | |
FD_SMART_PTR (CPKIFCertificate) | |
FD_SMART_PTR (CPKIFBuffer) | |
CPKIFCertificatePtr CAC_API | DecodeCertFromFile (const std::string &filename) throw (CPKIFException) |
void CAC_API | WriteBufferToFile (const std::string &filename, CPKIFBufferPtr &buf) |
CPKIFBufferPtr CAC_API | ReadFileIntoBuffer (const std::string &filename) throw (CPKIFException) |
#define _FILEUTILS_H_ |
Definition at line 10 of file FileUtils.h.
CPKIFCertificatePtr CAC_API DecodeCertFromFile | ( | const std::string & | filename | ) | throw (CPKIFException) |
Interface: Subsystem
This is a helper function that decodes a DER encoded certificate and returns a smart pointer to a CPKIFCertificate object containing that certificate.
NOTE: This function is intended for certificate files only. A possible buffer overflow might occur if the function is called on a very large file.
CPKIFPathException(COMMON_INVALID_INPUT) |
filename | [in] std:: string containing the file location of the der encoded certificate |
Definition at line 101 of file FileUtils.cpp.
References ReadFileIntoBuffer().
Referenced by CExtractInfoFromCertDialog::CExtractInfoFromCertDialog().
FD_SMART_PTR | ( | CPKIFBuffer | ) |
FD_SMART_PTR | ( | CPKIFCertificate | ) |
CPKIFBufferPtr CAC_API ReadFileIntoBuffer | ( | const std::string & | filename | ) | throw (CPKIFException) |
Interface: Subsystem
This is a helper function that reads a file into a buffer
NOTE: This function is intended for small files only, i.e. certificates
CPKIFException(COMMON_INVALID_INPUT) |
filename | [in] std:: string containing the file location |
Definition at line 44 of file FileUtils.cpp.
References COMMON_INVALID_INPUT, TOOLKIT_UTILS, and TOOLKIT_UTILS_SUBCOMPONENT.
Referenced by _MakeCredentialFromP8File(), DecodeCertFromFile(), and MakeCredentialFromP8File().
void CAC_API WriteBufferToFile | ( | const std::string & | filename, | |
CPKIFBufferPtr & | buf | |||
) |
Interface: Subsystem
This is a helper function that writes a buffer into a file
CPKIFPathException(COMMON_INVALID_INPUT) | ||
CPKIFPathException(COMMON_OPERATION_NOT_SUCCESSFUL) |
filename | [in] std::string containing the filename into which the buffer will be written |
buf | [in] A smart pointer to CPKIFBuffer object containing the data that will be written into a file |
Definition at line 120 of file FileUtils.cpp.
References COMMON_INVALID_INPUT, COMMON_OPERATION_NOT_SUCCESSFUL, and TOOLKIT_UTILS_SUBCOMPONENT.
Referenced by PathDumpDialog::SaveLogToDisk(), PathDumpDialog::SavePathToDisk(), PathDumpDialog::SaveRIToDisk(), and WriteCertsFromOcspResponseToFile().