CryptoSys PKI  23.0.0
Public Types | Static Public Member Functions | List of all members
dipki::Pem Class Reference

PEM file conversion routines. More...

Public Types

enum class  Eol
 End-of-line option. More...
 

Static Public Member Functions

static int FileFromBinFile (const std::string &fileToMake, const std::string &fileIn, const std::string &header="", int lineLen=0, Eol eol=Eol::Windows)
 Create a PEM file from a binary file. More...
 
static int FileToBinFile (const std::string &fileToMake, const std::string &fileIn)
 Convert the contents of a PEM file into a binary file. More...
 

Detailed Description

PEM file conversion routines.

Member Enumeration Documentation

◆ Eol

enum dipki::Pem::Eol
strong

End-of-line option.

Enumerator
Windows 

Windows CR-LF line endings (default)

Unix 

Unix/SSL LF line endings.

Member Function Documentation

◆ FileFromBinFile()

static int dipki::Pem::FileFromBinFile ( const std::string &  fileToMake,
const std::string &  fileIn,
const std::string &  header = "",
int  lineLen = 0,
Eol  eol = Eol::Windows 
)
static

Create a PEM file from a binary file.

Parameters
fileToMakeName of PEM file to create
fileInName of input binary file
headerHeader to be used. Leave empty to omit the PEM header and footer.
lineLenMaximum length of a line in the resulting PEM file [default = 64 characters]
eolLine ending convention [default = Windows CR-LF endings]
Returns
Zero if successful.

◆ FileToBinFile()

static int dipki::Pem::FileToBinFile ( const std::string &  fileToMake,
const std::string &  fileIn 
)
static

Convert the contents of a PEM file into a binary file.

Parameters
fileToMakeName of binary file to create.
fileInName of input PEM file
Returns
Zero if successful.
Copyright © 2004-24 D.I. Management Services Pty Limited t/a CryptoSys ABN 78 083 210 584 Australia. All rights reserved. <www.di-mgt.com.au> <www.cryptosys.net>. Generated on Mon Sep 23 2024 15:37:33 by Doxygen 1.9.1.