Skip to content

Commit cd12b57

Browse files
author
Thomas Wolf
committed
[GPG] Provide a factory for the BouncyCastleGpgSigner
Otherwise client code has no way to ever create an instance without using internal non-API. Change-Id: I6201f98d4b1704a053159967b8adacd98e368522 Signed-off-by: Thomas Wolf <[email protected]>
1 parent 3b94ba6 commit cd12b57

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

org.eclipse.jgit.gpg.bc/META-INF/MANIFEST.MF

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ Import-Package: org.bouncycastle.asn1;version="[1.65.0,2.0.0)",
3434
org.eclipse.jgit.transport;version="[5.11.0,5.12.0)",
3535
org.eclipse.jgit.util;version="[5.11.0,5.12.0)",
3636
org.slf4j;version="[1.7.0,2.0.0)"
37-
Export-Package: org.eclipse.jgit.gpg.bc.internal;version="5.11.0";x-friends:="org.eclipse.jgit.gpg.bc.test",
37+
Export-Package: org.eclipse.jgit.gpg.bc;version="5.11.0",
38+
org.eclipse.jgit.gpg.bc.internal;version="5.11.0";x-friends:="org.eclipse.jgit.gpg.bc.test",
3839
org.eclipse.jgit.gpg.bc.internal.keys;version="5.11.0";x-friends:="org.eclipse.jgit.gpg.bc.test"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (C) 2021 Thomas Wolf <[email protected]> and others
3+
*
4+
* This program and the accompanying materials are made available under the
5+
* terms of the Eclipse Distribution License v. 1.0 which is available at
6+
* https://www.eclipse.org/org/documents/edl-v10.php.
7+
*
8+
* SPDX-License-Identifier: BSD-3-Clause
9+
*/
10+
package org.eclipse.jgit.gpg.bc;
11+
12+
import org.eclipse.jgit.gpg.bc.internal.BouncyCastleGpgSigner;
13+
import org.eclipse.jgit.lib.GpgSigner;
14+
15+
/**
16+
* Factory for creating a {@link GpgSigner} based on Bouncy Castle.
17+
*
18+
* @since 5.11
19+
*/
20+
public final class BouncyCastleGpgSignerFactory {
21+
22+
private BouncyCastleGpgSignerFactory() {
23+
// No instantiation
24+
}
25+
26+
/**
27+
* Creates a new {@link GpgSigner}.
28+
*
29+
* @return the {@link GpgSigner}
30+
*/
31+
public static GpgSigner create() {
32+
return new BouncyCastleGpgSigner();
33+
}
34+
}

0 commit comments

Comments
 (0)