public void CanCreateCTL() { var ctlBuilder = new CTLInfoBuilder(); ctlBuilder.ListIdentifier = "Test list"; ctlBuilder.Certificates.Add(TestCertificate); var ctlInfo = ctlBuilder.ToCTLInfo(); var bytes = ctlInfo.ToBytes(); var loadedCtlInfo = CTLInfo.Load(bytes); AssertCollectionEquals(TestCertificate.GetCertHash(), loadedCtlInfo.Entries[0].SubjectIdentifier); Assert.Equal("Test list", ctlInfo.ListIdentifier); }
public void CanCreateSerializeAndReloadCTLContext() { var ctlBuilder = new CTLContextBuilder(); ctlBuilder.CTLInfo.Certificates.Add(TestCertificate); ctlBuilder.CTLInfo.ListIdentifier = "test list"; var ctlContext = ctlBuilder.ToCTLContext(); Assert.Equal("test list", ctlContext.FriendlyName); var bytes = ctlContext.ToBytes(); var loadedCtlContext = CTLContext.Load(bytes); Assert.Equal("test list", loadedCtlContext.FriendlyName); AssertCollectionEquals(TestCertificate.GetCertHash(), loadedCtlContext.CTLInfo.Entries[0].SubjectIdentifier); }