com.amazonaws.auth

## クラス AbstractAWSSigner

- java.lang.Object
- - com.amazonaws.auth.AbstractAWSSigner

- すべての実装されたインタフェース:
    Signer
  直系の既知のサブクラス:
    AWS3Signer, AWS4Signer, CloudFrontSigner, QueryStringSigner, S3QueryStringSigner, S3Signer

      public abstract class AbstractAWSSigner
      extends java.lang.Object
      implements Signer

  Abstract base class for AWS signing protocol implementations. Provides utilities commonly needed by signing protocols such as computing canonicalized host names, query string parameters, etc.

  Not intended to be sub-classed by developers.

- - ### フィールドの概要

    フィールド
    修飾子とタイプ | フィールドと説明
    --- | ---
    `protected static java.lang.String` | `DEFAULT_ENCODING` The default encoding to use when URL encoding

  - ### コンストラクタの概要

    コンストラクタ
    コンストラクタと説明
    `AbstractAWSSigner()`

  - ### メソッドの概要

    メソッド
    修飾子とタイプ | メソッドと説明
    --- | ---
    `protected abstract void` | `addSessionCredentials(Request<?> request, AWSSessionCredentials credentials)` Adds session credentials to the request given.
    `protected byte[]` | `getBinaryRequestPayload(Request<?> request)` Returns the request's payload as binary data.
    `protected java.io.InputStream` | `getBinaryRequestPayloadStream(Request<?> request)`
    `protected java.io.InputStream` | `getBinaryRequestPayloadStreamWithoutQueryParams(Request<?> request)`
    `protected byte[]` | `getBinaryRequestPayloadWithoutQueryParams(Request<?> request)` Returns the request's payload contents as binary data, without processing any query string params (i.e. no form encoding for query params).
    `protected java.lang.String` | `getCanonicalizedEndpoint(java.net.URI endpoint)`
    `protected java.lang.String` | `getCanonicalizedQueryString(java.util.Map<java.lang.String,java.lang.String> parameters)` Examines the specified query string parameters and returns a canonicalized form.
    `protected java.lang.String` | `getCanonicalizedQueryString(Request<?> request)`
    `protected java.lang.String` | `getCanonicalizedResourcePath(java.lang.String resourcePath)`
    `protected java.lang.String` | `getRequestPayload(Request<?> request)` Returns the request's payload as a String.
    `protected java.lang.String` | `getRequestPayloadWithoutQueryParams(Request<?> request)` Returns the request's payload contents as a String, without processing any query string params (i.e. no form encoding for query params).
    `protected java.util.Date` | `getSignatureDate(int timeOffset)`
    `protected int` | `getTimeOffset(Request<?> request)`
    `byte[]` | `hash(byte[] data)` Hashes the binary data using the SHA-256 algorithm.
    `protected byte[]` | `hash(java.io.InputStream input)`
    `byte[]` | `hash(java.lang.String text)` Hashes the string contents (assumed to be UTF-8) using the SHA-256 algorithm.
    `protected java.lang.String` | `newString(byte[] bytes)` Safely converts a UTF-8 encoded byte array into a String.
    `protected AWSCredentials` | `sanitizeCredentials(AWSCredentials 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)`
    `byte[]` | `sign(java.lang.String stringData, byte[] key, SigningAlgorithm algorithm)`
    `protected java.lang.String` | `signAndBase64Encode(byte[] data, java.lang.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 java.lang.String` | `signAndBase64Encode(java.lang.String data, java.lang.String key, SigningAlgorithm algorithm)` Computes an RFC 2104-compliant HMAC signature and returns the result as a Base64 encoded string.

    - ### クラスから継承されたメソッド java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### インタフェースから継承されたメソッド com.amazonaws.auth.Signer

      `sign`

