void EnsureDnsCert() { if (m_cert == null && m_certType == CertificateType.X509) { m_cert = new DnsX509Cert(m_certData, m_keyTag); } }
/// <summary> /// Initializes an instance with the supplied certificate. /// </summary> /// <param name="cert">The certificate for this record.</param> public CertRecord(DnsX509Cert cert) : base(cert.Name, DnsStandard.RecordType.CERT) { this.Cert = cert; this.CertType = CertificateType.X509; this.KeyTag = cert.KeyTag; this.Algorithm = 5; // RFC 4034 }
void ExportCerts(IEnumerable<X509Certificate2> certs, TextWriter writer, bool isOutputFile) { foreach (X509Certificate2 cert in certs) { DnsX509Cert dnsCert = new DnsX509Cert(cert); dnsCert.Export(writer, dnsCert.Name); writer.WriteLine(); if (isOutputFile) { Console.WriteLine(dnsCert.Name); } } }