com.aliyun.oss.common.auth

## 类 ServiceSignature

- java.lang.Object
- - com.aliyun.oss.common.auth.ServiceSignature

- 直接已知子类:
    HmacSHA1Signature, HmacSHA256Signature

      public abstract class ServiceSignature
      extends Object

  The interface to compute the signature of the data.

- - ### 构造器概要

    构造器
    构造器和说明
    `ServiceSignature()`

  - ### 方法概要

    方法
    限定符和类型 | 方法和说明
    --- | ---
    `abstract String` | `computeSignature(String key, String data)` Computes the signature of the data by the given key.
    `static ServiceSignature` | `create()` Creates the default `ServiceSignature` instance which is `HmacSHA1Signature`.
    `abstract String` | `getAlgorithm()` Gets the algorithm of signature.
    `abstract String` | `getVersion()` Gets the algorithm version.
    `protected byte[]` | `sign(byte[] key, byte[] data, Mac macInstance, Object lock, String algorithm)`

    - ### 从类继承的方法 java.lang.Object

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

- - ### 构造器详细资料

    - #### ServiceSignature

          public ServiceSignature()

  - ### 方法详细资料

    - #### getAlgorithm

          public abstract String getAlgorithm()

      Gets the algorithm of signature.
      返回:
        The algorithm of the signature.

    - #### getVersion

          public abstract String getVersion()

      Gets the algorithm version.
      返回:
        The algorithm version.

    - #### computeSignature

          public abstract String computeSignature(String key,
                                String data)

      Computes the signature of the data by the given key.
      参数:
        `key` - The key for the signature.
        `data` - The data to compute the signature on.
      返回:
        The signature in string.

    - #### create

          public static ServiceSignature create()

      Creates the default `ServiceSignature` instance which is `HmacSHA1Signature`.
      返回:
        The default `ServiceSignature` instance

    - #### sign

          protected byte[] sign(byte[] key,
                    byte[] data,
                    Mac macInstance,
                    Object lock,
                    String algorithm)

Copyright © 2020. All Rights Reserved.