security_file_certgen.cc
Go to the documentation of this file.
118 throw TextException(ToSBuf("expecting a decimal number at the beginning of ", name, " value but got: ", value), Here());
155 + Ssl::CrtdMessage::code_new_certificate + " " + request_string_size_stream.str() + " " + request_string + "\n" +
172static bool processNewRequest(Ssl::CrtdMessage & request_message, std::string const & db_path, size_t max_db_size, size_t fs_block_size)
213 if (!dbFailed && db && !db->addCertAndPrivateKey(certKey, cert, pkey, certProperties.mimicCert))
289 throw TextException("security_file_certgen is missing the required parameter. There should be -s and -M parameters when -c is used.", Here());
334 throw TextException(ToSBuf("Unknown request code: \"", request_message.getCode(), "\"."), Here());
std::ostream & CurrentException(std::ostream &os)
prints active (i.e., thrown but not yet handled) exception
Definition: TextException.cc:88
Definition: certificate_db.h:64
static void Create(std::string const &db_path)
Create and initialize a database under the db_path.
Definition: certificate_db.cc:366
static void Check(std::string const &db_path, size_t max_db_size, size_t fs_block_size)
Check the database stored under the db_path.
Definition: certificate_db.cc:390
Definition: gadgets.h:229
Definition: crtd_message.h:25
void setCode(std::string const &aCode)
Set new request/reply code to compose.
Definition: crtd_message.cc:126
static const std::string code_new_certificate
String code for "new_certificate" messages.
Definition: crtd_message.h:76
static const std::string param_host
Parameter name for passing hostname.
Definition: crtd_message.h:78
std::string const & getCode() const
Current response/request code. If parsing is not finished the method may return incompleted code.
Definition: crtd_message.cc:122
ParseResult parse(const char *buffer, size_t len)
Definition: crtd_message.cc:23
void parseRequest(CertificateProperties &)
orchestrates entire request parsing
Definition: crtd_message.cc:181
std::string & OnDiskCertificateDbKey(const CertificateProperties &)
Definition: gadgets.cc:267
bool generateSslCertificate(Security::CertPointer &cert, Security::PrivateKeyPointer &pkey, CertificateProperties const &properties)
Definition: gadgets.cc:711
bool writeCertAndPrivateKeyToMemory(Security::CertPointer const &cert, Security::PrivateKeyPointer const &pkey, std::string &bufferToWrite)
Definition: gadgets.cc:97
SBuf ToSBuf(Args &&... args)
slowly stream-prints all arguments into a freshly allocated SBuf
Definition: Stream.h:63
int main(int argc, char *argv[])
This is the external security_file_certgen process.
Definition: security_file_certgen.cc:238
static size_t parseBytesOptionValue(const char *const name, const char *const value)
Definition: security_file_certgen.cc:107
static size_t parseBytesUnits(const char *unit)
Definition: security_file_certgen.cc:86
static bool processNewRequest(Ssl::CrtdMessage &request_message, std::string const &db_path, size_t max_db_size, size_t fs_block_size)
Process new request message.
Definition: security_file_certgen.cc:172
Definition: statvfs.h:43