Search in sources :

Example 1 with SetCertificateIssuerRequest

use of com.microsoft.azure.keyvault.requests.SetCertificateIssuerRequest in project azure-sdk-for-java by Azure.

the class AsyncOperationsTest method issuerAsync.

@Test
public void issuerAsync() throws Exception {
    String vault = getVaultUri();
    String issuerName = "myIssuer";
    SetCertificateIssuerRequest setCertificateIssuerRequest = new SetCertificateIssuerRequest.Builder(vault, issuerName, "Test").build();
    IssuerBundle certificateIssuer = keyVaultClient.setCertificateIssuerAsync(setCertificateIssuerRequest, null).get();
    Assert.assertNotNull(certificateIssuer);
    UpdateCertificateIssuerRequest updateCertificateIssuerRequest = new UpdateCertificateIssuerRequest.Builder(vault, issuerName).withProvider("SslAdmin").build();
    certificateIssuer = keyVaultClient.updateCertificateIssuerAsync(updateCertificateIssuerRequest, null).get();
    Assert.assertNotNull(certificateIssuer);
    certificateIssuer = keyVaultClient.getCertificateIssuerAsync(vault, issuerName, null).get();
    Assert.assertNotNull(certificateIssuer);
    List<CertificateIssuerItem> issuers = keyVaultClient.listCertificateIssuersAsync(vault, null).get();
    Assert.assertNotNull(issuers);
    keyVaultClient.deleteCertificateIssuerAsync(vault, issuerName, null).get();
}
Also used : SetCertificateIssuerRequest(com.microsoft.azure.keyvault.requests.SetCertificateIssuerRequest) IssuerBundle(com.microsoft.azure.keyvault.models.IssuerBundle) CertificateIssuerItem(com.microsoft.azure.keyvault.models.CertificateIssuerItem) UpdateCertificateIssuerRequest(com.microsoft.azure.keyvault.requests.UpdateCertificateIssuerRequest) Test(org.junit.Test)

Aggregations

CertificateIssuerItem (com.microsoft.azure.keyvault.models.CertificateIssuerItem)1 IssuerBundle (com.microsoft.azure.keyvault.models.IssuerBundle)1 SetCertificateIssuerRequest (com.microsoft.azure.keyvault.requests.SetCertificateIssuerRequest)1 UpdateCertificateIssuerRequest (com.microsoft.azure.keyvault.requests.UpdateCertificateIssuerRequest)1 Test (org.junit.Test)1