use of com.google.gerrit.gpg.testutil.TestKey in project gerrit by GerritCodeReview.
the class PublicKeyCheckerTest method revokedByKeyNotPresentInStore.
@Test
public void revokedByKeyNotPresentInStore() throws Exception {
TestKey k = add(revokedCompromisedKey());
save();
assertProblems(k, "Key is revoked (key material has been compromised): test6 compromised");
}
use of com.google.gerrit.gpg.testutil.TestKey in project gerrit by GerritCodeReview.
the class PublicKeyCheckerTest method revokedKeyDueToNoLongerBeingUsed.
@Test
public void revokedKeyDueToNoLongerBeingUsed() throws Exception {
TestKey k = add(revokedNoLongerUsedKey());
add(validKeyWithoutExpiration());
save();
assertProblems(k, "Key is revoked (retired and no longer valid): test7 not used");
}
use of com.google.gerrit.gpg.testutil.TestKey in project gerrit by GerritCodeReview.
the class PublicKeyCheckerTest method trustValidPathLength2.
// Test keys specific to this test are at the bottom of this class. Each test
// has a diagram of the trust network, where:
// - The notation M---N indicates N trusts M.
// - An 'x' indicates the key is expired.
@Test
public void trustValidPathLength2() throws Exception {
// A---Bx
// \
// \---C---D
// \
// \---Ex
//
// D and E trust C to be a valid introducer of depth 2.
TestKey ka = add(keyA());
TestKey kb = add(keyB());
TestKey kc = add(keyC());
TestKey kd = add(keyD());
TestKey ke = add(keyE());
save();
PublicKeyChecker checker = newChecker(2, kb, kd);
assertNoProblems(checker, ka);
assertProblems(checker, kb, "Key is expired");
assertNoProblems(checker, kc);
assertNoProblems(checker, kd);
assertProblems(checker, ke, "Key is expired", "No path to a trusted key");
}
use of com.google.gerrit.gpg.testutil.TestKey in project gerrit by GerritCodeReview.
the class PublicKeyCheckerTest method keyRevokedByExpiredKeyAfterExpirationIsNotRevoked.
@Test
public void keyRevokedByExpiredKeyAfterExpirationIsNotRevoked() throws Exception {
TestKey k = add(keyRevokedByExpiredKeyAfterExpiration());
add(expiredKey());
save();
PublicKeyChecker checker = new PublicKeyChecker().setStore(store);
assertNoProblems(checker, k);
}
use of com.google.gerrit.gpg.testutil.TestKey in project gerrit by GerritCodeReview.
the class PublicKeyStoreTest method getMultiple.
@Test
public void getMultiple() throws Exception {
TestKey key1 = validKeyWithoutExpiration();
TestKey key2 = validKeyWithExpiration();
tr.branch(REFS_GPG_KEYS).commit().add(keyObjectId(key1.getKeyId()).name(), key1.getPublicKeyArmored() + // Mismatched for this key ID, but we can still read it out.
key2.getPublicKeyArmored()).create();
assertKeys(key1.getKeyId(), key1, key2);
}
Aggregations