Microsoft Azure Storage Client Library for C++  7.5.0
The Microsoft Azure Storage Client Library for C++ is a library for working with the Azure Storage Services in C++.
Classes | Public Member Functions | List of all members
azure::storage::storage_credentials Class Reference

Represents a set of credentials used to authenticate access to a Windows Azure storage account. More...

Classes

class  account_key_credential
 
class  bearer_token_credential
 
class  sas_credential
 

Public Member Functions

 storage_credentials ()
 Initializes a new instance of the azure::storage::storage_credentials class. More...
 
 storage_credentials (utility::string_t account_name, const utility::string_t &account_key)
 Initializes a new instance of the azure::storage::storage_credentials class with the specified account name and key value. More...
 
 storage_credentials (utility::string_t account_name, std::vector< uint8_t > account_key)
 Initializes a new instance of the azure::storage::storage_credentials class with the specified account name and key value. More...
 
 storage_credentials (utility::string_t sas_token)
 Initializes a new instance of the azure::storage::storage_credentials class with the specified shared access signature token. More...
 
 storage_credentials (utility::string_t account_name, sas_credential sas_token)
 Initializes a new instance of the azure::storage::storage_credentials class with the specified account name and shared access signature token. More...
 
template<class T , typename std::enable_if< std::is_same< typename std::decay< T >::type, bearer_token_credential >::value >::type * = nullptr>
 storage_credentials (T &&token)
 Initializes a new instance of the azure::storage::storage_credentials class with the specified bearer token. More...
 
template<class T , typename std::enable_if< std::is_same< typename std::decay< T >::type, bearer_token_credential >::value >::type * = nullptr>
 storage_credentials (utility::string_t account_name, T &&token)
 Initializes a new instance of the azure::storage::storage_credentials class with the specified account name and bearer token. More...
 
template<class T , typename std::enable_if< std::is_same< typename std::decay< T >::type, storage_credentials >::value >::type * = nullptr>
 storage_credentials (T &&other)
 Initializes a new instance of the azure::storage::storage_credentials class based on an existing instance. More...
 
template<class T , typename std::enable_if< std::is_same< typename std::decay< T >::type, storage_credentials >::value >::type * = nullptr>
storage_credentialsoperator= (T &&other)
 Returns a reference to an azure::storage::storage_credentials object. More...
 
web::http::uri transform_uri (const web::http::uri &resource_uri) const
 Transforms a resource URI into a shared access signature URI, by appending a shared access token. More...
 
const utility::string_t & sas_token () const
 Gets the shared access signature token associated with the credentials. More...
 
const utility::string_t & account_name () const
 Gets the associated storage account name for the credentials. More...
 
const std::vector< uint8_t > & account_key () const
 Returns the key for the credentials. More...
 
void set_account_key (const utility::string_t &account_key)
 Sets the account key for the credentials. More...
 
void set_account_key (std::vector< uint8_t > account_key)
 Sets the account key for the credentials. More...
 
utility::string_t bearer_token () const
 Gets the bearer token for the credentials. More...
 
void set_bearer_token (utility::string_t bearer_token)
 Sets the bearer token for the credentials. More...
 
bool is_anonymous () const
 Indicates whether the credentials are for anonymous access. More...
 
bool is_sas () const
 Indicates whether the credentials are a shared access signature token. More...
 
bool is_shared_key () const
 Indicates whether the credentials are a shared key. More...
 
bool is_bearer_token () const
 Indicates whether the credentials are a bearer token. More...
 
bool is_account_key () const
 Indicates whether the credentials are an account key. More...
 

Detailed Description

Represents a set of credentials used to authenticate access to a Windows Azure storage account.

Constructor & Destructor Documentation

◆ storage_credentials() [1/8]

azure::storage::storage_credentials::storage_credentials ( )
inline

Initializes a new instance of the azure::storage::storage_credentials class.

◆ storage_credentials() [2/8]

azure::storage::storage_credentials::storage_credentials ( utility::string_t  account_name,
const utility::string_t &  account_key 
)
inline

Initializes a new instance of the azure::storage::storage_credentials class with the specified account name and key value.

Parameters
account_nameA string containing the name of the storage account.
account_keyA string containing the Base64-encoded account access key.

◆ storage_credentials() [3/8]

azure::storage::storage_credentials::storage_credentials ( utility::string_t  account_name,
std::vector< uint8_t >  account_key 
)
inline

Initializes a new instance of the azure::storage::storage_credentials class with the specified account name and key value.

Parameters
account_nameA string containing the name of the storage account.
account_keyAn array of bytes that represent the account access key.

◆ storage_credentials() [4/8]

azure::storage::storage_credentials::storage_credentials ( utility::string_t  sas_token)
inlineexplicit

Initializes a new instance of the azure::storage::storage_credentials class with the specified shared access signature token.

Parameters
sas_tokenA string containing the shared access signature token.

◆ storage_credentials() [5/8]

