| 1 | #cxx . . $ `<file>/mlspp/lib/hpke/src/userinfo_vc.cpp`/include <hpke/base64.h>cxx . . $ `<file>/mlspp/lib/hpke/include/hpke/base64.h`/ |
| 2 | #include <hpke/signature.h>cxx . . $ `<file>/mlspp/lib/hpke/include/hpke/signature.h`/ |
| 3 | #include <hpke/userinfo_vc.h>cxx . . $ `<file>/mlspp/lib/hpke/include/hpke/userinfo_vc.h`/ |
| 4 | #include <dpp/json.h>cxx . . $ `<file>/include/dpp/json.h`/ |
| 5 | #include <tls/compat.h>cxx . . $ `<file>/mlspp/lib/bytes/include/tls/compat.h`/ |
| 6 | |
| 7 | using nlohmanncxx . . $ nlohmann/::jsoncxx . . $ json#; |
| 8 | |
| 9 | namespace mlsppcxx . . $ mlspp/::hpkecxx . . $ mlspp/hpke/ { |
| 10 | |
| 11 | static const stdcxx . . $ std/::stringcxx . . $ std/string# name_attrcxx . . $ mlspp/hpke/name_attr. = "name"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 12 | static const stdcxx . . $ std/::stringcxx . . $ std/string# sub_attrcxx . . $ mlspp/hpke/sub_attr. = "sub"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 13 | static const stdcxx . . $ std/::stringcxx . . $ std/string# given_name_attrcxx . . $ mlspp/hpke/given_name_attr. = "given_name"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 14 | static const stdcxx . . $ std/::stringcxx . . $ std/string# family_name_attrcxx . . $ mlspp/hpke/family_name_attr. = "family_name"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 15 | static const stdcxx . . $ std/::stringcxx . . $ std/string# middle_name_attrcxx . . $ mlspp/hpke/middle_name_attr. = "middle_name"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 16 | static const stdcxx . . $ std/::stringcxx . . $ std/string# nickname_attrcxx . . $ mlspp/hpke/nickname_attr. = "nickname"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 17 | static const stdcxx . . $ std/::stringcxx . . $ std/string# preferred_username_attrcxx . . $ mlspp/hpke/preferred_username_attr. = "preferred_username"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 18 | static const stdcxx . . $ std/::stringcxx . . $ std/string# profile_attrcxx . . $ mlspp/hpke/profile_attr. = "profile"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 19 | static const stdcxx . . $ std/::stringcxx . . $ std/string# picture_attrcxx . . $ mlspp/hpke/picture_attr. = "picture"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 20 | static const stdcxx . . $ std/::stringcxx . . $ std/string# website_attrcxx . . $ mlspp/hpke/website_attr. = "website"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 21 | static const stdcxx . . $ std/::stringcxx . . $ std/string# email_attrcxx . . $ mlspp/hpke/email_attr. = "email"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 22 | static const stdcxx . . $ std/::stringcxx . . $ std/string# email_verified_attrcxx . . $ mlspp/hpke/email_verified_attr. = "email_verified"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 23 | static const stdcxx . . $ std/::stringcxx . . $ std/string# gender_attrcxx . . $ mlspp/hpke/gender_attr. = "gender"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 24 | static const stdcxx . . $ std/::stringcxx . . $ std/string# birthdate_attrcxx . . $ mlspp/hpke/birthdate_attr. = "birthdate"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 25 | static const stdcxx . . $ std/::stringcxx . . $ std/string# zoneinfo_attrcxx . . $ mlspp/hpke/zoneinfo_attr. = "zoneinfo"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 26 | static const stdcxx . . $ std/::stringcxx . . $ std/string# locale_attrcxx . . $ mlspp/hpke/locale_attr. = "locale"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 27 | static const stdcxx . . $ std/::stringcxx . . $ std/string# phone_number_attrcxx . . $ mlspp/hpke/phone_number_attr. = "phone_number"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 28 | static const stdcxx . . $ std/::stringcxx . . $ std/string# phone_number_verified_attrcxx . . $ mlspp/hpke/phone_number_verified_attr. = "phone_number_verified"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 29 | static const stdcxx . . $ std/::stringcxx . . $ std/string# address_attrcxx . . $ mlspp/hpke/address_attr. = "address"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 30 | static const stdcxx . . $ std/::stringcxx . . $ std/string# address_formatted_attrcxx . . $ mlspp/hpke/address_formatted_attr. = "formatted"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 31 | static const stdcxx . . $ std/::stringcxx . . $ std/string# address_street_address_attrcxx . . $ mlspp/hpke/address_street_address_attr. = "street_address"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 32 | static const stdcxx . . $ std/::stringcxx . . $ std/string# address_locality_attrcxx . . $ mlspp/hpke/address_locality_attr. = "locality"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 33 | static const stdcxx . . $ std/::stringcxx . . $ std/string# address_region_attrcxx . . $ mlspp/hpke/address_region_attr. = "region"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 34 | static const stdcxx . . $ std/::stringcxx . . $ std/string# address_postal_code_attrcxx . . $ mlspp/hpke/address_postal_code_attr. = "postal_code"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 35 | static const stdcxx . . $ std/::stringcxx . . $ std/string# address_country_attrcxx . . $ mlspp/hpke/address_country_attr. = "country"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 36 | static const stdcxx . . $ std/::stringcxx . . $ std/string# updated_at_attrcxx . . $ mlspp/hpke/updated_at_attr. = "updated_at"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 37 | |
| 38 | template<typename T> |
| 39 | static stdcxx . . $ std/::optionalcxx . . $ std/optional#<T> |
| 40 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).(const jsoncxx . . $ json#& json_object, const stdcxx . . $ std/::stringcxx . . $ std/string#& field_name) |
| 41 | { |
| 42 | if (!json_object.containscxx . . $ nlohmann/json_abi_v3_11_3/basic_json#contains(7bb4e7482c192e90).(field_name)) { |
| 43 | return stdcxx . . $ std/::nulloptcxx . . $ std/nullopt.; |
| 44 | } |
| 45 | |
| 46 | return { json_object.atcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#at(8ee77953f8f5258b).(field_name).getcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#get(f26e7a71f0cc88d2).<T>() }; |
| 47 | } |
| 48 | |
| 49 | /// |
| 50 | /// ParsedCredential |
| 51 | /// |
| 52 | static const Signaturecxx . . $ mlspp/hpke/Signature#& |
| 53 | signature_from_algcxx . . $ mlspp/hpke/signature_from_alg(4ff0c1939554d24f).(const stdcxx . . $ std/::stringcxx . . $ std/string#& alg) |
| 54 | { |
| 55 | static const auto alg_sig_map = stdcxx . . $ std/map#map(7786ef3e167e36fa).::mapcxx . . $ std/map#<stdcxx . . $ std/::stringcxx . . $ std/string#, const Signaturecxx . . $ mlspp/hpke/Signature#&> |
| 56 | { |
| 57 | { "ES256", Signaturecxx . . $ mlspp/hpke/Signature#::getcxx . . $ mlspp/hpke/Signature#get(9e8bfd5ad9358347).<Signaturecxx . . $ mlspp/hpke/Signature#::IDcxx . . $ mlspp/hpke/Signature#ID#::P256_SHA256cxx . . $ mlspp/hpke/Signature#ID#P256_SHA256.>() }, |
| 58 | { "ES384", Signaturecxx . . $ mlspp/hpke/Signature#::getcxx . . $ mlspp/hpke/Signature#get(9e8bfd5ad9358347).<Signaturecxx . . $ mlspp/hpke/Signature#::IDcxx . . $ mlspp/hpke/Signature#ID#::P384_SHA384cxx . . $ mlspp/hpke/Signature#ID#P384_SHA384.>() }, |
| 59 | { "ES512", Signaturecxx . . $ mlspp/hpke/Signature#::getcxx . . $ mlspp/hpke/Signature#get(9e8bfd5ad9358347).<Signaturecxx . . $ mlspp/hpke/Signature#::IDcxx . . $ mlspp/hpke/Signature#ID#::P521_SHA512cxx . . $ mlspp/hpke/Signature#ID#P521_SHA512.>() }, |
| 60 | { "Ed25519", Signaturecxx . . $ mlspp/hpke/Signature#::getcxx . . $ mlspp/hpke/Signature#get(9e8bfd5ad9358347).<Signaturecxx . . $ mlspp/hpke/Signature#::IDcxx . . $ mlspp/hpke/Signature#ID#::Ed25519cxx . . $ mlspp/hpke/Signature#ID#Ed25519.>() }, |
| 61 | #if !defined(WITH_BORINGSSL) |
| 62 | { "Ed448", Signaturecxx . . $ mlspp/hpke/Signature#::getcxx . . $ mlspp/hpke/Signature#get(9e8bfd5ad9358347).<Signaturecxx . . $ mlspp/hpke/Signature#::IDcxx . . $ mlspp/hpke/Signature#ID#::Ed448cxx . . $ mlspp/hpke/Signature#ID#Ed448.>() }, |
| 63 | #endif |
| 64 | { "RS256", Signaturecxx . . $ mlspp/hpke/Signature#::getcxx . . $ mlspp/hpke/Signature#get(9e8bfd5ad9358347).<Signaturecxx . . $ mlspp/hpke/Signature#::IDcxx . . $ mlspp/hpke/Signature#ID#::RSA_SHA256cxx . . $ mlspp/hpke/Signature#ID#RSA_SHA256.>() }, |
| 65 | { "RS384", Signaturecxx . . $ mlspp/hpke/Signature#::getcxx . . $ mlspp/hpke/Signature#get(9e8bfd5ad9358347).<Signaturecxx . . $ mlspp/hpke/Signature#::IDcxx . . $ mlspp/hpke/Signature#ID#::RSA_SHA384cxx . . $ mlspp/hpke/Signature#ID#RSA_SHA384.>() }, |
| 66 | { "RS512", Signaturecxx . . $ mlspp/hpke/Signature#::getcxx . . $ mlspp/hpke/Signature#get(9e8bfd5ad9358347).<Signaturecxx . . $ mlspp/hpke/Signature#::IDcxx . . $ mlspp/hpke/Signature#ID#::RSA_SHA512cxx . . $ mlspp/hpke/Signature#ID#RSA_SHA512.>() }, |
| 67 | }; |
| 68 | |
| 69 | return alg_sig_map.atcxx . . $ std/map#at(9bc8fa515171eae).(alg); |
| 70 | } |
| 71 | |
| 72 | static stdcxx . . $ std/::chronocxx . . $ std/chrono/::system_clockcxx . . $ std/chrono/_V2/system_clock#::time_pointcxx . . $ std/chrono/_V2/system_clock#time_point# |
| 73 | epoch_timecxx . . $ mlspp/hpke/epoch_time(88ce396ce52b2fd7).(int64_t seconds_since_epoch) |
| 74 | { |
| 75 | const auto delta = stdcxx . . $ std/::chronocxx . . $ std/chrono/::secondscxx . . $ std/chrono/seconds#(seconds_since_epoch); |
| 76 | return stdcxx . . $ std/::chronocxx . . $ std/chrono/::system_clockcxx . . $ std/chrono/_V2/system_clock#::time_pointcxx . . $ std/chrono/_V2/system_clock#time_point#(deltacxx . . $ std/chrono/duration#duration(a833b3f73e1ac0ab).); |
| 77 | } |
| 78 | |
| 79 | static bool |
| 80 | is_ecdsacxx . . $ mlspp/hpke/is_ecdsa(2de2ada66e3fbba2).(const Signaturecxx . . $ mlspp/hpke/Signature#& sig) |
| 81 | { |
| 82 | return sig.idcxx . . $ mlspp/hpke/Signature#id. == Signaturecxx . . $ mlspp/hpke/Signature#::IDcxx . . $ mlspp/hpke/Signature#ID#::P256_SHA256cxx . . $ mlspp/hpke/Signature#ID#P256_SHA256. || |
| 83 | sig.idcxx . . $ mlspp/hpke/Signature#id. == Signaturecxx . . $ mlspp/hpke/Signature#::IDcxx . . $ mlspp/hpke/Signature#ID#::P384_SHA384cxx . . $ mlspp/hpke/Signature#ID#P384_SHA384. || |
| 84 | sig.idcxx . . $ mlspp/hpke/Signature#id. == Signaturecxx . . $ mlspp/hpke/Signature#::IDcxx . . $ mlspp/hpke/Signature#ID#::P521_SHA512cxx . . $ mlspp/hpke/Signature#ID#P521_SHA512.; |
| 85 | } |
| 86 | |
| 87 | // OpenSSL expects ECDSA signatures to be in DER form. JWS provides the |
| 88 | // signature in raw R||S form. So we need to do some manual DER encoding. |
| 89 | static bytescxx . . $ mlspp/bytes_ns/bytes# |
| 90 | jws_to_der_sigcxx . . $ mlspp/hpke/jws_to_der_sig(dfba7759a1cb6e97).(const bytescxx . . $ mlspp/bytes_ns/bytes#& jws_sig) |
| 91 | { |
| 92 | // Inputs that are too large will result in invalid DER encodings with this |
| 93 | // code. At this size, the combination of the DER integer headers and the |
| 94 | // integer data will overflow the one-byte DER struct length. |
| 95 | static const auto max_sig_size = size_t(250); |
| 96 | if (jws_sig.sizecxx . . $ mlspp/bytes_ns/bytes#size(fe4d2d262d4164a8).() > max_sig_size) { |
| 97 | throw stdcxx . . $ std/::runtime_errorcxx . . $ std/runtime_error#("JWS signature too large"); |
| 98 | } |
| 99 | |
| 100 | if (jws_sig.sizecxx . . $ mlspp/bytes_ns/bytes#size(fe4d2d262d4164a8).() % 2 != 0) { |
| 101 | throw stdcxx . . $ std/::runtime_errorcxx . . $ std/runtime_error#("Malformed JWS signature"); |
| 102 | } |
| 103 | |
| 104 | const auto int_size = jws_sig.sizecxx . . $ mlspp/bytes_ns/bytes#size(fe4d2d262d4164a8).() / 2; |
| 105 | const auto jws_sig_cut = |
| 106 | jws_sig.begincxx . . $ mlspp/bytes_ns/bytes#begin(2066806ed53596f0).() +cxx . . $ __gnu_cxx/__normal_iterator#operator+(192bf940fa7bb3b2). static_cast<stdcxx . . $ std/::ptrdiff_tcxx . . $ std/ptrdiff_t#>(int_size); |
| 107 | |
| 108 | // Compute the encoded size of R and S integer data, adding a zero byte if |
| 109 | // needed to clear the sign bit |
| 110 | const auto r_big = (jws_sig.atcxx . . $ mlspp/bytes_ns/bytes#at(f7d94d2ba28cb144).(0) >= 0x80); |
| 111 | const auto s_big = (jws_sig.atcxx . . $ mlspp/bytes_ns/bytes#at(f7d94d2ba28cb144).(int_size) >= 0x80); |
| 112 | |
| 113 | const auto r_size = int_size + (r_big ? 1 : 0); |
| 114 | const auto s_size = int_size + (s_big ? 1 : 0); |
| 115 | |
| 116 | // Compute the size of the DER-encoded signature |
| 117 | static const auto int_header_size = 2; |
| 118 | const auto r_int_size = int_header_size + r_size; |
| 119 | const auto s_int_size = int_header_size + s_size; |
| 120 | |
| 121 | const auto content_size = r_int_size + s_int_size; |
| 122 | const auto content_big = (content_size > 0x80); |
| 123 | |
| 124 | auto der_header_size = 2 + (content_big ? 1 : 0); |
| 125 | const auto der_size = der_header_size + content_size; |
| 126 | |
| 127 | // Allocate the DER buffer |
| 128 | auto der = bytescxx . . $ mlspp/bytes_ns/bytes#bytes(913f486ae89fd8a8).(der_size, 0); |
| 129 | |
| 130 | // Write the header |
| 131 | der.atcxx . . $ mlspp/bytes_ns/bytes#at(b19923e35e3d04d7).(0) = 0x30; |
| 132 | if (content_big) { |
| 133 | der.atcxx . . $ mlspp/bytes_ns/bytes#at(b19923e35e3d04d7).(1) = 0x81; |
| 134 | der.atcxx . . $ mlspp/bytes_ns/bytes#at(b19923e35e3d04d7).(2) = static_cast<uint8_tcxx . . $ uint8_t#>(content_size); |
| 135 | } else { |
| 136 | der.atcxx . . $ mlspp/bytes_ns/bytes#at(b19923e35e3d04d7).(1) = static_cast<uint8_tcxx . . $ uint8_t#>(content_size); |
| 137 | } |
| 138 | |
| 139 | // Write R, virtually padding with a zero byte if needed |
| 140 | const auto r_start = der_header_size; |
| 141 | const auto r_data_start = r_start + int_header_size + (r_big ? 1 : 0); |
| 142 | const auto r_data_begin = |
| 143 | der.begincxx . . $ mlspp/bytes_ns/bytes#begin(2f4f6d8a0f75beb2).() +cxx . . $ __gnu_cxx/__normal_iterator#operator+(192bf940fa7bb3b2). static_cast<stdcxx . . $ std/::ptrdiff_tcxx . . $ std/ptrdiff_t#>(r_data_start); |
| 144 | |
| 145 | der.atcxx . . $ mlspp/bytes_ns/bytes#at(b19923e35e3d04d7).(r_start) = 0x02; |
| 146 | der.atcxx . . $ mlspp/bytes_ns/bytes#at(b19923e35e3d04d7).(r_start + 1) = static_cast<uint8_tcxx . . $ uint8_t#>(r_size); |
| 147 | stdcxx . . $ std/::copycxx . . $ std/copy(88304b602929f6f4).(jws_sig.begincxx . . $ mlspp/bytes_ns/bytes#begin(2066806ed53596f0).(), jws_sig_cut, r_data_begin); |
| 148 | |
| 149 | // Write S, virtually padding with a zero byte if needed |
| 150 | const auto s_start = der_header_size + r_int_size; |
| 151 | const auto s_data_start = s_start + int_header_size + (s_big ? 1 : 0); |
| 152 | const auto s_data_begin = |
| 153 | der.begincxx . . $ mlspp/bytes_ns/bytes#begin(2f4f6d8a0f75beb2).() +cxx . . $ __gnu_cxx/__normal_iterator#operator+(192bf940fa7bb3b2). static_cast<stdcxx . . $ std/::ptrdiff_tcxx . . $ std/ptrdiff_t#>(s_data_start); |
| 154 | |
| 155 | der.atcxx . . $ mlspp/bytes_ns/bytes#at(b19923e35e3d04d7).(s_start) = 0x02; |
| 156 | der.atcxx . . $ mlspp/bytes_ns/bytes#at(b19923e35e3d04d7).(s_start + 1) = static_cast<uint8_tcxx . . $ uint8_t#>(s_size); |
| 157 | stdcxx . . $ std/::copycxx . . $ std/copy(88304b602929f6f4).(jws_sig_cut, jws_sig.endcxx . . $ mlspp/bytes_ns/bytes#end(2066806ed53596f0).(), s_data_begin); |
| 158 | |
| 159 | return dercxx . . $ mlspp/bytes_ns/bytes#bytes(628b76f52f2a67f).; |
| 160 | } |
| 161 | |
| 162 | struct UserInfoVCcxx . . $ mlspp/hpke/UserInfoVC#::ParsedCredentialcxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential# |
| 163 | { |
| 164 | // Header fields |
| 165 | const Signaturecxx . . $ mlspp/hpke/Signature#& signature_algorithmcxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#signature_algorithm.; // `alg` |
| 166 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::stringcxx . . $ std/string#> key_idcxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#key_id.; // `kid` |
| 167 | |
| 168 | // Top-level Payload fields |
| 169 | stdcxx . . $ std/::stringcxx . . $ std/string# issuercxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#issuer.; // `iss` |
| 170 | stdcxx . . $ std/::chronocxx . . $ std/chrono/::system_clockcxx . . $ std/chrono/_V2/system_clock#::time_pointcxx . . $ std/chrono/_V2/system_clock#time_point# not_beforecxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#not_before.; // `nbf` |
| 171 | stdcxx . . $ std/::chronocxx . . $ std/chrono/::system_clockcxx . . $ std/chrono/_V2/system_clock#::time_pointcxx . . $ std/chrono/_V2/system_clock#time_point# not_aftercxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#not_after.; // `exp` |
| 172 | |
| 173 | // Credential subject fields |
| 174 | UserInfoClaimscxx . . $ mlspp/hpke/UserInfoClaims# credential_subjectcxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#credential_subject.; |
| 175 | Signaturecxx . . $ mlspp/hpke/Signature#::PublicJWKcxx . . $ mlspp/hpke/Signature#PublicJWK# public_keycxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#public_key.; |
| 176 | |
| 177 | // Signature verification information |
| 178 | bytescxx . . $ mlspp/bytes_ns/bytes# to_be_signedcxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#to_be_signed.; |
| 179 | bytescxx . . $ mlspp/bytes_ns/bytes# signaturecxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#signature.; |
| 180 | |
| 181 | ParsedCredentialcxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#ParsedCredential(163372a20e0f136c).(const Signaturecxx . . $ mlspp/hpke/Signature#& signature_algorithm_in, |
| 182 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::stringcxx . . $ std/string#> key_id_in, |
| 183 | stdcxx . . $ std/::stringcxx . . $ std/string# issuer_in, |
| 184 | stdcxx . . $ std/::chronocxx . . $ std/chrono/::system_clockcxx . . $ std/chrono/_V2/system_clock#::time_pointcxx . . $ std/chrono/_V2/system_clock#time_point# not_before_in, |
| 185 | stdcxx . . $ std/::chronocxx . . $ std/chrono/::system_clockcxx . . $ std/chrono/_V2/system_clock#::time_pointcxx . . $ std/chrono/_V2/system_clock#time_point# not_after_in, |
| 186 | UserInfoClaimscxx . . $ mlspp/hpke/UserInfoClaims# credential_subject_in, |
| 187 | Signaturecxx . . $ mlspp/hpke/Signature#::PublicJWKcxx . . $ mlspp/hpke/Signature#PublicJWK#&& public_key_in, |
| 188 | bytescxx . . $ mlspp/bytes_ns/bytes# to_be_signed_in, |
| 189 | bytescxx . . $ mlspp/bytes_ns/bytes# signature_in) |
| 190 | : signature_algorithmcxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#signature_algorithm.(signature_algorithm_in) |
| 191 | , key_idcxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#key_id.(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(key_id_in)) |
| 192 | , issuercxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#issuer.(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(issuer_in)) |
| 193 | , not_beforecxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#not_before.(not_before_in) |
| 194 | , not_aftercxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#not_after.(not_after_in) |
| 195 | , credential_subjectcxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#credential_subject.(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(credential_subject_in)) |
| 196 | , public_keycxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#public_key.(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(public_key_in)) |
| 197 | , to_be_signedcxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#to_be_signed.(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(to_be_signed_in)) |
| 198 | , signaturecxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#signature.(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(signature_in)) |
| 199 | { |
| 200 | } |
| 201 | |
| 202 | static stdcxx . . $ std/::shared_ptrcxx . . $ std/shared_ptr#<ParsedCredentialcxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#> parsecxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#parse(9f5ea001c7df9a17).(const stdcxx . . $ std/::stringcxx . . $ std/string#& jwt) |
| 203 | { |
| 204 | // Split the JWT into its header, payload, and signature |
| 205 | const auto first_dot = jwt.find_first_ofcxx . . $ std/__cxx11/basic_string#find_first_of(2dda2fc6b78abe68).('.'); |
| 206 | const auto last_dot = jwt.find_last_ofcxx . . $ std/__cxx11/basic_string#find_last_of(2dda2fc6b78abe68).('.'); |
| 207 | if (first_dot == stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos. || last_dot == stdcxx . . $ std/::stringcxx . . $ std/string#::nposcxx . . $ std/__cxx11/basic_string#npos. || |
| 208 | first_dot == last_dot || last_dot > jwt.lengthcxx . . $ std/__cxx11/basic_string#length(6f8bd5c0ea8fb29a).() - 2) { |
| 209 | throw stdcxx . . $ std/::runtime_errorcxx . . $ std/runtime_error#("malformed JWT; not enough '.' characters"); |
| 210 | } |
| 211 | |
| 212 | const auto header_b64 = jwt.substrcxx . . $ std/__cxx11/basic_string#substr(149c655009c9bbd2).(0, first_dot); |
| 213 | const auto payload_b64 = |
| 214 | jwt.substrcxx . . $ std/__cxx11/basic_string#substr(149c655009c9bbd2).(first_dot + 1, last_dot - first_dot - 1); |
| 215 | const auto signature_b64 = jwt.substrcxx . . $ std/__cxx11/basic_string#substr(149c655009c9bbd2).(last_dot + 1); |
| 216 | |
| 217 | // Parse the components |
| 218 | const auto header = jsoncxx . . $ nlohmann/json_abi_v3_11_3/basic_json#::parsecxx . . $ nlohmann/json_abi_v3_11_3/basic_json#parse(7815a10c7f5973d5).(to_asciicxx . . $ mlspp/bytes_ns/to_ascii(b0627b6bf491e6e2).(from_base64urlcxx . . $ mlspp/hpke/from_base64url(fc01d114001b7256).(header_b64))); |
| 219 | const auto payload = jsoncxx . . $ nlohmann/json_abi_v3_11_3/basic_json#::parsecxx . . $ nlohmann/json_abi_v3_11_3/basic_json#parse(7815a10c7f5973d5).(to_asciicxx . . $ mlspp/bytes_ns/to_ascii(b0627b6bf491e6e2).(from_base64urlcxx . . $ mlspp/hpke/from_base64url(fc01d114001b7256).(payload_b64))); |
| 220 | |
| 221 | // Prepare the validation inputs |
| 222 | const auto hdr = headercxx . . $ nlohmann/json_abi_v3_11_3/basic_json#basic_json(fac1bdb7402697ed)..atcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#at(d0281d4ce311234f).("alg"); |
| 223 | const auto& sig = signature_from_algcxx . . $ mlspp/hpke/signature_from_alg(4ff0c1939554d24f).(hdr); |
| 224 | const auto to_be_signed = from_asciicxx . . $ mlspp/bytes_ns/from_ascii(fc01d114001b7256).(header_b64 +cxx . . $ std/operator+(40fc1db9226233c6). "." +cxx . . $ std/operator+(db5dc2ea912c6495). payload_b64); |
| 225 | auto signature = from_base64urlcxx . . $ mlspp/hpke/from_base64url(fc01d114001b7256).(signature_b64); |
| 226 | if (is_ecdsacxx . . $ mlspp/hpke/is_ecdsa(2de2ada66e3fbba2).(sig)) { |
| 227 | signature =cxx . . $ mlspp/bytes_ns/bytes#`operator=`(463b53a2545785ed). jws_to_der_sigcxx . . $ mlspp/hpke/jws_to_der_sig(dfba7759a1cb6e97).(signature); |
| 228 | } |
| 229 | |
| 230 | auto kid = stdcxx . . $ std/optional#optional(ced63f7c635d850d).::optionalcxx . . $ std/optional#<stdcxx . . $ std/::stringcxx . . $ std/string#>{}; |
| 231 | if (header.containscxx . . $ nlohmann/json_abi_v3_11_3/basic_json#contains(6573c7f34fbbc96d).("kid")) { |
| 232 | kid =cxx . . $ std/optional#`operator=`(4ce4dd0ee161fed). header.atcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#at(d0281d4ce311234f).("kid").getcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#get(c394accbd3204417).<stdcxx . . $ std/::stringcxx . . $ std/string#>(); |
| 233 | } |
| 234 | |
| 235 | // Verify the VC parts |
| 236 | const auto& vc = payload.atcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#at(d0281d4ce311234f).("vc"); |
| 237 | |
| 238 | static const auto context = |
| 239 | stdcxx . . $ std/vector#vector(9619226211e5a241).::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#>{ { "https://www.w3.org/2018/credentials/v1" } }; |
| 240 | const auto vc_context = vc.atcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#at(d0281d4ce311234f).("@context").getcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#get(c394accbd3204417).<stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#>>(); |
| 241 | if (vc_context !=cxx . . $ std/`operator!=`(a0a51a13f7e42509). context) { |
| 242 | throw stdcxx . . $ std/::runtime_errorcxx . . $ std/runtime_error#("malformed VC: incorrect context value"); |
| 243 | } |
| 244 | |
| 245 | static const auto type = stdcxx . . $ std/vector#vector(9619226211e5a241).::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#>{ |
| 246 | "VerifiableCredential", |
| 247 | "UserInfoCredential", |
| 248 | }; |
| 249 | if (vc.atcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#at(d0281d4ce311234f).("type") !=cxx . . $ nlohmann/json_abi_v3_11_3/`operator!=`(2ab6a57060aed4fa). typecxx . . $ nlohmann/json_abi_v3_11_3/basic_json#basic_json(ddc9d2076473eea4).) { |
| 250 | throw stdcxx . . $ std/::runtime_errorcxx . . $ std/runtime_error#("malformed VC: incorrect type value"); |
| 251 | } |
| 252 | |
| 253 | // Parse the subject public key |
| 254 | static const stdcxx . . $ std/::stringcxx . . $ std/string# did_jwk_prefix = "did:jwk:"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).; |
| 255 | const auto id = vc.atcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#at(d0281d4ce311234f).("credentialSubject").atcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#at(d0281d4ce311234f).("id").getcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#get(c394accbd3204417).<stdcxx . . $ std/::stringcxx . . $ std/string#>(); |
| 256 | if (id.findcxx . . $ std/__cxx11/basic_string#find(cabbe8683ddb9d2a).(did_jwk_prefix) != 0) { |
| 257 | throw stdcxx . . $ std/::runtime_errorcxx . . $ std/runtime_error#("malformed UserInfo VC: ID is not did:jwk"); |
| 258 | } |
| 259 | |
| 260 | const auto jwk = to_asciicxx . . $ mlspp/bytes_ns/to_ascii(b0627b6bf491e6e2).(from_base64urlcxx . . $ mlspp/hpke/from_base64url(fc01d114001b7256).(id.substrcxx . . $ std/__cxx11/basic_string#substr(149c655009c9bbd2).(did_jwk_prefix.sizecxx . . $ std/__cxx11/basic_string#size(6f8bd5c0ea8fb29a).()))); |
| 261 | auto public_key = Signaturecxx . . $ mlspp/hpke/Signature#::parse_jwkcxx . . $ mlspp/hpke/Signature#parse_jwk(13862ca891fb571b).(jwk); |
| 262 | |
| 263 | // Extract the salient parts |
| 264 | return stdcxx . . $ std/::make_sharedcxx . . $ std/make_shared(ffca0f3977536948).<ParsedCredentialcxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#>( |
| 265 | sig, |
| 266 | kid, |
| 267 | |
| 268 | payload.atcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#at(d0281d4ce311234f).("iss"), |
| 269 | epoch_timecxx . . $ mlspp/hpke/epoch_time(88ce396ce52b2fd7).(payload.atcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#at(d0281d4ce311234f).("nbf").getcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#get(c394accbd3204417).<int64_t>()), |
| 270 | epoch_timecxx . . $ mlspp/hpke/epoch_time(88ce396ce52b2fd7).(payload.atcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#at(d0281d4ce311234f).("exp").getcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#get(c394accbd3204417).<int64_t>()), |
| 271 | |
| 272 | UserInfoClaimscxx . . $ mlspp/hpke/UserInfoClaims#::from_jsoncxx . . $ mlspp/hpke/UserInfoClaims#from_json(410e794a9a4fced1).(vc.atcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#at(d0281d4ce311234f).("credentialSubject").dumpcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#dump(61153b17ba87d082).()), |
| 273 | stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(public_key), |
| 274 | |
| 275 | to_be_signed, |
| 276 | signature); |
| 277 | } |
| 278 | |
| 279 | bool verifycxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#verify(68c479f9e17007ee).(const Signaturecxx . . $ mlspp/hpke/Signature#::PublicKeycxx . . $ mlspp/hpke/Signature#PublicKey#& issuer_key) |
| 280 | { |
| 281 | return signature_algorithmcxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#signature_algorithm..verifycxx . . $ mlspp/hpke/Signature#verify(c2ebb5c61451baa6).(to_be_signedcxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#to_be_signed., signaturecxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#signature., issuer_key); |
| 282 | } |
| 283 | }; |
| 284 | |
| 285 | /// |
| 286 | /// UserInfoClaims |
| 287 | /// |
| 288 | UserInfoClaimscxx . . $ mlspp/hpke/UserInfoClaims# |
| 289 | UserInfoClaimscxx . . $ mlspp/hpke/UserInfoClaims#::from_jsoncxx . . $ mlspp/hpke/UserInfoClaims#from_json(410e794a9a4fced1).(const stdcxx . . $ std/::stringcxx . . $ std/string#& cred_subject) |
| 290 | { |
| 291 | const auto& cred_subject_json = nlohmanncxx . . $ nlohmann/::jsoncxx . . $ nlohmann/json_abi_v3_11_3/json#::parsecxx . . $ nlohmann/json_abi_v3_11_3/basic_json#parse(7815a10c7f5973d5).(cred_subject); |
| 292 | |
| 293 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<UserInfoClaimsAddresscxx . . $ mlspp/hpke/UserInfoClaimsAddress#> address_opt = {cxx . . $ std/optional#optional(ced63f7c635d850d).}; |
| 294 | |
| 295 | if (cred_subject_json.containscxx . . $ nlohmann/json_abi_v3_11_3/basic_json#contains(7bb4e7482c192e90).(address_attrcxx . . $ mlspp/hpke/address_attr.)) { |
| 296 | auto address_json = cred_subject_jsoncxx . . $ nlohmann/json_abi_v3_11_3/basic_json#basic_json(fac1bdb7402697ed)..atcxx . . $ nlohmann/json_abi_v3_11_3/basic_json#at(8ee77953f8f5258b).(address_attrcxx . . $ mlspp/hpke/address_attr.); |
| 297 | address_opt =cxx . . $ std/optional#`operator=`(4ce4dd0ee161fed). { |
| 298 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(address_json, address_formatted_attrcxx . . $ mlspp/hpke/address_formatted_attr.), |
| 299 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(address_json, address_street_address_attrcxx . . $ mlspp/hpke/address_street_address_attr.), |
| 300 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(address_json, address_locality_attrcxx . . $ mlspp/hpke/address_locality_attr.), |
| 301 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(address_json, address_region_attrcxx . . $ mlspp/hpke/address_region_attr.), |
| 302 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(address_json, address_postal_code_attrcxx . . $ mlspp/hpke/address_postal_code_attr.), |
| 303 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(address_json, address_country_attrcxx . . $ mlspp/hpke/address_country_attr.) |
| 304 | }; |
| 305 | } |
| 306 | |
| 307 | return { |
| 308 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(cred_subject_json, sub_attrcxx . . $ mlspp/hpke/sub_attr.), |
| 309 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(cred_subject_json, name_attrcxx . . $ mlspp/hpke/name_attr.), |
| 310 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(cred_subject_json, given_name_attrcxx . . $ mlspp/hpke/given_name_attr.), |
| 311 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(cred_subject_json, family_name_attrcxx . . $ mlspp/hpke/family_name_attr.), |
| 312 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(cred_subject_json, middle_name_attrcxx . . $ mlspp/hpke/middle_name_attr.), |
| 313 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(cred_subject_json, nickname_attrcxx . . $ mlspp/hpke/nickname_attr.), |
| 314 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(cred_subject_json, preferred_username_attrcxx . . $ mlspp/hpke/preferred_username_attr.), |
| 315 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(cred_subject_json, profile_attrcxx . . $ mlspp/hpke/profile_attr.), |
| 316 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(cred_subject_json, picture_attrcxx . . $ mlspp/hpke/picture_attr.), |
| 317 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(cred_subject_json, website_attrcxx . . $ mlspp/hpke/website_attr.), |
| 318 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(cred_subject_json, email_attrcxx . . $ mlspp/hpke/email_attr.), |
| 319 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<bool>(cred_subject_json, email_verified_attrcxx . . $ mlspp/hpke/email_verified_attr.), |
| 320 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(cred_subject_json, gender_attrcxx . . $ mlspp/hpke/gender_attr.), |
| 321 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(cred_subject_json, birthdate_attrcxx . . $ mlspp/hpke/birthdate_attr.), |
| 322 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(cred_subject_json, zoneinfo_attrcxx . . $ mlspp/hpke/zoneinfo_attr.), |
| 323 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(cred_subject_json, locale_attrcxx . . $ mlspp/hpke/locale_attr.), |
| 324 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<stdcxx . . $ std/::stringcxx . . $ std/string#>(cred_subject_json, phone_number_attrcxx . . $ mlspp/hpke/phone_number_attr.), |
| 325 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<bool>(cred_subject_json, phone_number_verified_attrcxx . . $ mlspp/hpke/phone_number_verified_attr.), |
| 326 | address_opt, |
| 327 | get_optionalcxx . . $ mlspp/hpke/get_optional(e947d95c6f909e7d).<uint64_tcxx . . $ uint64_t#>(cred_subject_json, updated_at_attrcxx . . $ mlspp/hpke/updated_at_attr.), |
| 328 | }; |
| 329 | } |
| 330 | |
| 331 | /// |
| 332 | /// UserInfoVC |
| 333 | /// |
| 334 | |
| 335 | UserInfoVCcxx . . $ mlspp/hpke/UserInfoVC#::UserInfoVCcxx . . $ mlspp/hpke/UserInfoVC#UserInfoVC(8d4ab0a187bf9331).(stdcxx . . $ std/::stringcxx . . $ std/string# jwt) |
| 336 | : parsed_credcxx . . $ mlspp/hpke/UserInfoVC#parsed_cred.(ParsedCredentialcxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#::parsecxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#parse(9f5ea001c7df9a17).(jwt)) |
| 337 | , rawcxx . . $ mlspp/hpke/UserInfoVC#raw.(stdcxx . . $ std/::movecxx . . $ std/move(e35c19a1ba7baa26).(jwt)) |
| 338 | { |
| 339 | } |
| 340 | |
| 341 | const Signaturecxx . . $ mlspp/hpke/Signature#& |
| 342 | UserInfoVCcxx . . $ mlspp/hpke/UserInfoVC#::signature_algorithmcxx . . $ mlspp/hpke/UserInfoVC#signature_algorithm(aab2196748eae221).() const |
| 343 | { |
| 344 | return parsed_credcxx . . $ mlspp/hpke/UserInfoVC#parsed_cred.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).signature_algorithmcxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#signature_algorithm.; |
| 345 | } |
| 346 | |
| 347 | stdcxx . . $ std/::stringcxx . . $ std/string# |
| 348 | UserInfoVCcxx . . $ mlspp/hpke/UserInfoVC#::issuercxx . . $ mlspp/hpke/UserInfoVC#issuer(219584694fe2b248).() const |
| 349 | { |
| 350 | return parsed_credcxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5).->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).issuercxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#issuer.; |
| 351 | } |
| 352 | |
| 353 | stdcxx . . $ std/::optionalcxx . . $ std/optional#<stdcxx . . $ std/::stringcxx . . $ std/string#> |
| 354 | UserInfoVCcxx . . $ mlspp/hpke/UserInfoVC#::key_idcxx . . $ mlspp/hpke/UserInfoVC#key_id(5ce91bc52c9d8e1).() const |
| 355 | { |
| 356 | return parsed_credcxx . . $ mlspp/hpke/UserInfoVC#parsed_cred.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).key_idcxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#key_id.; |
| 357 | } |
| 358 | |
| 359 | bool |
| 360 | UserInfoVCcxx . . $ mlspp/hpke/UserInfoVC#::valid_fromcxx . . $ mlspp/hpke/UserInfoVC#valid_from(f3d66fc16086329f).(const Signaturecxx . . $ mlspp/hpke/Signature#::PublicKeycxx . . $ mlspp/hpke/Signature#PublicKey#& issuer_key) const |
| 361 | { |
| 362 | return parsed_credcxx . . $ mlspp/hpke/UserInfoVC#parsed_cred.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).verifycxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#verify(68c479f9e17007ee).(issuer_key); |
| 363 | } |
| 364 | |
| 365 | const stdcxx . . $ std/::stringcxx . . $ std/string#& |
| 366 | UserInfoVCcxx . . $ mlspp/hpke/UserInfoVC#::raw_credentialcxx . . $ mlspp/hpke/UserInfoVC#raw_credential(f4fff0029955a25f).() const |
| 367 | { |
| 368 | return rawcxx . . $ mlspp/hpke/UserInfoVC#raw.; |
| 369 | } |
| 370 | |
| 371 | const UserInfoClaimscxx . . $ mlspp/hpke/UserInfoClaims#& |
| 372 | UserInfoVCcxx . . $ mlspp/hpke/UserInfoVC#::subjectcxx . . $ mlspp/hpke/UserInfoVC#subject(33ee42c4ca9162f).() const |
| 373 | { |
| 374 | return parsed_credcxx . . $ mlspp/hpke/UserInfoVC#parsed_cred.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).credential_subjectcxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#credential_subject.; |
| 375 | } |
| 376 | |
| 377 | stdcxx . . $ std/::chronocxx . . $ std/chrono/::system_clockcxx . . $ std/chrono/_V2/system_clock#::time_pointcxx . . $ std/chrono/_V2/system_clock#time_point# |
| 378 | UserInfoVCcxx . . $ mlspp/hpke/UserInfoVC#::not_beforecxx . . $ mlspp/hpke/UserInfoVC#not_before(f0cd7e640ad675c3).() const |
| 379 | { |
| 380 | return parsed_credcxx . . $ mlspp/hpke/UserInfoVC#parsed_cred.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).not_beforecxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#not_before.; |
| 381 | } |
| 382 | |
| 383 | stdcxx . . $ std/::chronocxx . . $ std/chrono/::system_clockcxx . . $ std/chrono/_V2/system_clock#::time_pointcxx . . $ std/chrono/_V2/system_clock#time_point# |
| 384 | UserInfoVCcxx . . $ mlspp/hpke/UserInfoVC#::not_aftercxx . . $ mlspp/hpke/UserInfoVC#not_after(f0cd7e640ad675c3).() const |
| 385 | { |
| 386 | return parsed_credcxx . . $ mlspp/hpke/UserInfoVC#parsed_cred.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).not_aftercxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#not_after.; |
| 387 | } |
| 388 | |
| 389 | const Signaturecxx . . $ mlspp/hpke/Signature#::PublicJWKcxx . . $ mlspp/hpke/Signature#PublicJWK#& |
| 390 | UserInfoVCcxx . . $ mlspp/hpke/UserInfoVC#::public_keycxx . . $ mlspp/hpke/UserInfoVC#public_key(49df469d8c60bc98).() const |
| 391 | { |
| 392 | return parsed_credcxx . . $ mlspp/hpke/UserInfoVC#parsed_cred.->cxx . . $ std/__shared_ptr_access#`operator->`(34d6acfd341ba7ab).public_keycxx . . $ mlspp/hpke/UserInfoVC#ParsedCredential#public_key.; |
| 393 | } |
| 394 | |
| 395 | bool |
| 396 | operatorcxx . . $ mlspp/hpke/`operator==`(7a95a1a1fce3ea9a).==(const UserInfoVCcxx . . $ mlspp/hpke/UserInfoVC#& lhs, const UserInfoVCcxx . . $ mlspp/hpke/UserInfoVC#& rhs) |
| 397 | { |
| 398 | return lhs.rawcxx . . $ mlspp/hpke/UserInfoVC#raw. ==cxx . . $ std/`operator==`(5ea818b58063a774). rhs.rawcxx . . $ mlspp/hpke/UserInfoVC#raw.; |
| 399 | } |
| 400 | |
| 401 | } // namespace mlspp::hpke |