question

yojisato-5201 avatar image
0 Votes"
yojisato-5201 asked yojisato-5201 commented

About the use of base64 encoding and decoding functions in the Azure RTOS environment

Currently we are trying to build a web server function using NetXduo's HTTP server on Azure RTOS. And we would like to use the base64 encoding and decoding functions.

After a little research, it seems that there are the following APIs. Is it okay to use this for the base64 encoding / decoding function on the application side of the web server?

"netxduo \ common \ inc"
-Nx_api.h (3914,18): UINT _nx_utility_base64_encode (UCHAR name, UINT name_size, UCHAR base64name, UINT base64name_size, UINT bytes_copied);
-Nx_api.h (3915,18): UINT _nx_utility_base64_decode (UCHAR
base64name, UINT base64name_size, UCHAR name, UINT name_size, UINT bytes_copied);

If not, is there another way?

azure-rtos
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

asergaz avatar image
0 Votes"
asergaz answered yojisato-5201 commented

Hello @yojisato-5201 ,
From source code I can see that nx_web_http_server.c is making use of the utility_base64_decode: https://github.com/azure-rtos/netxduo/blob/master/addons/web/nx_web_http_server.c#L5244

Therefore I don't see a reason not to use it in the web server you are building. Have you experienced any issues doing so?

Read also: Chapter 1 - Introduction to Azure RTOS NetX Duo HTTP | Microsoft Docs

HTTP authentication is optional and isn’t required for all Web requests. There are two flavors of authentication, namely basic and digest. Basic authentication is equivalent to the name and password authentication found in many protocols. In HTTP basic authentication, the name and passwords are concatenated and encoded in the base64 format.

Thank you!


Remember:
- Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.
- Want a reminder to come back and check responses? Here is how to subscribe to a notification.




· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello asergaz san,

I'm sorry I couldn't convey the intent of the question well.

We just want to use the base64 encoding and decoding capabilities as our application.

So, I would like to see if there is any problem with using NetX's internal function (_nx_utility_base64_encode() and _nx_utility_base64_decode()) to achieve that functionality.

Best regards,

1 Vote 1 ·
asergaz avatar image asergaz yojisato-5201 ·

Hello @yojisato-5201 ,

Despite these functions are used internally, there is no reason not to use them in your user application :).

Let us know if you encounter any issue doing so?

Thanks!

0 Votes 0 ·

Hello @yojisato-5201 ,

Please share with us if you have any other questions related with your original post. Otherwise could you go ahead and mark the above as answer?

Thank you so much.

Remember:
- Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.

0 Votes 0 ·
Show more comments