Class star::AWSV4Signer¶
ClassList > star > AWSV4Signer
AWS Signature Version 4 signer. More...
#include <stards.h>
Public Functions¶
| Type | Name |
|---|---|
| AWSV4Signer (const std::string & access_key, const std::string & secret_key, const std::string & region, const std::string & session_token="") |
|
| const std::string & | getSessionToken () const |
| std::string | signRequest (const std::string & method, const std::string & bucket, const std::string & key, const std::string & content_hash, const std::map< std::string, std::string > & headers) const Sign an S3 request using AWS Signature Version 4. |
Public Static Functions¶
| Type | Name |
|---|---|
| std::string | hexEncode (const unsigned char * data, size_t len) Convert binary data to hex string (public utility). |
| std::string | urlEncode (const std::string & value) |
Detailed Description¶
Implements AWS SigV4 authentication for S3 requests. Uses OpenSSL for the SHA-256 / HMAC-SHA256 primitives on native builds and mbedTLS under WebAssembly (see the s3crypto shim above). This provides authentication without requiring the full AWS SDK.
Public Functions Documentation¶
function AWSV4Signer¶
inline star::AWSV4Signer::AWSV4Signer (
const std::string & access_key,
const std::string & secret_key,
const std::string & region,
const std::string & session_token=""
)
function getSessionToken¶
function signRequest¶
Sign an S3 request using AWS Signature Version 4.
inline std::string star::AWSV4Signer::signRequest (
const std::string & method,
const std::string & bucket,
const std::string & key,
const std::string & content_hash,
const std::map< std::string, std::string > & headers
) const
Parameters:
methodHTTP method (GET, PUT, etc.)bucketS3 bucket namekeyS3 object keycontent_hashSHA256 hash of request body (hex-encoded)headersRequest headers (must include host and x-amz-date)
Returns:
Authorization header value
Public Static Functions Documentation¶
function hexEncode¶
Convert binary data to hex string (public utility).
function urlEncode¶
The documentation for this class was generated from the following file StarDS/include/stards.h