com.amazonaws.auth

## クラス AWS4Signer

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

- すべての実装されたインタフェース:
    Signer

      public class AWS4Signer
      extends AbstractAWSSigner

  Signer implementation that signs requests with the AWS4 signing protocol.

- - ### ネストされたクラスの概要

    ネストされたクラス
    修飾子とタイプ | クラスと説明
    --- | ---
    `protected class` | `AWS4Signer.HeaderSigningResult`

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

    フィールド
    修飾子とタイプ | フィールドと説明
    --- | ---
    `protected static java.lang.String` | `ALGORITHM`
    `protected static org.apache.commons.logging.Log` | `log`
    `protected java.util.Date` | `overriddenDate` Date override for testing only
    `protected java.lang.String` | `regionName` Region name override for use when the endpoint can't be used to determine the region name.
    `protected java.lang.String` | `serviceName` Service name override for use when the endpoint can't be used to determine the service name.
    `protected static java.lang.String` | `TERMINATOR`

    - ### クラスから継承されたフィールド com.amazonaws.auth.AbstractAWSSigner

      `DEFAULT_ENCODING`

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

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

  - ### メソッドの概要

    メソッド
    修飾子とタイプ | メソッドと説明
    --- | ---
    `protected void` | `addHostHeader(Request<?> request)`
    `protected void` | `addSessionCredentials(Request<?> request, AWSSessionCredentials credentials)` Adds session credentials to the request given.
    `protected java.lang.String` | `calculateContentHash(Request<?> request)` Calculate the hash of the request's payload.
    `protected AWS4Signer.HeaderSigningResult` | `computeSignature(Request<?> request, java.util.Date date, java.lang.String algorithm, java.lang.String contentSha256, AWSCredentials sanitizedCredentials)`
    `protected java.lang.String` | `extractRegionName(java.net.URI endpoint)`
    `protected java.lang.String` | `extractServiceName(java.net.URI endpoint)`
    `protected java.lang.String` | `getCanonicalizedHeaderString(Request<?> request)`
    `protected java.lang.String` | `getCanonicalRequest(Request<?> request, java.lang.String contentSha256)`
    `protected java.util.Date` | `getDateFromRequest(Request<?> request)`
    `protected java.lang.String` | `getDateStamp(java.util.Date date)`
    `protected java.lang.String` | `getDateTimeStamp(java.util.Date date)`
    `protected java.lang.String` | `getScope(Request<?> request, java.util.Date date)`
    `protected java.lang.String` | `getSignedHeadersString(Request<?> request)`
    `protected java.lang.String` | `getStringToSign(java.lang.String algorithm, java.lang.String dateTime, java.lang.String scope, java.lang.String canonicalRequest)`
    `protected void` | `processRequestPayload(Request<?> request, AWS4Signer.HeaderSigningResult headerSigningResult)` Subclass could override this method to perform any additional procedure on the request payload, with access to the result from signing the header.
    `void` | `setRegionName(java.lang.String regionName)` Sets the region name that this signer should use when calculating request signatures.
    `void` | `setServiceName(java.lang.String serviceName)` Sets the service name that this signer should use when calculating request signatures.
    `void` | `sign(Request<?> request, AWSCredentials credentials)`

    - ### クラスから継承されたメソッド com.amazonaws.auth.AbstractAWSSigner

      `getBinaryRequestPayload, getBinaryRequestPayloadStream, getBinaryRequestPayloadStreamWithoutQueryParams, getBinaryRequestPayloadWithoutQueryParams, getCanonicalizedEndpoint, getCanonicalizedQueryString, getCanonicalizedQueryString, getCanonicalizedResourcePath, getRequestPayload, getRequestPayloadWithoutQueryParams, getSignatureDate, getTimeOffset, hash, hash, hash, newString, sanitizeCredentials, sign, sign, signAndBase64Encode, signAndBase64Encode`

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

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

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

    - #### ALGORITHM

          protected static final java.lang.String ALGORITHM

      関連項目:
        定数フィールド値

    - #### TERMINATOR

          protected static final java.lang.String TERMINATOR

      関連項目:
        定数フィールド値

    - #### serviceName

          protected java.lang.String serviceName

      Service name override for use when the endpoint can't be used to determine the service name.

    - #### regionName

          protected java.lang.String regionName

      Region name override for use when the endpoint can't be used to determine the region name.

    - #### overriddenDate

          protected java.util.Date overriddenDate

      Date override for testing only

    - #### log

          protected static final org.apache.commons.logging.Log log

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

    - #### AWS4Signer

          public AWS4Signer()

  - ### メソッドの詳細

    - #### sign

          public void sign(Request<?> request,
                  AWSCredentials credentials)
                    throws AmazonClientException

      例外:
        `AmazonClientException`

    - #### setServiceName

          public void setServiceName(java.lang.String serviceName)

      Sets the service name that this signer should use when calculating request signatures. This can almost always be determined directly from the request's end point, so you shouldn't need this method, but it's provided for the edge case where the information is not in the endpoint.
      パラメータ:
        `serviceName` - The service name to use when calculating signatures in this signer.

    - #### setRegionName

          public void setRegionName(java.lang.String regionName)

      Sets the region name that this signer should use when calculating request signatures. This can almost always be determined directly from the request's end point, so you shouldn't need this method, but it's provided for the edge case where the information is not in the endpoint.
      パラメータ:
        `regionName` - The region name to use when calculating signatures in this signer.

    - #### addSessionCredentials

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

      クラスからコピーされた説明: `AbstractAWSSigner`
      Adds session credentials to the request given.
      定義:
        `addSessionCredentials` クラス内 `AbstractAWSSigner`
      パラメータ:
        `request` - The request to add session credentials information to
        `credentials` - The session credentials to add to the request

    - #### extractRegionName

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

    - #### extractServiceName

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

    - #### getCanonicalizedHeaderString

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

    - #### getSignedHeadersString

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

    - #### getCanonicalRequest

          protected java.lang.String getCanonicalRequest(Request<?> request,
                                             java.lang.String contentSha256)

    - #### getStringToSign

          protected java.lang.String getStringToSign(java.lang.String algorithm,
                                         java.lang.String dateTime,
                                         java.lang.String scope,
                                         java.lang.String canonicalRequest)

    - #### computeSignature

          protected AWS4Signer.HeaderSigningResult computeSignature(Request<?> request,
                                                        java.util.Date date,
                                                        java.lang.String algorithm,
                                                        java.lang.String contentSha256,
                                                        AWSCredentials sanitizedCredentials)

    - #### getDateTimeStamp

          protected java.lang.String getDateTimeStamp(java.util.Date date)

    - #### getDateStamp

          protected java.lang.String getDateStamp(java.util.Date date)

    - #### getDateFromRequest

          protected java.util.Date getDateFromRequest(Request<?> request)

    - #### addHostHeader

          protected void addHostHeader(Request<?> request)

    - #### getScope

          protected java.lang.String getScope(Request<?> request,
                                  java.util.Date date)

    - #### calculateContentHash

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

      Calculate the hash of the request's payload. Subclass could override this method to provide different values for "x-amz-content-sha256" header or do any other necessary set-ups on the request headers. (e.g. aws-chunked uses a pre-defined header value, and needs to change some headers relating to content-encoding and content-length.)

    - #### processRequestPayload

          protected void processRequestPayload(Request<?> request,
                                   AWS4Signer.HeaderSigningResult headerSigningResult)

      Subclass could override this method to perform any additional procedure on the request payload, with access to the result from signing the header. (e.g. Signing the payload by chunk-encoding). The default implementation doesn't need to do anything.