Search in sources :

Example 1 with SignedPushConfig

use of org.eclipse.jgit.transport.SignedPushConfig in project gerrit by GerritCodeReview.

the class PushCertificateCheckerTest method setUp.

@Before
public void setUp() throws Exception {
    TestKey key1 = validKeyWithoutExpiration();
    TestKey key3 = expiredKey();
    repo = new InMemoryRepository(new DfsRepositoryDescription("repo"));
    store = new PublicKeyStore(repo);
    store.add(key1.getPublicKeyRing());
    store.add(key3.getPublicKeyRing());
    PersonIdent ident = new PersonIdent("A U Thor", "author@example.com");
    CommitBuilder cb = new CommitBuilder();
    cb.setAuthor(ident);
    cb.setCommitter(ident);
    assertEquals(RefUpdate.Result.NEW, store.save(cb));
    signedPushConfig = new SignedPushConfig();
    signedPushConfig.setCertNonceSeed("sekret");
    signedPushConfig.setCertNonceSlopLimit(60 * 24);
    checker = newChecker(true);
}
Also used : TestKey(com.google.gerrit.gpg.testutil.TestKey) InMemoryRepository(org.eclipse.jgit.internal.storage.dfs.InMemoryRepository) SignedPushConfig(org.eclipse.jgit.transport.SignedPushConfig) PersonIdent(org.eclipse.jgit.lib.PersonIdent) CommitBuilder(org.eclipse.jgit.lib.CommitBuilder) DfsRepositoryDescription(org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription) Before(org.junit.Before)

Aggregations

TestKey (com.google.gerrit.gpg.testutil.TestKey)1 DfsRepositoryDescription (org.eclipse.jgit.internal.storage.dfs.DfsRepositoryDescription)1 InMemoryRepository (org.eclipse.jgit.internal.storage.dfs.InMemoryRepository)1 CommitBuilder (org.eclipse.jgit.lib.CommitBuilder)1 PersonIdent (org.eclipse.jgit.lib.PersonIdent)1 SignedPushConfig (org.eclipse.jgit.transport.SignedPushConfig)1 Before (org.junit.Before)1