AccountSasSignatureValues Class
- java.
lang. Object - com.
azure. storage. common. sas. AccountSasSignatureValues
- com.
public final class AccountSasSignatureValues
Used to initialize parameters for a Shared Access Signature (SAS) for an Azure Storage account. Once all the values here are set, use the generateSas method on the desired service client to obtain a representation of the SAS which can then be applied to a new client using the .sasToken(String) method on the desired client builder.
Constructor Summary
Constructor | Description |
---|---|
AccountSasSignatureValues() |
Deprecated
Please use #AccountSasSignatureValues(OffsetDateTime, AccountSasPermission, AccountSasService,
AccountSasResourceType)
Initializes a new AccountSasSignatureValues object. |
AccountSasSignatureValues(OffsetDateTime expiryTime, AccountSasPermission permissions, AccountSasService services, AccountSasResourceType resourceTypes) |
Initializes a new AccountSasSignatureValues object. |
Method Summary
Modifier and Type | Method and Description |
---|---|
Account |
generateSasQueryParameters(StorageSharedKeyCredential storageSharedKeyCredentials)
Deprecated
Please use the generate
Generates a AccountSasQueryParameters object which contains all SAS query parameters for authenticating requests. |
String |
getEncryptionScope()
Gets the encryption scope that will be applied to any write operations performed with the sas |
Offset |
getExpiryTime()
Gets the time after which the SAS will no longer work. |
String |
getPermissions()
Gets the operations the SAS user may perform. |
Sas |
getProtocol()
Gets the SasProtocol which determines the HTTP protocol that will be used. |
String |
getResourceTypes()
Gets the resource types accessible with this SAS. |
Sas |
getSasIpRange()
Gets the SasIpRange which determines the IP ranges that are allowed to use the SAS. |
String |
getServices()
Gets the services accessible with this SAS. |
Offset |
getStartTime()
Gets when the SAS will take effect. |
String |
getVersion()
Gets the service version that is targeted, if |
Account |
setEncryptionScope(String encryptionScope)
Sets the encryption scope that will be applied to any write operations performed with the sas |
Account |
setExpiryTime(OffsetDateTime expiryTime)
Deprecated
Please use #AccountSasSignatureValues(OffsetDateTime, AccountSasPermission, AccountSasService,
AccountSasResourceType) to specify the expiry time.
Sets the time after which the SAS will no longer work. |
Account |
setPermissions(AccountSasPermission permissions)
Deprecated
Please use #AccountSasSignatureValues(OffsetDateTime, AccountSasPermission, AccountSasService,
AccountSasResourceType) to specify the allowed permissions.
Sets the operations the account SAS user may perform. |
Account |
setProtocol(SasProtocol protocol)
Sets the SasProtocol which determines the HTTP protocol that will be used. |
Account |
setResourceTypes(String resourceTypes)
Deprecated
Please use #AccountSasSignatureValues(OffsetDateTime, AccountSasPermission, AccountSasService,
AccountSasResourceType) to specify the resource types being targeted.
Sets the resource types accessible with this SAS. |
Account |
setSasIpRange(SasIpRange sasIpRange)
Sets the SasIpRange which determines the IP ranges that are allowed to use the SAS. |
Account |
setServices(String services)
Deprecated
Please use #AccountSasSignatureValues(OffsetDateTime, AccountSasPermission, AccountSasService,
AccountSasResourceType) to specify the services being targeted.
Sets the services accessible with this SAS. |
Account |
setStartTime(OffsetDateTime startTime)
Sets when the SAS will take effect. |
Account |
setVersion(String version)
Deprecated
The version is set to the latest version of sas. Users should stop calling this API as it is now treated as a no-op.
Sets the service version that is targeted. |
Methods inherited from java.lang.Object
Constructor Details
AccountSasSignatureValues
@Deprecated
public AccountSasSignatureValues()
Deprecated
Initializes a new AccountSasSignatureValues object.
AccountSasSignatureValues
public AccountSasSignatureValues(OffsetDateTime expiryTime, AccountSasPermission permissions, AccountSasService services, AccountSasResourceType resourceTypes)
Initializes a new AccountSasSignatureValues object.
Parameters:
Method Details
generateSasQueryParameters
@Deprecated
public AccountSasQueryParameters generateSasQueryParameters(StorageSharedKeyCredential storageSharedKeyCredentials)
Deprecated
Generates a AccountSasQueryParameters object which contains all SAS query parameters for authenticating requests.
Notes on SAS generation
If setVersion(String version) is not set, the latest service version is used.
The following parameters are required to generate a SAS:
For samples, see class level JavaDocs.
Parameters:
Returns:
getEncryptionScope
public String getEncryptionScope()
Gets the encryption scope that will be applied to any write operations performed with the sas
Returns:
getExpiryTime
public OffsetDateTime getExpiryTime()
Gets the time after which the SAS will no longer work.
Returns:
getPermissions
public String getPermissions()
Gets the operations the SAS user may perform.
Returns:
getProtocol
public SasProtocol getProtocol()
Gets the SasProtocol which determines the HTTP protocol that will be used.
Returns:
getResourceTypes
public String getResourceTypes()
Gets the resource types accessible with this SAS. Please refer to AccountSasResourceType to help determine the resource types that are accessible.
Returns:
getSasIpRange
public SasIpRange getSasIpRange()
Gets the SasIpRange which determines the IP ranges that are allowed to use the SAS.
Returns:
getServices
public String getServices()
Gets the services accessible with this SAS. Please refer to AccountSasService to help determine which services are accessible.
Returns:
getStartTime
public OffsetDateTime getStartTime()
Gets when the SAS will take effect.
Returns:
getVersion
public String getVersion()
Gets the service version that is targeted, if null
or empty the latest service version targeted by the library will be used.
Returns:
null
or empty the latest service version targeted by the
library will be used.setEncryptionScope
public AccountSasSignatureValues setEncryptionScope(String encryptionScope)
Sets the encryption scope that will be applied to any write operations performed with the sas
Parameters:
Returns:
setExpiryTime
@Deprecated
public AccountSasSignatureValues setExpiryTime(OffsetDateTime expiryTime)
Deprecated
Sets the time after which the SAS will no longer work.
Parameters:
Returns:
setPermissions
@Deprecated
public AccountSasSignatureValues setPermissions(AccountSasPermission permissions)
Deprecated
Sets the operations the account SAS user may perform. Please refer to AccountSasPermission for help constructing the permissions string.
Parameters:
Returns:
setProtocol
public AccountSasSignatureValues setProtocol(SasProtocol protocol)
Sets the SasProtocol which determines the HTTP protocol that will be used.
Parameters:
Returns:
setResourceTypes
@Deprecated
public AccountSasSignatureValues setResourceTypes(String resourceTypes)
Deprecated
Sets the resource types accessible with this SAS. Please refer to AccountSasResourceType to construct this value.
Parameters:
Returns:
setSasIpRange
public AccountSasSignatureValues setSasIpRange(SasIpRange sasIpRange)
Sets the SasIpRange which determines the IP ranges that are allowed to use the SAS.
Parameters:
Returns:
setServices
@Deprecated
public AccountSasSignatureValues setServices(String services)
Deprecated
Sets the services accessible with this SAS. Please refer to AccountSasService to construct this value.
Parameters:
Returns:
setStartTime
public AccountSasSignatureValues setStartTime(OffsetDateTime startTime)
Sets when the SAS will take effect.
Parameters:
Returns:
setVersion
@Deprecated
public AccountSasSignatureValues setVersion(String version)
Deprecated
Sets the service version that is targeted. Leave this null
or empty to target the version used by the library.
Parameters:
Returns:
Applies to
Azure SDK for Java