Search in sources :

Example 1 with KeyProvider

use of com.yahoo.vespa.hosted.athenz.instanceproviderservice.KeyProvider in project vespa by vespa-engine.

the class InstanceValidatorTest method invalid_signature.

@Test
public void invalid_signature() throws Exception {
    KeyProvider keyProvider = new AutoGeneratedKeyProvider();
    InstanceValidator instanceValidator = new InstanceValidator(keyProvider, null);
    KeyProvider fakeKeyProvider = new AutoGeneratedKeyProvider();
    InstanceConfirmation instanceConfirmation = createInstanceConfirmation(fakeKeyProvider.getPrivateKey(0), applicationId, domain, service);
    assertFalse(instanceValidator.isInstanceSignatureValid(instanceConfirmation));
}
Also used : KeyProvider(com.yahoo.vespa.hosted.athenz.instanceproviderservice.KeyProvider) AutoGeneratedKeyProvider(com.yahoo.vespa.hosted.athenz.instanceproviderservice.AutoGeneratedKeyProvider) AutoGeneratedKeyProvider(com.yahoo.vespa.hosted.athenz.instanceproviderservice.AutoGeneratedKeyProvider) Test(org.junit.Test)

Example 2 with KeyProvider

use of com.yahoo.vespa.hosted.athenz.instanceproviderservice.KeyProvider in project vespa by vespa-engine.

the class InstanceValidatorTest method valid_signature.

@Test
public void valid_signature() throws Exception {
    KeyProvider keyProvider = new AutoGeneratedKeyProvider();
    InstanceValidator instanceValidator = new InstanceValidator(keyProvider, null);
    InstanceConfirmation instanceConfirmation = createInstanceConfirmation(keyProvider.getPrivateKey(0), applicationId, domain, service);
    assertTrue(instanceValidator.isInstanceSignatureValid(instanceConfirmation));
}
Also used : KeyProvider(com.yahoo.vespa.hosted.athenz.instanceproviderservice.KeyProvider) AutoGeneratedKeyProvider(com.yahoo.vespa.hosted.athenz.instanceproviderservice.AutoGeneratedKeyProvider) AutoGeneratedKeyProvider(com.yahoo.vespa.hosted.athenz.instanceproviderservice.AutoGeneratedKeyProvider) Test(org.junit.Test)

Aggregations

AutoGeneratedKeyProvider (com.yahoo.vespa.hosted.athenz.instanceproviderservice.AutoGeneratedKeyProvider)2 KeyProvider (com.yahoo.vespa.hosted.athenz.instanceproviderservice.KeyProvider)2 Test (org.junit.Test)2