SignatureHelper Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. device. auth. SignatureHelper
- com.
public final class SignatureHelper
Builds the authorization signature as a composition of functions.
Modifier | Constructor | Description | |
---|---|---|---|
protected |
Signature |
Modifier and Type | Method and Description |
---|---|
static byte[] |
build Builds the raw signature. |
static byte[] |
decode Decodes the device |
static byte[] |
encode Encodes the signature using Base64 and then further encodes the resulting string using UTF-8 encoding. |
static java.lang.String |
encode Encodes the signature using charset UTF-8. |
static java.lang.String |
encode Safely escapes characters in the signature so that they can be transmitted over the internet. |
static byte[] |
encrypt Encrypts the signature using HMAC-SHA256. |
SignatureHelper
protected SignatureHelper()
buildRawSignature
public static byte[] buildRawSignature(String resourceUri, long expiryTime)
Builds the raw signature.
Parameters:
Returns:
decodeDeviceKeyBase64
public static byte[] decodeDeviceKeyBase64(String deviceKey)
Decodes the deviceKey using Base64.
Parameters:
Returns:
encodeSignatureBase64
public static byte[] encodeSignatureBase64(byte[] sig)
Encodes the signature using Base64 and then further encodes the resulting string using UTF-8 encoding.
Parameters:
Returns:
encodeSignatureUtf8
public static String encodeSignatureUtf8(byte[] sig)
Encodes the signature using charset UTF-8.
Parameters:
Returns:
encodeSignatureWebSafe
public static String encodeSignatureWebSafe(String sig)
Safely escapes characters in the signature so that they can be transmitted over the internet. Replaces unsafe characters with a '%' followed by two hexadecimal digits (i.e. %2d).
Parameters:
Returns:
encryptSignatureHmacSha256
public static byte[] encryptSignatureHmacSha256(byte[] sig, byte[] deviceKey)
Encrypts the signature using HMAC-SHA256.
Parameters:
Returns:
Comentários do Azure SDK for Java
O Azure SDK for Java é um projeto código aberto. Selecione um link para fornecer comentários: