示例#1
0
 public void Decode()
 {
     using (var cert = new X509Certificate2("cert-test-ct\\symantec.cer"))
     {
         var extension = cert.Extensions[KnownOids.X509Extensions.CertificateTimeStampListCT];
         var scts      = SctDecoder.DecodeData(extension);
         Assert.Equal(2, scts.Count);
         var sct = scts[0]; //Pilot
         Assert.Equal(SctHashAlgorithm.HASH_ALGO_SHA256, sct.HashAlgorithm);
         Assert.Equal(SctSignatureAlgorithm.SIG_ALGO_ECDSA, sct.SignatureAlgorithm);
     }
 }
示例#2
0
 public void ParseKey()
 {
     using (var cert = new X509Certificate2("cert-test-ct\\symantec.cer"))
     {
         var extension = cert.Extensions[KnownOids.X509Extensions.CertificateTimeStampListCT];
         var scts      = SctDecoder.DecodeData(extension);
         Assert.Equal(2, scts.Count);
         var sct      = scts[0]; //Pilot
         var ctKey    = CtLogs.FindByLogId(sct.LogId);
         var verifier = new CtVerifier(ctKey.Key);
         Assert.True(verifier.Verify(sct));
     }
 }