FileUtils.h File Reference


Detailed Description

Subsystem: Miscellaneous/Utility (PKIFUTILS)

Module: Miscellaneous

Id
FileUtils.h 12017 2010-11-08 19:49:11Z agalustyan

Definition in file FileUtils.h.

#include "PKIFdll.h"
#include "PKIFException.h"

Include dependency graph for FileUtils.h:

This graph shows which files directly or indirectly include this file:

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 Documentation

#define _FILEUTILS_H_

Definition at line 10 of file FileUtils.h.


Function Documentation

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.

Returns:
A smart pointer toCPKIFCertificate object containing the decoded certificate
Exceptions:
CPKIFPathException(COMMON_INVALID_INPUT) 
Parameters:
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

Returns:
A smart pointer to a CPKIFBuffer object with the contents of the file
Exceptions:
CPKIFException(COMMON_INVALID_INPUT) 
Parameters:
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

Returns:
None
Exceptions:
CPKIFPathException(COMMON_INVALID_INPUT) 
CPKIFPathException(COMMON_OPERATION_NOT_SUCCESSFUL) 
Parameters:
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().


Generated on Mon Nov 15 11:16:57 2010 for PublicKeyInfrastructureFramework(PKIF) by  doxygen 1.5.6