public X509Certificate SignWith(X509PrivateKey authorityPrivateKey) { var tbsData = Tbs.ToAsn1().GetBytes(); var data = authorityPrivateKey.SignData(tbsData); SignatureValue = new Asn1BitString(data); SignatureAlgorithm = Tbs.SignatureAlgorithm; return(this); }
public Asn1Node ToAsn1() { return(new Asn1Sequence { Nodes = { Tbs.ToAsn1(), SignatureAlgorithm.ToAsn1(), SignatureValue } }); }
public Asn1Node ToAsn1() { if (SignatureValue == null) { throw new Exception("Certificate is not signed"); } return(new Asn1Sequence { Nodes = { Tbs.ToAsn1(), SignatureAlgorithm.ToAsn1(), SignatureValue } }); }