azure-docs-sdk-java/docs-ref-autogen/com.azure.core.credential.A...

80 строки
8.7 KiB
YAML

### YamlMime:JavaType
uid: "com.azure.core.credential.AzureSasCredential"
fullName: "com.azure.core.credential.AzureSasCredential"
name: "AzureSasCredential"
nameWithType: "AzureSasCredential"
summary: "Represents a credential that uses a shared access signature to authenticate to an Azure Service."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
methodsRef:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--\">clone</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-\">equals</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--\">finalize</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--\">getClass</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--\">hashCode</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--\">notify</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--\">notifyAll</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--\">toString</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-\">wait</a>"
syntax: "public final class **AzureSasCredential**"
constructors:
- uid: "com.azure.core.credential.AzureSasCredential.AzureSasCredential(java.lang.String)"
fullName: "com.azure.core.credential.AzureSasCredential.AzureSasCredential(String signature)"
name: "AzureSasCredential(String signature)"
nameWithType: "AzureSasCredential.AzureSasCredential(String signature)"
summary: "Creates a credential that authorizes request with the given shared access signature."
parameters:
- description: "The shared access signature used to authorize requests."
name: "signature"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public AzureSasCredential(String signature)"
desc: "Creates a credential that authorizes request with the given shared access signature.\n\nThe `signature` passed is assumed to be encoded. This constructor is effectively the same as calling <xref uid=\"com.azure.core.credential.AzureSasCredential.AzureSasCredential(java.lang.String,java.util.function.Function<java.lang.String,java.lang.String>)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"new AzureSasCredential(signature, null))\"></xref>."
- uid: "com.azure.core.credential.AzureSasCredential.AzureSasCredential(java.lang.String,java.util.function.Function<java.lang.String,java.lang.String>)"
fullName: "com.azure.core.credential.AzureSasCredential.AzureSasCredential(String signature, Function<String,String> signatureEncoder)"
name: "AzureSasCredential(String signature, Function<String,String> signatureEncoder)"
nameWithType: "AzureSasCredential.AzureSasCredential(String signature, Function<String,String> signatureEncoder)"
summary: "Creates a credential that authorizes request within the given shared access signature."
parameters:
- description: "The shared access signature used to authorize requests."
name: "signature"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- description: "An optional function which encodes the <code>signature</code>."
name: "signatureEncoder"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/util/function/Function.html\">Function</a>&lt;<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>,<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>&gt;"
syntax: "public AzureSasCredential(String signature, Function<String,String> signatureEncoder)"
desc: "Creates a credential that authorizes request within the given shared access signature.\n\nIf `signatureEncoder` is non-null the `signature`, and all <xref uid=\"#update(String)\" data-throw-if-not-resolved=\"false\" data-raw-source=\"updated\n signatures\"></xref>, will be encoded using the function. `signatureEncoder` should be as idempotent as possible to reduce the chance of double encoding errors."
methods:
- uid: "com.azure.core.credential.AzureSasCredential.getSignature()"
fullName: "com.azure.core.credential.AzureSasCredential.getSignature()"
name: "getSignature()"
nameWithType: "AzureSasCredential.getSignature()"
summary: "Retrieves the shared access signature associated to this credential."
syntax: "public String getSignature()"
desc: "Retrieves the shared access signature associated to this credential."
returns:
description: "The shared access signature being used to authorize requests."
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
- uid: "com.azure.core.credential.AzureSasCredential.update(java.lang.String)"
fullName: "com.azure.core.credential.AzureSasCredential.update(String signature)"
name: "update(String signature)"
nameWithType: "AzureSasCredential.update(String signature)"
summary: "Rotates the shared access signature associated to this credential."
parameters:
- description: "The new shared access signature to be associated with this credential."
name: "signature"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public AzureSasCredential update(String signature)"
desc: "Rotates the shared access signature associated to this credential."
returns:
description: "The updated <code>AzureSasCredential</code> object."
type: "<xref href=\"com.azure.core.credential.AzureSasCredential?alt=com.azure.core.credential.AzureSasCredential&text=AzureSasCredential\" data-throw-if-not-resolved=\"False\" />"
type: "class"
desc: "Represents a credential that uses a shared access signature to authenticate to an Azure Service. It is used for authenticating and authorizing access to Azure services using a shared access signature.\n\nA shared access signature is a string-based token that grants limited permissions and access to specific resources within an Azure service for a specified period. It allows you to provide time-limited access to your resources without sharing your account key or other sensitive credentials.\n\nThe <xref uid=\"com.azure.core.credential.AzureSasCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AzureSasCredential\"></xref> enables you to authenticate and access Azure services that support shared access signatures. By creating an instance of the <xref uid=\"com.azure.core.credential.AzureSasCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AzureSasCredential\"></xref> class and providing the SAS token as a parameter, you can use this credential to authenticate requests to Azure services.\n\nTo use the Credential, you typically pass it to the appropriate Azure client or service client builder during instantiation. The library internally handles the authentication process and includes the SAS token in the HTTP requests made to the Azure service, allowing you to access the resources specified in the SAS token.\n\nThe <xref uid=\"com.azure.core.credential.AzureSasCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AzureSasCredential\"></xref> is particularly useful when you need to grant temporary and limited access to specific resources, such as Azure Storage containers, blobs, queues, or files, without exposing your account key.\n\nIt's important to note that the availability and usage of the <xref uid=\"com.azure.core.credential.AzureSasCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"AzureSasCredential\"></xref> may depend on the specific Azure service and its support for shared access signatures. Additionally, the format and content of the SAS token may vary depending on the service and resource you are targeting.\n\n**Sample: Azure SAS Authentication**\n\nThe following code sample demonstrates the creation of a <xref uid=\"com.azure.core.credential.AzureSasCredential\" data-throw-if-not-resolved=\"false\" data-raw-source=\"com.azure.core.credential.AzureSasCredential\"></xref>, using the sas token to configure it.\n\n```java\nAzureSasCredential azureSasCredential =\n new AzureSasCredential(\"AZURE-SERVICE-SAS-KEY\");\n```"
metadata: {}
package: "com.azure.core.credential"
artifact: com.azure:azure-core:1.52.0