Search in sources :

Example 1 with Verifier

use of com.mobilecoin.lib.Verifier in project Signal-Android by WhisperSystems.

the class MobileCoinTestNetConfig method getConfig.

@Override
@NonNull
ClientConfig getConfig() {
    try {
        byte[] mrEnclaveConsensus = Hex.toByteArray("9659ea738275b3999bf1700398b60281be03af5cb399738a89b49ea2496595af");
        byte[] mrEnclaveReport = Hex.toByteArray("a4764346f91979b4906d4ce26102228efe3aba39216dec1e7d22e6b06f919f11");
        byte[] mrEnclaveLedger = Hex.toByteArray("768f7bea6171fb83d775ee8485e4b5fcebf5f664ca7e8b9ceef9c7c21e9d9bf3");
        byte[] mrEnclaveView = Hex.toByteArray("e154f108c7758b5aa7161c3824c176f0c20f63012463bf3cc5651e678f02fb9e");
        byte[] mrSigner = Hex.toByteArray("bf7fa957a6a94acb588851bc8767e0ca57706c79f4fc2aa6bcb993012c3c386c");
        Set<X509Certificate> trustRoots = getTrustRoots(R.raw.signal_mobilecoin_authority);
        ClientConfig config = new ClientConfig();
        String[] hardeningAdvisories = { "INTEL-SA-00334" };
        config.logAdapter = new MobileCoinLogAdapter();
        config.fogView = new ClientConfig.Service().withTrustRoots(trustRoots).withVerifier(new Verifier().withMrEnclave(mrEnclaveView, null, hardeningAdvisories).withMrSigner(mrSigner, FOG_VIEW_PRODUCT_ID, SECURITY_VERSION, null, hardeningAdvisories));
        config.fogLedger = new ClientConfig.Service().withTrustRoots(trustRoots).withVerifier(new Verifier().withMrEnclave(mrEnclaveLedger, null, hardeningAdvisories).withMrSigner(mrSigner, FOG_LEDGER_PRODUCT_ID, SECURITY_VERSION, null, hardeningAdvisories));
        config.consensus = new ClientConfig.Service().withTrustRoots(trustRoots).withVerifier(new Verifier().withMrEnclave(mrEnclaveConsensus, null, hardeningAdvisories).withMrSigner(mrSigner, CONSENSUS_PRODUCT_ID, SECURITY_VERSION, null, hardeningAdvisories));
        config.report = new ClientConfig.Service().withVerifier(new Verifier().withMrEnclave(mrEnclaveReport, null, hardeningAdvisories).withMrSigner(mrSigner, FOG_REPORT_PRODUCT_ID, SECURITY_VERSION, null, hardeningAdvisories));
        return config;
    } catch (AttestationException ex) {
        throw new IllegalStateException();
    }
}
Also used : AttestationException(com.mobilecoin.lib.exceptions.AttestationException) ClientConfig(com.mobilecoin.lib.ClientConfig) Verifier(com.mobilecoin.lib.Verifier) X509Certificate(java.security.cert.X509Certificate) NonNull(androidx.annotation.NonNull)

Example 2 with Verifier

use of com.mobilecoin.lib.Verifier in project Signal-Android by WhisperSystems.

the class MobileCoinMainNetConfig method getConfig.