- - ### フィールドの詳細

    - #### DEFAULT_ENCODING

          protected static final java.lang.String DEFAULT_ENCODING

      The default encoding to use when URL encoding
      関連項目:
        定数フィールド値

  - ### コンストラクタの詳細

    - #### AbstractAWSSigner

          public AbstractAWSSigner()

  - ### メソッドの詳細

    - #### signAndBase64Encode

          protected java.lang.String signAndBase64Encode(java.lang.String data,
                                             java.lang.String key,
                                             SigningAlgorithm algorithm)
                                                  throws AmazonClientException

      Computes an RFC 2104-compliant HMAC signature and returns the result as a Base64 encoded string.
      例外:
        `AmazonClientException`

    - #### signAndBase64Encode

          protected java.lang.String signAndBase64Encode(byte[] data,
                                             java.lang.String key,
                                             SigningAlgorithm algorithm)
                                                  throws AmazonClientException

      Computes an RFC 2104-compliant HMAC signature for an array of bytes and returns the result as a Base64 encoded string.
      例外:
        `AmazonClientException`

    - #### sign

          public byte[] sign(java.lang.String stringData,
                    byte[] key,
                    SigningAlgorithm algorithm)
                      throws AmazonClientException

      例外:
        `AmazonClientException`

    - #### sign

          protected byte[] sign(byte[] data,
                    byte[] key,
                    SigningAlgorithm algorithm)
                         throws AmazonClientException

      例外:
        `AmazonClientException`

    - #### hash

          public byte[] hash(java.lang.String text)
                      throws AmazonClientException

      Hashes the string contents (assumed to be UTF-8) using the SHA-256 algorithm.
      パラメータ:
        `text` - The string to hash.
      戻り値:
        The hashed bytes from the specified string.
      例外:
        `AmazonClientException` - If the hash cannot be computed.

    - #### hash

          protected byte[] hash(java.io.InputStream input)
                         throws AmazonClientException

      例外:
        `AmazonClientException`

    - #### hash

          public byte[] hash(byte[] data)
                      throws AmazonClientException

      Hashes the binary data using the SHA-256 algorithm.
      パラメータ:
        `data` - The binary data to hash.
      戻り値:
        The hashed bytes from the specified data.
      例外:
        `AmazonClientException` - If the hash cannot be computed.

    - #### getCanonicalizedQueryString

          protected java.lang.String getCanonicalizedQueryString(java.util.Map<java.lang.String,java.lang.String> parameters)

      Examines the specified query string parameters and returns a canonicalized form.

      The canonicalized query string is formed by first sorting all the query string parameters, then URI encoding both the key and value and then joining them, in order, separating key value pairs with an '&'.

      パラメータ:
        `parameters` - The query string parameters to be canonicalized.
      戻り値:
        A canonicalized form for the specified query string parameters.

    - #### getCanonicalizedQueryString

          protected java.lang.String getCanonicalizedQueryString(Request<?> request)

    - #### getBinaryRequestPayload

          protected byte[] getBinaryRequestPayload(Request<?> request)

      Returns the request's payload as binary data.
      パラメータ:
        `request` - The request
      戻り値:
        The data from the request's payload, as binary data.

    - #### getRequestPayload

          protected java.lang.String getRequestPayload(Request<?> request)

      Returns the request's payload as a String.
      パラメータ:
        `request` - The request
      戻り値:
        The data from the request's payload, as a string.

    - #### getRequestPayloadWithoutQueryParams

          protected java.lang.String getRequestPayloadWithoutQueryParams(Request<?> request)

      Returns the request's payload contents as a String, without processing any query string params (i.e. no form encoding for query params).
      パラメータ:
        `request` - The request
      戻り値:
        the request's payload contents as a String, not including any form encoding of query string params.

    - #### getBinaryRequestPayloadWithoutQueryParams

          protected byte[] getBinaryRequestPayloadWithoutQueryParams(Request<?> request)

      Returns the request's payload contents as binary data, without processing any query string params (i.e. no form encoding for query params).
      パラメータ:
        `request` - The request
      戻り値:
        The request's payload contents as binary data, not including any form encoding of query string params.

    - #### getBinaryRequestPayloadStream

          protected java.io.InputStream getBinaryRequestPayloadStream(Request<?> request)

    - #### getBinaryRequestPayloadStreamWithoutQueryParams

          protected java.io.InputStream getBinaryRequestPayloadStreamWithoutQueryParams(Request<?> request)

    - #### getCanonicalizedResourcePath

          protected java.lang.String getCanonicalizedResourcePath(java.lang.String resourcePath)

    - #### getCanonicalizedEndpoint

          protected java.lang.String getCanonicalizedEndpoint(java.net.URI endpoint)

    - #### sanitizeCredentials

          protected AWSCredentials sanitizeCredentials(AWSCredentials 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.

      Returns either a `BasicSessionCredentials` or a `BasicAWSCredentials` object, depending on the input type.

      パラメータ:
        `credentials` -
      戻り値:
        A new credentials object with the sanitized credentials.

    - #### newString

          protected java.lang.String newString(byte[] bytes)

      Safely converts a UTF-8 encoded byte array into a String.
      パラメータ:
        `bytes` - UTF-8 encoded binary character data.
      戻り値:
        The converted String object.

    - #### getSignatureDate

          protected java.util.Date getSignatureDate(int timeOffset)

    - #### getTimeOffset

          protected int getTimeOffset(Request<?> request)

    - #### addSessionCredentials

          protected abstract void addSessionCredentials(Request<?> request,
                                   AWSSessionCredentials credentials)

      Adds session credentials to the request given.
      パラメータ:
        `request` - The request to add session credentials information to
        `credentials` - The session credentials to add to the request