use of com.aliyuncs.ram.model.v20150501.ListPublicKeysResponse in project aliyun-oss-java-sdk by aliyun.
the class AuthUtils method listPublicKeys.
/**
* List the public keys that has been uploaded.
*
* @param regionId
* RAM's available area.
* @param accessKeyId
* Access Key ID of the root user.
* @param accessKeySecret
* Secret Access Key of the root user.
* @return Public keys.
* @throws ClientException
*/
public static List<PublicKey> listPublicKeys(String regionId, String accessKeyId, String accessKeySecret) throws ClientException {
DefaultProfile profile = DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret);
DefaultAcsClient client = new DefaultAcsClient(profile);
ListPublicKeysRequest listPublicKeysRequest = new ListPublicKeysRequest();
ListPublicKeysResponse listPublicKeysResponse = client.getAcsResponse(listPublicKeysRequest);
List<PublicKey> publicKeys = new ArrayList<PublicKey>();
for (com.aliyuncs.ram.model.v20150501.ListPublicKeysResponse.PublicKey publicKey : listPublicKeysResponse.getPublicKeys()) {
publicKeys.add(new PublicKey(publicKey));
}
return publicKeys;
}
Aggregations