Beispiel #1
0
        public void Build(int keyCount, int seed)
        {
            var builder = new ExposureKeySetBuilderV1(new FakeExposureKeySetHeaderInfoConfig(), new EcdSaSigner(new ResourceCertificateProvider("FakeECDSA.p12")), new CmsSigner(new ResourceCertificateProvider("FakeRSA.p12")), new StandardUtcDateTimeProvider(), new GeneratedProtobufContentFormatter());

            var actual = builder.BuildAsync(GetRandomKeys(keyCount, seed)).GetAwaiter().GetResult();

            Assert.IsTrue(actual.Length > 0);
            Trace.WriteLine($"{keyCount} keys = {actual.Length} bytes.");
        }
Beispiel #2
0
        public void Build(int keyCount, int seed)
        {
            var builder = new ExposureKeySetBuilderV1(new HardCodedExposureKeySetHeaderInfoConfig(), new HardCodedExposureKeySetSigning(), new StandardUtcDateTimeProvider(), new GeneratedProtobufContentFormatter());

            var actual = builder.BuildAsync(GetRandomKeys(keyCount, seed)).GetAwaiter().GetResult();

            Assert.IsTrue(actual.Length > 0);
            Trace.WriteLine($"{keyCount} keys = {actual.Length} bytes.");
        }
        public void Build(int keyCount, int seed)
        {
            var builder = new ExposureKeySetBuilderV1(new FakeExposureKeySetHeaderInfoConfig(),
                                                      new EcdSaSigner(new LocalResourceCertificateProvider(new HardCodedCertificateLocationConfig("TestCert2.p12", ""))),
                                                      new CmsSigner(new LocalResourceCertificateProvider(new HardCodedCertificateLocationConfig("FakeRSA.p12", "Covid-19!"))),
                                                      new StandardUtcDateTimeProvider(), new GeneratedProtobufContentFormatter(), new LoggerFactory().CreateLogger <ExposureKeySetBuilderV1>());

            var actual = builder.BuildAsync(GetRandomKeys(keyCount, seed)).GetAwaiter().GetResult();

            Assert.IsTrue(actual.Length > 0);
            Trace.WriteLine($"{keyCount} keys = {actual.Length} bytes.");

            using (var fs = new FileStream("EKS.zip", FileMode.Create, FileAccess.Write))
            {
                fs.Write(actual, 0, actual.Length);
            }
        }