@Override
@NonNull
ClientConfig getConfig() {
    try {
        byte[] mrEnclaveConsensus = Hex.toByteArray("e66db38b8a43a33f6c1610d335a361963bb2b31e056af0dc0a895ac6c857cab9");
        byte[] mrEnclaveConsensusNew = Hex.toByteArray("653228afd2b02a6c28f1dc3b108b1dfa457d170b32ae8ec2978f941bd1655c83");
        byte[] mrEnclaveReport = Hex.toByteArray("709ab90621e3a8d9eb26ed9e2830e091beceebd55fb01c5d7c31d27e83b9b0d1");
        byte[] mrEnclaveReportNew = Hex.toByteArray("f3f7e9a674c55fb2af543513527b6a7872de305bac171783f6716a0bf6919499");
        byte[] mrEnclaveLedger = Hex.toByteArray("511eab36de691ded50eb08b173304194da8b9d86bfdd7102001fe6bb279c3666");
        byte[] mrEnclaveLedgerNew = Hex.toByteArray("89db0d1684fcc98258295c39f4ab68f7de5917ef30f0004d9a86f29930cebbbd");
        byte[] mrEnclaveView = Hex.toByteArray("ddd59da874fdf3239d5edb1ef251df07a8728c9ef63057dd0b50ade5a9ddb041");
        byte[] mrEnclaveViewNew = Hex.toByteArray("dd84abda7f05116e21fcd1ee6361b0ec29445fff0472131eaf37bf06255b567a");
        Set<X509Certificate> trustRoots = getTrustRoots(R.raw.signal_mobilecoin_authority);
        ClientConfig config = new ClientConfig();
        String[] hardeningAdvisories = { "INTEL-SA-00334" };
        config.logAdapter = new MobileCoinLogAdapter();
        config.fogView = new ClientConfig.Service().withTrustRoots(trustRoots).withVerifier(new Verifier().withMrEnclave(mrEnclaveView, null, hardeningAdvisories).withMrEnclave(mrEnclaveViewNew, null, hardeningAdvisories));
        config.fogLedger = new ClientConfig.Service().withTrustRoots(trustRoots).withVerifier(new Verifier().withMrEnclave(mrEnclaveLedger, null, hardeningAdvisories).withMrEnclave(mrEnclaveLedgerNew, null, hardeningAdvisories));
        config.consensus = new ClientConfig.Service().withTrustRoots(trustRoots).withVerifier(new Verifier().withMrEnclave(mrEnclaveConsensus, null, hardeningAdvisories).withMrEnclave(mrEnclaveConsensusNew, null, hardeningAdvisories));
        config.report = new ClientConfig.Service().withVerifier(new Verifier().withMrEnclave(mrEnclaveReport, null, hardeningAdvisories).withMrEnclave(mrEnclaveReportNew, null, hardeningAdvisories));
        return config;
    } catch (AttestationException ex) {
        throw new IllegalStateException();
    }
}
Also used : AttestationException(com.mobilecoin.lib.exceptions.AttestationException) ClientConfig(com.mobilecoin.lib.ClientConfig) Verifier(com.mobilecoin.lib.Verifier) X509Certificate(java.security.cert.X509Certificate) NonNull(androidx.annotation.NonNull)

Example 3 with Verifier

use of com.mobilecoin.lib.Verifier in project Signal-Android by signalapp.

the class MobileCoinMainNetConfig method getConfig.

@Override
@NonNull
ClientConfig getConfig() {
    try {
        byte[] mrEnclaveConsensus = Hex.toByteArray("e66db38b8a43a33f6c1610d335a361963bb2b31e056af0dc0a895ac6c857cab9");
        byte[] mrEnclaveConsensusNew = Hex.toByteArray("653228afd2b02a6c28f1dc3b108b1dfa457d170b32ae8ec2978f941bd1655c83");
        byte[] mrEnclaveReport = Hex.toByteArray("709ab90621e3a8d9eb26ed9e2830e091beceebd55fb01c5d7c31d27e83b9b0d1");
        byte[] mrEnclaveReportNew = Hex.toByteArray("f3f7e9a674c55fb2af543513527b6a7872de305bac171783f6716a0bf6919499");
        byte[] mrEnclaveLedger = Hex.toByteArray("511eab36de691ded50eb08b173304194da8b9d86bfdd7102001fe6bb279c3666");
        byte[] mrEnclaveLedgerNew = Hex.toByteArray("89db0d1684fcc98258295c39f4ab68f7de5917ef30f0004d9a86f29930cebbbd");
        byte[] mrEnclaveView = Hex.toByteArray("ddd59da874fdf3239d5edb1ef251df07a8728c9ef63057dd0b50ade5a9ddb041");
        byte[] mrEnclaveViewNew = Hex.toByteArray("dd84abda7f05116e21fcd1ee6361b0ec29445fff0472131eaf37bf06255b567a");
        Set<X509Certificate> trustRoots = getTrustRoots(R.raw.signal_mobilecoin_authority);
        ClientConfig config = new ClientConfig();
        String[] hardeningAdvisories = { "INTEL-SA-00334" };
        config.logAdapter = new MobileCoinLogAdapter();
        config.fogView = new ClientConfig.Service().withTrustRoots(trustRoots).withVerifier(new Verifier().withMrEnclave(mrEnclaveView, null, hardeningAdvisories).withMrEnclave(mrEnclaveViewNew, null, hardeningAdvisories));
        config.fogLedger = new ClientConfig.Service().withTrustRoots(trustRoots).withVerifier(new Verifier().withMrEnclave(mrEnclaveLedger, null, hardeningAdvisories).withMrEnclave(mrEnclaveLedgerNew, null, hardeningAdvisories));
        config.consensus = new ClientConfig.Service().withTrustRoots(trustRoots).withVerifier(new Verifier().withMrEnclave(mrEnclaveConsensus, null, hardeningAdvisories).withMrEnclave(mrEnclaveConsensusNew, null, hardeningAdvisories));
        config.report = new ClientConfig.Service().withVerifier(new Verifier().withMrEnclave(mrEnclaveReport, null, hardeningAdvisories).withMrEnclave(mrEnclaveReportNew, null, hardeningAdvisories));
        return config;
    } catch (AttestationException ex) {
        throw new IllegalStateException();
    }
}
Also used : AttestationException(com.mobilecoin.lib.exceptions.AttestationException) ClientConfig(com.mobilecoin.lib.ClientConfig) Verifier(com.mobilecoin.lib.Verifier) X509Certificate(java.security.cert.X509Certificate) NonNull(androidx.annotation.NonNull)

