Beispiel #1
0
        public X509Certificate SignWith(X509PrivateKey authorityPrivateKey)
        {
            var tbsData = Tbs.ToAsn1().GetBytes();
            var data    = authorityPrivateKey.SignData(tbsData);

            SignatureValue     = new Asn1BitString(data);
            SignatureAlgorithm = Tbs.SignatureAlgorithm;
            return(this);
        }
Beispiel #2
0
 public Asn1Node ToAsn1()
 {
     return(new Asn1Sequence {
         Nodes =
         {
             Tbs.ToAsn1(),
             SignatureAlgorithm.ToAsn1(),
             SignatureValue
         }
     });
 }
Beispiel #3
0
 public Asn1Node ToAsn1()
 {
     if (SignatureValue == null)
     {
         throw new Exception("Certificate is not signed");
     }
     return(new Asn1Sequence {
         Nodes =
         {
             Tbs.ToAsn1(),
             SignatureAlgorithm.ToAsn1(),
             SignatureValue
         }
     });
 }