feat(site-runtime): CertStoreActor exports trusted certs (thumbprint+DER) for node reconciliation (UA1 groundwork)
This commit is contained in:
@@ -106,6 +106,27 @@ public class CertStoreActorTests : TestKit, IDisposable
|
||||
emptyAck.Certs!.Should().NotContain(c => c.Thumbprint == thumbprint);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExportLocalTrustedCerts_ReturnsThumbprintAndDerBytes()
|
||||
{
|
||||
var (derBase64, thumbprint) = BuildSelfSignedCert();
|
||||
var expectedDer = Convert.FromBase64String(derBase64);
|
||||
var actor = Sys.ActorOf(Props.Create(() => new CertStoreActor(_options)));
|
||||
|
||||
// Seed one trusted cert via the normal write path.
|
||||
actor.Tell(new WriteCertToLocalStore(derBase64, thumbprint));
|
||||
ExpectMsg<LocalCertOpAck>().Success.Should().BeTrue();
|
||||
|
||||
// Export — thumbprint + raw DER bytes come back for reconciliation.
|
||||
actor.Tell(new ExportLocalTrustedCerts());
|
||||
var export = ExpectMsg<LocalCertExport>();
|
||||
export.Success.Should().BeTrue();
|
||||
export.Error.Should().BeNull();
|
||||
var entry = export.Certs.Should().ContainSingle().Subject;
|
||||
entry.Thumbprint.Should().Be(thumbprint);
|
||||
entry.DerBytes.Should().Equal(expectedDer);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Write_InvalidBase64_ReturnsFailureAck()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user