azure::storage::storage_credentials::storage_credentials ( utility::string_t  account_name,
sas_credential  sas_token 
)
inline

Initializes a new instance of the azure::storage::storage_credentials class with the specified account name and shared access signature token.

Parameters
account_nameA string containing the name of the storage account.
sas_tokenAn azure::storage::sas_credential containing shared access signature token.

◆ storage_credentials() [6/8]

template<class T , typename std::enable_if< std::is_same< typename std::decay< T >::type, bearer_token_credential >::value >::type * = nullptr>
azure::storage::storage_credentials::storage_credentials ( T &&  token)
inlineexplicit

Initializes a new instance of the azure::storage::storage_credentials class with the specified bearer token.

Parameters
tokenA azure::storage::storage_credentials::bearer_token_credential class containing bearer token.

◆ storage_credentials() [7/8]

template<class T , typename std::enable_if< std::is_same< typename std::decay< T >::type, bearer_token_credential >::value >::type * = nullptr>
azure::storage::storage_credentials::storage_credentials ( utility::string_t  account_name,
T &&  token 
)
inline

Initializes a new instance of the azure::storage::storage_credentials class with the specified account name and bearer token.

Parameters
account_nameA string containing the name of the storage account.
tokenA azure::storage::storage_credentials::bearer_token_credential class containing bearer token.

◆ storage_credentials() [8/8]

template<class T , typename std::enable_if< std::is_same< typename std::decay< T >::type, storage_credentials >::value >::type * = nullptr>
azure::storage::storage_credentials::storage_credentials ( T &&  other)
inline

Initializes a new instance of the azure::storage::storage_credentials class based on an existing instance.

Parameters
otherAn existing azure::storage::storage_credentials object.

Member Function Documentation

◆ account_key()

const std::vector<uint8_t>& azure::storage::storage_credentials::account_key ( ) const
inline

Returns the key for the credentials.

Returns
An array of bytes that contains the key.

◆ account_name()

const utility::string_t& azure::storage::storage_credentials::account_name ( ) const
inline

Gets the associated storage account name for the credentials.

Returns
The storage account name.

◆ bearer_token()

utility::string_t azure::storage::storage_credentials::bearer_token ( ) const
inline

Gets the bearer token for the credentials.

Returns
The bearer token

◆ is_account_key()

bool azure::storage::storage_credentials::is_account_key ( ) const
inline

Indicates whether the credentials are an account key.

Returns
true if the credentials are an account key; otherwise false.

◆ is_anonymous()

bool azure::storage::storage_credentials::is_anonymous ( ) const
inline

Indicates whether the credentials are for anonymous access.

Returns
true if the credentials are for anonymous access; otherwise, false.

◆ is_bearer_token()

bool azure::storage::storage_credentials::is_bearer_token ( ) const
inline

Indicates whether the credentials are a bearer token.

Returns
true if the credentials are a bearer token; otherwise false.

◆ is_sas()

bool azure::storage::storage_credentials::is_sas ( ) const
inline

Indicates whether the credentials are a shared access signature token.

Returns
true if the credentials are a shared access signature token; otherwise, false.

◆ is_shared_key()

bool azure::storage::storage_credentials::is_shared_key ( ) const
inline

Indicates whether the credentials are a shared key.

Returns
true if the credentials are a shared key; otherwise, false.

◆ operator=()

template<class T , typename std::enable_if< std::is_same< typename std::decay< T >::type, storage_credentials >::value >::type * = nullptr>
storage_credentials& azure::storage::storage_credentials::operator= ( T &&  other)
inline

Returns a reference to an azure::storage::storage_credentials object.

Parameters
otherAn existing azure::storage::storage_credentials object to use to set properties.
Returns
An azure::storage::storage_credentials object with properties set.

◆ sas_token()

const utility::string_t& azure::storage::storage_credentials::sas_token ( ) const
inline

Gets the shared access signature token associated with the credentials.

Returns
The shared access signature token.

◆ set_account_key() [1/2]

void azure::storage::storage_credentials::set_account_key ( const utility::string_t &  account_key)
inline

Sets the account key for the credentials.

Parameters
account_keyA string containing the Base64-encoded account access key.

◆ set_account_key() [2/2]

void azure::storage::storage_credentials::set_account_key ( std::vector< uint8_t >  account_key)
inline

Sets the account key for the credentials.

Parameters
account_keyAn array of bytes that represent the account access key.

◆ set_bearer_token()

void azure::storage::storage_credentials::set_bearer_token ( utility::string_t  bearer_token)
inline

Sets the bearer token for the credentials.

Parameters
bearer_tokenA string that contains bearer token.

◆ transform_uri()

web::http::uri azure::storage::storage_credentials::transform_uri ( const web::http::uri &  resource_uri) const
inline

Transforms a resource URI into a shared access signature URI, by appending a shared access token.

Parameters
resource_uriA web::http::uri object that represents the resource URI to be transformed.
Returns
A web::http::uri object that represents the signature, including the resource URI and the shared access token.