Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- X509Certificate2 GetCertificate(string templateId)
- {
- if (_certificateContainer == null)
- return null;
- if (templateId.IsNullOrWhiteSpace())
- return _certificateContainer.DefaultCertificate;
- var path = _knowledgeManager.GetFullPathById(templateId);
- return _certificateContainer.Certificates
- .Where(c => path.Contains(c.Key) && c.Key.IsNullOrWhiteSpace().Not())
- .DefaultIfEmpty(new KeyValuePair<string, X509Certificate2>("", _certificateContainer.DefaultCertificate))
- .FirstOrDefault().Value;
- }
Add Comment
Please, Sign In to add comment