Master client for mail encryption/decryption and signature management.

Namespace: NHINDirect.Agent
Assembly: nhinAgent (in nhinAgent.dll) Version: (


public class NHINDAgent
Visual Basic
Public Class NHINDAgent
Visual C++
public ref class NHINDAgent


This example demonstrates a typical use of the Agent, using local certificate management for private certificates, DNS management for remote certificates, and a local store of trust anchors.
CertificateIndex localcerts = SystemX509Store.OpenPrivate().Index(); 
var dnsresolver = new DnsCertResolver(""); 
var trustanchors = TrustAnchorResolver.CreateDefault(); 
var ougoingmsg = File.ReadAllText("outgoing.eml"); // plaintext RFC 5322 email message 
var incomingmsg = File.ReadAllText("incoming.eml"); // signed and encrypted S/MIME message 
var agent = NHINDAgent("", localcerts, dnsresolver, trustanchors); 

IncomingMessage incoming = agent.ProcessIncoming(incomingmsg); 
if (incoming.HasRejectedRecipients) 
    foreach(recipient in incoming.RejectedRecipients) 
        Console.WriteLine("Rejected {0}", recipient.Address); 
OutgoingMessage outgoing = agent.ProcessOutgoing(outgoingmsg); 
if (outgoing.HasRejectedRecipients) 
    foreach(recipient in outgoing.RejectedRecipients) 
        Console.WriteLine("Rejected {0}", recipient.Address); 

Inheritance Hierarchy


See Also