com.netease.cloud.auth
public abstract class AbstractStringSigner extends Object implements StringSigner
Constructor and Description |
---|
AbstractStringSigner() |
Modifier and Type | Method and Description |
---|---|
protected Credentials |
sanitizeCredentials(Credentials credentials)
Loads the individual access key ID and secret key from the specified
credentials, ensuring that access to the credentials is synchronized on
the credentials object itself, and trimming any extra whitespace from the
credentials.
|
protected byte[] |
sign(byte[] data,
byte[] key,
SigningAlgorithm algorithm) |
protected byte[] |
sign(String stringData,
byte[] key,
SigningAlgorithm algorithm) |
protected String |
signAndBase64Encode(byte[] data,
String key,
SigningAlgorithm algorithm)
Computes an RFC 2104-compliant HMAC signature for an array of bytes and
returns the result as a Base64 encoded string.
|
protected String |
signAndBase64Encode(String data,
String key,
SigningAlgorithm algorithm)
Computes an RFC 2104-compliant HMAC signature and returns the result as a
Base64 encoded string.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
sign
protected String signAndBase64Encode(String data, String key, SigningAlgorithm algorithm) throws ClientException
ClientException
protected String signAndBase64Encode(byte[] data, String key, SigningAlgorithm algorithm) throws ClientException
ClientException
protected byte[] sign(String stringData, byte[] key, SigningAlgorithm algorithm) throws ClientException
ClientException
protected byte[] sign(byte[] data, byte[] key, SigningAlgorithm algorithm) throws ClientException
ClientException
protected Credentials sanitizeCredentials(Credentials credentials)
Returns either a BasicSessionCredentials
or a
BasicCredentials
object, depending on the input type.
credentials
- Copyright © 2017. All Rights Reserved.