示例#1
0
        public void Ocsp()
        {
            var caCertificate   = CertificateProvider.GenerateCertificateAuthorityCertificate("Certificate Authority - Graham Miller");
            var leafCertificate = CertificateProvider.GenerateSignedCertificateWithOcsp("Graham Miller", caCertificate);

            Verify(leafCertificate);
        }
示例#2
0
        public void OcspFromSelfSignedCertificate()
        {
            var caCertificate   = CertificateProvider.GenerateCertificateAuthorityCertificate("Certificate Authority - Graham Miller");
            var leafCertificate = CertificateProvider.GenerateSignedCertificateWithOcsp("Graham Miller", caCertificate);

            WriteCertificateExtensions(leafCertificate);
        }
示例#3
0
        public void VerifyCertificate()
        {
            // create certificates
            var caCertificate   = CertificateProvider.GenerateCertificateAuthorityCertificate("Certificate Authority - Graham Miller");
            var leafCertificate = CertificateProvider.GenerateSignedCertificate("Graham Miller", caCertificate);

            Assert.That(caCertificate.Verify(), Is.False);
            Assert.That(leafCertificate.Verify(), Is.False);
            Assert.That(Verify(leafCertificate), Is.False);

            AddCertificateToStore(caCertificate);
            Assert.That(caCertificate.Verify(), Is.True);
            Assert.That(leafCertificate.Verify(), Is.False);
            Assert.That(Verify(leafCertificate), Is.True);

            RemoveCertificateFromStore(caCertificate);
            Assert.That(caCertificate.Verify(), Is.False);
            Assert.That(leafCertificate.Verify(), Is.False);
            Assert.That(Verify(leafCertificate), Is.False);
        }