Search in sources :

Example 1 with TpmAttestation

use of com.microsoft.azure.sdk.iot.provisioning.service.configs.TpmAttestation in project azure-iot-sdk-java by Azure.

the class TpmAttestationTest method emptyConstructorSucceed.

/* SRS_TPM_ATTESTATION_21_010: [The TpmAttestation shall provide an empty constructor to make GSON happy.] */
@Test
public void emptyConstructorSucceed() {
    // arrange
    // act
    TpmAttestation tpmAttestation = Deencapsulation.newInstance(TpmAttestation.class);
    // assert
    assertNotNull(tpmAttestation);
}
Also used : TpmAttestation(com.microsoft.azure.sdk.iot.provisioning.service.configs.TpmAttestation) Test(org.junit.Test)

Example 2 with TpmAttestation

use of com.microsoft.azure.sdk.iot.provisioning.service.configs.TpmAttestation in project azure-iot-sdk-java by Azure.

the class TpmAttestationTest method gettersSucceed.

/* SRS_TPM_ATTESTATION_21_008: [The getEndorsementKey shall return the store endorsementKey.] */
/* SRS_TPM_ATTESTATION_21_009: [The getStorageRootKey shall return the store storageRootKey.] */
@Test
public void gettersSucceed() {
    // arrange
    // act
    TpmAttestation tpmAttestation = new TpmAttestation(VALID_ENDORSEMENT_KEY, VALID_STORAGE_ROOT_KEY);
    // assert
    assertEquals(VALID_ENDORSEMENT_KEY, tpmAttestation.getEndorsementKey());
    assertEquals(VALID_STORAGE_ROOT_KEY, tpmAttestation.getStorageRootKey());
}
Also used : TpmAttestation(com.microsoft.azure.sdk.iot.provisioning.service.configs.TpmAttestation) Test(org.junit.Test)

Example 3 with TpmAttestation

use of com.microsoft.azure.sdk.iot.provisioning.service.configs.TpmAttestation in project azure-iot-sdk-java by Azure.

the class TpmAttestationTest method constructorStoresEndorsementKey.

/* SRS_TPM_ATTESTATION_21_002: [The constructor shall store the provided endorsementKey.] */
/* SRS_TPM_ATTESTATION_21_003: [The constructor shall store the provided storageRootKey.] */
@Test
public void constructorStoresEndorsementKey() {
    // arrange
    // act
    TpmAttestation tpmAttestation = new TpmAttestation(VALID_ENDORSEMENT_KEY, VALID_STORAGE_ROOT_KEY);
    // assert
    assertEquals(VALID_ENDORSEMENT_KEY, Deencapsulation.getField(tpmAttestation, "endorsementKey"));
    assertEquals(VALID_STORAGE_ROOT_KEY, Deencapsulation.getField(tpmAttestation, "storageRootKey"));
}
Also used : TpmAttestation(com.microsoft.azure.sdk.iot.provisioning.service.configs.TpmAttestation) Test(org.junit.Test)

Example 4 with TpmAttestation

use of com.microsoft.azure.sdk.iot.provisioning.service.configs.TpmAttestation in project azure-iot-sdk-java by Azure.

the class TpmAttestationTest method constructorOnlyEndorsementKeyStoresEndorsementKey.

/* SRS_TPM_ATTESTATION_21_005: [The constructor shall store the provided endorsementKey.] */
@Test
public void constructorOnlyEndorsementKeyStoresEndorsementKey() {
    // arrange
    // act
    TpmAttestation tpmAttestation = new TpmAttestation(VALID_ENDORSEMENT_KEY);
    // assert
    assertEquals(VALID_ENDORSEMENT_KEY, Deencapsulation.getField(tpmAttestation, "endorsementKey"));
}
Also used : TpmAttestation(com.microsoft.azure.sdk.iot.provisioning.service.configs.TpmAttestation) Test(org.junit.Test)

Example 5 with TpmAttestation

use of com.microsoft.azure.sdk.iot.provisioning.service.configs.TpmAttestation in project azure-iot-sdk-java by Azure.

the class TpmAttestationTest method constructorCopyStoresKeys.

/* SRS_TPM_ATTESTATION_21_007: [The constructor shall store the endorsementKey and storageRootKey provided in the tpm.] */
@Test
public void constructorCopyStoresKeys() {
    // arrange
    TpmAttestation tpmAttestation = new TpmAttestation(VALID_ENDORSEMENT_KEY, VALID_STORAGE_ROOT_KEY);
    // act
    TpmAttestation tpmAttestationCopy = new TpmAttestation(tpmAttestation);
    // assert
    assertEquals(VALID_ENDORSEMENT_KEY, Deencapsulation.getField(tpmAttestationCopy, "endorsementKey"));
    assertEquals(VALID_STORAGE_ROOT_KEY, Deencapsulation.getField(tpmAttestationCopy, "storageRootKey"));
}
Also used : TpmAttestation(com.microsoft.azure.sdk.iot.provisioning.service.configs.TpmAttestation) Test(org.junit.Test)

Aggregations

TpmAttestation (com.microsoft.azure.sdk.iot.provisioning.service.configs.TpmAttestation)6 Test (org.junit.Test)6 ProvisioningDeviceClient (com.microsoft.azure.sdk.iot.provisioning.device.ProvisioningDeviceClient)1 ProvisioningDeviceClientStatus (com.microsoft.azure.sdk.iot.provisioning.device.ProvisioningDeviceClientStatus)1 SecurityProvider (com.microsoft.azure.sdk.iot.provisioning.security.SecurityProvider)1 SecurityProviderTPMEmulator (com.microsoft.azure.sdk.iot.provisioning.security.hsm.SecurityProviderTPMEmulator)1 ProvisioningServiceClient (com.microsoft.azure.sdk.iot.provisioning.service.ProvisioningServiceClient)1 Attestation (com.microsoft.azure.sdk.iot.provisioning.service.configs.Attestation)1 IndividualEnrollment (com.microsoft.azure.sdk.iot.provisioning.service.configs.IndividualEnrollment)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1