log("f_http_build_inner_ec_request: Public encryption key: ",v_public_enc_key);
log("f_http_build_inner_ec_request: Public encryption key comp: ",v_compressed_enc_key_mode);
p_salt:=vc_eaWholeHash;
p_salt:=vc_eaWholeHash256;// IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3.
if(PICS_SECPKI_REENROLMENT==false){// This is the first enrolment, we used Factory keys
log("f_http_build_inner_ec_request_with_wrong_parameters: Public encryption key: ",v_public_enc_key);
log("f_http_build_inner_ec_request_with_wrong_parameters: Public encryption key comp: ",v_compressed_enc_key_mode);
p_salt:=vc_eaWholeHash;
p_salt:=vc_eaWholeHash256;// IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3.
if(PICS_SECPKI_REENROLMENT==false){// This is the first enrolment, we used Factory keys
log("*** f_http_build_invalid_enrolment_request: Public encryption key: ",v_public_enc_key);
log("*** f_http_build_invalid_enrolment_request: Public encryption key comp: ",v_compressed_enc_key_mode);
p_salt:=vc_eaWholeHash;
p_salt:=vc_eaWholeHash256;// IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3.
if(PICS_SECPKI_REENROLMENT==false){// This is the first enrolment, we used Factory keys
log("*** f_http_build_authorization_request: Public encryption key: ",v_public_enc_key);
log("*** f_http_build_authorization_request: Public encryption key comp: ",v_compressed_enc_key_mode);
p_salt:=vc_aaWholeHash;
p_salt:=vc_aaWholeHash256;// IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3.
log("*** f_http_build_authorization_request_with_wrong_private_key: Public encryption key: ",v_public_enc_key);
log("*** f_http_build_authorization_request_with_wrong_private_key: Public encryption key comp: ",v_compressed_enc_key_mode);
p_salt:=vc_aaWholeHash;
p_salt:=vc_aaWholeHash256;// IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3.
log("*** f_http_build_authorization_request_with_wrong_parameters: Public encryption key: ",v_public_enc_key);
log("*** f_http_build_authorization_request_with_wrong_parameters: Public encryption key comp: ",v_compressed_enc_key_mode);
p_salt:=vc_aaWholeHash;
p_salt:=vc_aaWholeHash256;// IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3.
log("f_http_build_authorization_validation_request: Public encryption key: ",v_public_enc_key);
log("f_http_build_authorization_validation_request: Public encryption key comp: ",v_compressed_enc_key_mode);
p_salt:=vc_eaWholeHash;
p_salt:=vc_eaWholeHash256;// IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3.
log("f_http_build_invalid_authorization_validation_request: Public encryption key: ",v_public_enc_key);
log("f_http_build_invalid_authorization_validation_request: Public encryption key comp: ",v_compressed_enc_key_mode);
p_salt:=vc_eaWholeHash;
p_salt:=vc_eaWholeHash256;// IEEE 1609.2: If the encryption key was obtained from a certificate c, P1 is SHA-256 (c), where c is the COER encoding of the certificate, canonicalized per 6.4.3.
if(f_verify_pki_request_message(vc_eaPrivateEncKey,vc_eaWholeHash/*salt*/,vc_eaWholeHash,v_request.request.body.binary_body.ieee1609dot2_data,false,v_request_hash,v_etsi_ts_102941_data,v_aes_enc_key)==false){// Cannot decrypt the message
if(f_verify_pki_request_message(vc_eaPrivateEncKey,vc_eaWholeHash/*salt*/,''O,v_request.request.body.binary_body.ieee1609dot2_data,false,v_request_hash,v_etsi_ts_102941_data,v_aes_enc_key)==false){// Cannot decrypt the message
log("f_await_ec_request_send_response: Failed to verify PKI message ***");
// Send error message
v_response:=m_http_response(m_http_response_ko(m_http_message_body_binary(m_binary_body_ieee1609dot2_data(v_ieee1609dot2_signed_and_encrypted_data)),v_headers,400,"Bad request"));// Initialize v_reponse with an error message