public IOutboundTransport CreateTransport() { if (ServerCertificate == null && !string.IsNullOrEmpty(_certificatePath)) { lock (this) ServerCertificate = (string.IsNullOrEmpty(CertificatePassword)) ? CertificateUtilities.LoadCertificate(_certificatePath) : CertificateUtilities.LoadCertificate(_certificatePath, CertificatePassword); } return(new SyslogTlsTransport(ServerCertificate, ValidateClientCertificate) { Log = Log }); }
/// <summary> /// Implements IConfigurable.SetConfigurationParameter /// </summary> public override void SetConfigurationParameter(string key, string value) { if (Disposed) { throw new ObjectDisposedException(GetType().FullName); } switch (key) { case "ip": { IpAddress = value; break; } case "port": { Port = int.Parse(value); break; } case "certificate": { try { Certificate = CertificateUtilities.LoadCertificate(value); } catch (LogbusException ex) { throw new LogbusConfigurationException("Invalid certificate configuration", ex); } _certificatePath = value; break; } default: { throw new NotSupportedException("Configuration parameter is not supported"); } } }
public void LoadIdpPublicKey(string certificateStr) { _idpPublicKey = CertificateUtilities.LoadCertificate(certificateStr); }
public void LoadIdpPublicKey(byte[] certificateBytes) { _idpPublicKey = CertificateUtilities.LoadCertificate(certificateBytes); }