Added public key and placeholder onion address.

This commit is contained in:
akwizgran
2016-04-21 16:07:51 +01:00
parent 5c2f56549b
commit 9b5d3ecb7a
4 changed files with 44 additions and 36 deletions

View File

@@ -24,6 +24,8 @@ import dagger.Module;
import dagger.Provides;
import static android.content.Context.MODE_PRIVATE;
import static org.briarproject.api.reporting.ReportingConstants.DEV_ONION_ADDRESS;
import static org.briarproject.api.reporting.ReportingConstants.DEV_PUBLIC_KEY_HEX;
@Module
public class AppModule {
@@ -97,36 +99,22 @@ public class AppModule {
@Provides
@Singleton
public DevConfig provideDevConfig(CryptoComponent crypto) {
final PublicKey pub;
try {
// TODO fill in
pub = crypto.getMessageKeyParser()
.parsePublicKey(StringUtils.fromHexString(""));
} catch (GeneralSecurityException e) {
throw new RuntimeException(e);
}
public DevConfig provideDevConfig(final CryptoComponent crypto) {
return new DevConfig() {
private final PublicKey DEV_PUB_KEY = pub;
// TODO fill in
private final String DEV_ONION = "";
private final int DEV_REPORT_PORT = 8080;
@Override
public PublicKey getDevPublicKey() {
return DEV_PUB_KEY;
try {
return crypto.getMessageKeyParser().parsePublicKey(
StringUtils.fromHexString(DEV_PUBLIC_KEY_HEX));
} catch (GeneralSecurityException e) {
throw new RuntimeException(e);
}
}
@Override
public String getDevOnionAddress() {
return DEV_ONION;
}
@Override
public int getDevReportPort() {
return DEV_REPORT_PORT;
return DEV_ONION_ADDRESS;
}
};
}