## 接口 com.aliyun.oss.common.auth.Credentials
的使用

- 使用Credentials的程序包
  程序包 | 说明
  --- | ---
  com.aliyun.oss |
  com.aliyun.oss.common.auth |
  com.aliyun.oss.common.comm |

- - ### com.aliyun.oss中Credentials的使用

    参数类型为Credentials的com.aliyun.oss中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | OSSClient.`switchCredentials(Credentials creds)`
    `void` | OSS.`switchCredentials(Credentials creds)` Switches to another users with specified credentials

  - ### com.aliyun.oss.common.auth中Credentials的使用

    实现Credentials的com.aliyun.oss.common.auth中的类
    限定符和类型 | 类和说明
    --- | ---
    `class` | `BasicCredentials`
    `class` | `DefaultCredentials` Default implementation of `Credentials`.
    `class` | `InstanceProfileCredentials`

    返回Credentials的com.aliyun.oss.common.auth中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `Credentials` | HttpCredentialsFetcher.`fetch()`
    `Credentials` | CredentialsFetcher.`fetch()` 从授权服务器获取授权
    `Credentials` | HttpCredentialsFetcher.`fetch(int retryTimes)`
    `Credentials` | CredentialsFetcher.`fetch(int retryTimes)` 从授权服务器获取授权
    `Credentials` | SystemPropertiesCredentialsProvider.`getCredentials()`
    `Credentials` | STSKeyPairSessionCredentialsProvider.`getCredentials()`
    `Credentials` | STSAssumeRoleSessionCredentialsProvider.`getCredentials()`
    `Credentials` | ProfileCredentialsProvider.`getCredentials()`
    `Credentials` | ProfileConfigFile.`getCredentials()` Returns the OSS credentials for the specified profile.
    `Credentials` | EnvironmentVariableCredentialsProvider.`getCredentials()`
    `Credentials` | DefaultCredentialProvider.`getCredentials()`
    `Credentials` | CustomSessionCredentialsProvider.`getCredentials()`
    `Credentials` | CredentialsProvider.`getCredentials()`
    `Credentials` | InstanceProfileCredentialsFetcher.`parse(com.aliyuncs.http.HttpResponse response)`
    `abstract Credentials` | HttpCredentialsFetcher.`parse(com.aliyuncs.http.HttpResponse response)`
    `Credentials` | CustomSessionCredentialsFetcher.`parse(com.aliyuncs.http.HttpResponse response)`
    `Credentials` | CredentialsFetcher.`parse(com.aliyuncs.http.HttpResponse response)` 解析授权服务器返回的授权信息，解析为Credentials

    参数类型为Credentials的com.aliyun.oss.common.auth中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | SystemPropertiesCredentialsProvider.`setCredentials(Credentials creds)`
    `void` | STSKeyPairSessionCredentialsProvider.`setCredentials(Credentials creds)`
    `void` | STSAssumeRoleSessionCredentialsProvider.`setCredentials(Credentials creds)`
    `void` | ProfileCredentialsProvider.`setCredentials(Credentials creds)`
    `void` | InstanceProfileCredentialsProvider.`setCredentials(Credentials creds)`
    `void` | EnvironmentVariableCredentialsProvider.`setCredentials(Credentials creds)`
    `void` | DefaultCredentialProvider.`setCredentials(Credentials creds)`
    `void` | CustomSessionCredentialsProvider.`setCredentials(Credentials creds)`
    `void` | CredentialsProvider.`setCredentials(Credentials creds)`

    参数类型为Credentials的com.aliyun.oss.common.auth中的构造器
    构造器和说明
    `DefaultCredentialProvider(Credentials creds)`

  - ### com.aliyun.oss.common.comm中Credentials的使用

    返回Credentials的com.aliyun.oss.common.comm中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `Credentials` | ExecutionContext.`getCredentials()`

    参数类型为Credentials的com.aliyun.oss.common.comm中的方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | ExecutionContext.`setCredentials(Credentials credentials)`

Copyright © 2020. All Rights Reserved.