public static byte[] GetAllTLSCerts(this ISDAdditionInfo info) { try { using (System.IO.MemoryStream outputStream = new System.IO.MemoryStream()) { if (info.TLSCerts != null) { foreach (byte[] tlsCert in info.TLSCerts) { outputStream.Write(tlsCert, 0, tlsCert.Length); } } if (info.TLSIntermediateCerts != null) { foreach (byte[] tlsCert in info.TLSIntermediateCerts) { outputStream.Write(tlsCert, 0, tlsCert.Length); } } return(outputStream.ToArray()); } } catch (Exception e) { throw new ServiceDiscoveryException(e.Message, e); } }
public static string FindClientProp(this ISDAdditionInfo info, Properties config, string prop, string def) { string[] split = info.Endpoint.Split(':'); string endpointHost = split[0]; string ret = config.Get("org.hyperledger.fabric.sdk.discovery.default." + prop, def); ret = config.Get("org.hyperledger.fabric.sdk.discovery.mspid." + prop + "." + info.MspId, ret); ret = config.Get("org.hyperledger.fabric.sdk.discovery.endpoint." + prop + "." + endpointHost, ret); ret = config.Get("org.hyperledger.fabric.sdk.discovery.endpoint." + prop + "." + info.Endpoint, ret); return(ret); }