Search in sources :

Example 1 with DeletePublicKeyRequest

use of com.aliyuncs.ram.model.v20150501.DeletePublicKeyRequest in project aliyun-oss-java-sdk by aliyun.

the class AuthUtils method deletePublicKey.

/**
 * Delete the uploaded public key.
 *
 * @param regionId
 *            RAM's available area.
 * @param accessKeyId
 *            Access Key ID of the root user.
 * @param accessKeySecret
 *            Secret Access Key of the root user.
 * @param publicKeyId
 *            Public Key Id.
 * @throws ClientException
 */
public static void deletePublicKey(String regionId, String accessKeyId, String accessKeySecret, String publicKeyId) throws ClientException {
    DefaultProfile profile = DefaultProfile.getProfile(regionId, accessKeyId, accessKeySecret);
    DefaultAcsClient client = new DefaultAcsClient(profile);
    DeletePublicKeyRequest deletePublicKeyRequest = new DeletePublicKeyRequest();
    deletePublicKeyRequest.setUserPublicKeyId(publicKeyId);
    client.getAcsResponse(deletePublicKeyRequest);
}
Also used : DefaultProfile(com.aliyuncs.profile.DefaultProfile) DefaultAcsClient(com.aliyuncs.DefaultAcsClient) DeletePublicKeyRequest(com.aliyuncs.ram.model.v20150501.DeletePublicKeyRequest)

Aggregations

DefaultAcsClient (com.aliyuncs.DefaultAcsClient)1 DefaultProfile (com.aliyuncs.profile.DefaultProfile)1 DeletePublicKeyRequest (com.aliyuncs.ram.model.v20150501.DeletePublicKeyRequest)1