crtd_message.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 1996-2023 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_SSL_CRTD_MESSAGE_H
10#define SQUID_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;
32 ERROR
33 };
37 };
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:
97 END
98 };
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_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.
Definition: crtd_message.h:84
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.
Definition: crtd_message.h:88
static const std::string param_SetValidBefore
Parameter name for passing SetValidBefore cert adaptation variable.
Definition: crtd_message.h:82
static const std::string param_SetValidAfter
Parameter name for passing SetValidAfter cert adaptation variable.
Definition: crtd_message.h:80
static const std::string code_new_certificate
String code for "new_certificate" messages.
Definition: crtd_message.h:76
CrtdMessage(MessageKind kind)
Definition: crtd_message.cc:19
std::string const & getBody() const
Current body. If parsing is not finished the method returns incompleted body.
ParseResult
Parse result codes.
Definition: crtd_message.h:29
void parseBody(BodyParams &map, std::string &other_part) const
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.
ParseResult parse(const char *buffer, size_t len)
Definition: crtd_message.cc:23
void parseRequest(CertificateProperties &)
orchestrates entire request parsing
std::map< std::string, std::string > BodyParams
Definition: crtd_message.h:27
size_t body_size
The body size if exist or 0.
Definition: crtd_message.h:99
static const std::string param_Sign
Parameter name for passing signing algorithm.
Definition: crtd_message.h:86
void composeRequest(Ssl::CertificateProperties const &)
std::string code
Current response/request code.
Definition: crtd_message.h:102
std::string body
Current body.
Definition: crtd_message.h:101
std::string current_block
Current block buffer.
Definition: crtd_message.h:103
ParseState state
Parsing state.
Definition: crtd_message.h:100
std::string compose() const
Definition: Xaction.cc:40

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors