public void GetCertificatePublicKey() { using (KeyContainer keyContainer = KeyContainer.Open(ContainerSert, ContainerPassword)) { var certificateRawData = keyContainer.ExportCertificateData(); var publicKeyFromCert = KeyContainer.GetCertificatePublicKey(certificateRawData); var containerKey = keyContainer.ExportPublicKey(); Assert.AreEqual(containerKey, publicKeyFromCert); } }