Squid Web Cache master
Loading...
Searching...
No Matches
crtd_message.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2025 The Squid Software Foundation and contributors
3 *
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
7 */
8
9#ifndef SQUID_SRC_SSL_CRTD_MESSAGE_H
10#define SQUID_SRC_SSL_CRTD_MESSAGE_H
11
12#include <map>
13#include <string>
14
15namespace Ssl
16{
17class CertificateProperties;
18
25{
26public:
27 typedef std::map<std::string, std::string> BodyParams;
44 ParseResult parse(const char * buffer, size_t len);
46 std::string const & getBody() const;
48 std::string const & getCode() const;
49 void setBody(std::string const & aBody);
50 void setCode(std::string const & aCode);
51 std::string compose() const;
53 void clear();
61 void parseBody(BodyParams & map, std::string & other_part) const;
69 void composeBody(BodyParams const & map, std::string const & other_part);
70
73 void composeRequest(Ssl::CertificateProperties const &); // throws
74
76 static const std::string code_new_certificate;
78 static const std::string param_host;
80 static const std::string param_SetValidAfter;
82 static const std::string param_SetValidBefore;
84 static const std::string param_SetCommonName;
86 static const std::string param_Sign;
88 static const std::string param_SignHash;
89protected:
99 size_t body_size;
101 std::string body;
102 std::string code;
103 std::string current_block;
104};
105
106} //namespace Ssl
107
108#endif /* SQUID_SRC_SSL_CRTD_MESSAGE_H */
109
void setCode(std::string const &aCode)
Set new request/reply code to compose.
static const std::string param_SetCommonName
Parameter name for passing SetCommonName cert adaptation variable.
void clear()
Reset the class.
void composeBody(BodyParams const &map, std::string const &other_part)
void setBody(std::string const &aBody)
Set new body to encode.
static const std::string param_SignHash
The signing hash to use.
static const std::string param_SetValidBefore
Parameter name for passing SetValidBefore cert adaptation variable.
static const std::string param_SetValidAfter
Parameter name for passing SetValidAfter cert adaptation variable.
static const std::string code_new_certificate
String code for "new_certificate" messages.
std::string const & getBody() const
Current body. If parsing is not finished the method returns incompleted body.
ParseResult
Parse result codes.
void parseBody(BodyParams &map, std::string &other_part) const
static const std::string param_host
Parameter name for passing hostname.
std::string const & getCode() const
Current response/request code. If parsing is not finished the method may return incompleted code.
ParseResult parse(const char *buffer, size_t len)
void parseRequest(CertificateProperties &)
orchestrates entire request parsing
std::map< std::string, std::string > BodyParams
size_t body_size
The body size if exist or 0.
static const std::string param_Sign
Parameter name for passing signing algorithm.
void composeRequest(Ssl::CertificateProperties const &)
std::string code
Current response/request code.
std::string body
Current body.
std::string current_block
Current block buffer.
ParseState state
Parsing state.
std::string compose() const
Definition Xaction.cc:40