@@ -133,8 +133,8 @@ buildLabel(std::ostream& ofs, std::string_view type, const std::map<std::string_
133133 parts[key] = value;
134134 }
135135 ofs << CDoc2::LABELPREFIX;
136- ofs << CDoc2::LBL_VERSION << ' =' << std::to_string (CDoc2::KEYLABELVERSION) << ' &'
137- << CDoc2::LBL_TYPE << ' =' << type;
136+ ofs << CDoc2::Label::VERSION << ' =' << std::to_string (CDoc2::KEYLABELVERSION) << ' &'
137+ << CDoc2::Label::TYPE << ' =' << type;
138138 for (const auto & [key, value] : parts) {
139139 if (!value.empty ())
140140 ofs << ' &' << urlEncode (key) << ' =' << urlEncode (value);
@@ -146,19 +146,19 @@ BuildLabelEID(std::ostream& ofs, Certificate::EIDType type, const Certificate& x
146146{
147147
148148 buildLabel (ofs, CDoc2::eid_strs[type], lbl_parts, {
149- {CDoc2::LBL_CN , x509.getCommonName ()},
150- {CDoc2::LBL_SERIAL_NUMBER , x509.getSerialNumber ()},
151- {CDoc2::LBL_LAST_NAME , x509.getSurname ()},
152- {CDoc2::LBL_FIRST_NAME , x509.getGivenName ()},
149+ {CDoc2::Label::CN , x509.getCommonName ()},
150+ {CDoc2::Label::SERIAL_NUMBER , x509.getSerialNumber ()},
151+ {CDoc2::Label::LAST_NAME , x509.getSurname ()},
152+ {CDoc2::Label::FIRST_NAME , x509.getGivenName ()},
153153 });
154154}
155155
156156static void
157157BuildLabelCertificate (std::ostream &ofs, const Certificate& x509, const std::map<std::string_view,std::string_view>& lbl_parts)
158158{
159- buildLabel (ofs, CDoc2::TYPE_CERTIFICATE, lbl_parts, {
160- {CDoc2::LBL_CN , x509.getCommonName ()},
161- {CDoc2::LBL_CERT_SHA1 , toHex (x509.getDigest ())}
159+ buildLabel (ofs, CDoc2::Label:: TYPE_CERTIFICATE, lbl_parts, {
160+ {CDoc2::Label::CN , x509.getCommonName ()},
161+ {CDoc2::Label::CERT_SHA1 , toHex (x509.getDigest ())}
162162 });
163163}
164164
@@ -183,9 +183,9 @@ Recipient::getLabel(const std::vector<std::pair<std::string_view, std::string_vi
183183 break ;
184184 case SYMMETRIC_KEY:
185185 if (kdf_iter > 0 ) {
186- buildLabel (ofs, CDoc2::TYPE_PASSWORD, parts, {});
186+ buildLabel (ofs, CDoc2::Label:: TYPE_PASSWORD, parts, {});
187187 } else {
188- buildLabel (ofs, CDoc2::TYPE_SYMMETRIC, parts, {});
188+ buildLabel (ofs, CDoc2::Label:: TYPE_SYMMETRIC, parts, {});
189189 }
190190 break ;
191191 case PUBLIC_KEY:
@@ -197,7 +197,7 @@ Recipient::getLabel(const std::vector<std::pair<std::string_view, std::string_vi
197197 BuildLabelCertificate (ofs, x509, parts);
198198 }
199199 } else {
200- buildLabel (ofs, CDoc2::TYPE_PUBLIC_KEY, parts, {});
200+ buildLabel (ofs, CDoc2::Label:: TYPE_PUBLIC_KEY, parts, {});
201201 }
202202 break ;
203203 case KEYSHARE:
0 commit comments