Example 4 with Verifier

use of com.mobilecoin.lib.Verifier in project Signal-Android by signalapp.

the class MobileCoinTestNetConfig method getConfig.

@Override
@NonNull
ClientConfig getConfig() {
    try {
        byte[] mrEnclaveConsensus = Hex.toByteArray("9659ea738275b3999bf1700398b60281be03af5cb399738a89b49ea2496595af");
        byte[] mrEnclaveReport = Hex.toByteArray("a4764346f91979b4906d4ce26102228efe3aba39216dec1e7d22e6b06f919f11");
        byte[] mrEnclaveLedger = Hex.toByteArray("768f7bea6171fb83d775ee8485e4b5fcebf5f664ca7e8b9ceef9c7c21e9d9bf3");
        byte[] mrEnclaveView = Hex.toByteArray("e154f108c7758b5aa7161c3824c176f0c20f63012463bf3cc5651e678f02fb9e");
        byte[] mrSigner = Hex.toByteArray("bf7fa957a6a94acb588851bc8767e0ca57706c79f4fc2aa6bcb993012c3c386c");
        Set<X509Certificate> trustRoots = getTrustRoots(R.raw.signal_mobilecoin_authority);
        ClientConfig config = new ClientConfig();
        String[] hardeningAdvisories = { "INTEL-SA-00334" };
        config.logAdapter = new MobileCoinLogAdapter();
        config.fogView = new ClientConfig.Service().withTrustRoots(trustRoots).withVerifier(new Verifier().withMrEnclave(mrEnclaveView, null, hardeningAdvisories).withMrSigner(mrSigner, FOG_VIEW_PRODUCT_ID, SECURITY_VERSION, null, hardeningAdvisories));
        config.fogLedger = new ClientConfig.Service().withTrustRoots(trustRoots).withVerifier(new Verifier().withMrEnclave(mrEnclaveLedger, null, hardeningAdvisories).withMrSigner(mrSigner, FOG_LEDGER_PRODUCT_ID, SECURITY_VERSION, null, hardeningAdvisories));
        config.consensus = new ClientConfig.Service().withTrustRoots(trustRoots).withVerifier(new Verifier().withMrEnclave(mrEnclaveConsensus, null, hardeningAdvisories).withMrSigner(mrSigner, CONSENSUS_PRODUCT_ID, SECURITY_VERSION, null, hardeningAdvisories));
        config.report = new ClientConfig.Service().withVerifier(new Verifier().withMrEnclave(mrEnclaveReport, null, hardeningAdvisories).withMrSigner(mrSigner, FOG_REPORT_PRODUCT_ID, SECURITY_VERSION, null, hardeningAdvisories));
        return config;
    } catch (AttestationException ex) {
        throw new IllegalStateException();
    }
}
Also used : AttestationException(com.mobilecoin.lib.exceptions.AttestationException) ClientConfig(com.mobilecoin.lib.ClientConfig) Verifier(com.mobilecoin.lib.Verifier) X509Certificate(java.security.cert.X509Certificate) NonNull(androidx.annotation.NonNull)

Aggregations

NonNull (androidx.annotation.NonNull)4 ClientConfig (com.mobilecoin.lib.ClientConfig)4 Verifier (com.mobilecoin.lib.Verifier)4 AttestationException (com.mobilecoin.lib.exceptions.AttestationException)4 X509Certificate (java.security.cert.X509Certificate)4