org.nhindirect.stagent
Class DefaultNHINDAgent

java.lang.Object
  extended by org.nhindirect.stagent.DefaultNHINDAgent
All Implemented Interfaces:
NHINDAgent

public class DefaultNHINDAgent
extends java.lang.Object
implements NHINDAgent

Default agent implementation.

Author:
Greg Meyer, Umesh Madan

Constructor Summary
DefaultNHINDAgent(java.util.Collection<java.lang.String> domains, CertificateResolver privateCerts, CertificateResolver publicCerts, TrustAnchorResolver anchors)
          Constructs an agent with a list of domains, certificate stores, and a trust anchor store.
DefaultNHINDAgent(java.util.Collection<java.lang.String> domains, CertificateResolver privateCerts, CertificateResolver publicCerts, TrustAnchorResolver anchors, TrustModel trustModel, Cryptographer cryptographer)
          Constructs an agent with a list of domain, certificate services, and trust anchor store.
DefaultNHINDAgent(java.util.Collection<java.lang.String> domains, CertificateResolver privateCerts, java.util.Collection<CertificateResolver> publicCerts, TrustAnchorResolver anchors, TrustModel trustModel, Cryptographer cryptographer)
          Constructs an agent with a list of domains, certificate stores, and a trust anchor store.
DefaultNHINDAgent(java.lang.String domain, CertificateResolver privateCerts, CertificateResolver publicCerts, TrustAnchorResolver anchors)
          Constructs an agent with a domain, certificate stores, and a trust anchor store.
DefaultNHINDAgent(java.lang.String domain, CertificateResolver privateCerts, CertificateResolver publicCerts, TrustAnchorResolver anchors, TrustModel trustModel, Cryptographer cryptographer)
          Constructs an agent with domain, certificate services, and trust anchor store.
 
Method Summary
 Cryptographer getCryptographer()
          Gets the Cryptographer used by the agent to perform cryptography operations.
 java.util.Collection<java.lang.String> getDomains()
          Gets the list of domains that the agent is serving.
 TrustEnforcementStatus getMinTrustRequirement()
          Gets the minimum trust status applied to messages by the agent.
 CertificateResolver getPrivateCertResolver()
          Gets the certificate store used to decrypt and sign messages.
 CertificateResolver getPublicCertResolver()
          Deprecated. Use {getPublicCertResolvers()
 java.util.Collection<CertificateResolver> getPublicCertResolvers()
          Gets the certificate stores used to encrypt messages and validate signatures.
 TrustAnchorResolver getTrustAnchors()
          Gets the certificate store that contains the certificate anchors that validate if certificates are trusted.
 boolean isEncryptMessages()
          Indicates if messages are required to be encrypted in the agent.
 boolean isWrappingEnabled()
          Indicates if the agent automatically wraps messages into RFC822 envelopes for hiding headers.
 IncomingMessage processIncoming(IncomingMessage message)
          Processes a pre-enveloped message.
 IncomingMessage processIncoming(MessageEnvelope envelope)
          Processes a pre-enveloped message.
 IncomingMessage processIncoming(javax.mail.internet.MimeMessage msg)
          Processes an incoming mime message.
 IncomingMessage processIncoming(java.lang.String messageText)
          Processes an incoming message represented by a raw string.
 IncomingMessage processIncoming(java.lang.String messageText, NHINDAddressCollection recipients, NHINDAddress sender)
          Processes an incoming message represented by a raw string.
 OutgoingMessage processOutgoing(MessageEnvelope envelope)
          Processes an outgoing pre-enveloped message.
 OutgoingMessage processOutgoing(OutgoingMessage message)
          Processes an outgoing pre-enveloped message.
 OutgoingMessage processOutgoing(java.lang.String messageText)
          Processes an outgoing message represented by a raw string.
 OutgoingMessage processOutgoing(java.lang.String messageText, NHINDAddressCollection recipients, NHINDAddress sender)
          Processes an outgoing message represented by a raw string.
 void setCryptographer(Cryptographer _cryptographer)
           
 void setEncryptMessages(boolean value)
          Sets if messages are required to be encrypted in the agen
 void setEventListener(NHINDAgentEventListener listener)
          Sets the event listener that will receive notifications at different stages of message processing.
 void setMinTrustRequirement(TrustEnforcementStatus value)
          Sets the minimum trust status applied to messages by the agent.
 void setWrappingEnabled(boolean wrappingEnabled)
          Sets the auto message wrapping feature of the agent.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultNHINDAgent

public DefaultNHINDAgent(java.lang.String domain,
                         CertificateResolver privateCerts,
                         CertificateResolver publicCerts,
                         TrustAnchorResolver anchors)
Constructs an agent with a domain, certificate stores, and a trust anchor store.

Parameters:
domain - The domain that this agent will be serving.
internalCerts - A certificate store for messages originating internally. The store contains certificates that have access to private keys for decryption and signing messages.
externalCerts - A certificate store for incoming messages. The store contains public certificates for message signature validation and encryption.
trustSettings - A certificate store for certificate anchors. Certificate anchors are certificates that can validate the authenticity of a certificate. They are also used by the agent to determine if a certificate is trusted by the system.

DefaultNHINDAgent

public DefaultNHINDAgent(java.util.Collection<java.lang.String> domains,
                         CertificateResolver privateCerts,
                         CertificateResolver publicCerts,
                         TrustAnchorResolver anchors)
Constructs an agent with a list of domains, certificate stores, and a trust anchor store.

Parameters:
domain - A list of domains that this agent will be serving.
internalCerts - A certificate store for messages originating internally. The store contains certificates that have access to private keys for decryption and signing messages.
externalCerts - A certificate store for incoming messages. The store contains public certificates for message signature validation and encryption.
trustSettings - A certificate store for certificate anchors. Certificate anchors are certificates that can validate the authenticity of a certificate. They are also used by the agent to determine if a certificate is trusted by the system.

DefaultNHINDAgent

public DefaultNHINDAgent(java.lang.String domain,
                         CertificateResolver privateCerts,
                         CertificateResolver publicCerts,
                         TrustAnchorResolver anchors,
                         TrustModel trustModel,
                         Cryptographer cryptographer)
Constructs an agent with domain, certificate services, and trust anchor store.

Parameters:
domain - The domain that this agent will be serving.
internalCerts - A certificate store for messages originating internally. The store contains certificates that have access to private keys for decryption and signing messages.
externalCerts - A certificate store for incoming messages. The store contains public certificates for message signature validation and encyprtion.
trustSettings - A certificate store for certificate anchors. Certificate anchors are certificates that can validate the authenticity of a certificate. They are also used by the agent to determine if a certificate is trusted by the system.
A - trust model implementation that asserts the if a message is trusted.
A - cryptography implementation used to sign, encrypt, and decrypt messages.

DefaultNHINDAgent

@Inject
public DefaultNHINDAgent(java.util.Collection<java.lang.String> domains,
                                CertificateResolver privateCerts,
                                java.util.Collection<CertificateResolver> publicCerts,
                                TrustAnchorResolver anchors,
                                TrustModel trustModel,
                                Cryptographer cryptographer)
Constructs an agent with a list of domains, certificate stores, and a trust anchor store.


DefaultNHINDAgent

public DefaultNHINDAgent(java.util.Collection<java.lang.String> domains,
                         CertificateResolver privateCerts,
                         CertificateResolver publicCerts,
                         TrustAnchorResolver anchors,
                         TrustModel trustModel,
                         Cryptographer cryptographer)
Constructs an agent with a list of domain, certificate services, and trust anchor store.

Parameters:
domain - A list of domains that this agent will be serving.
internalCerts - A certificate store for messages originating internally. The store contains certificates that have access to private keys for decryption and signing messages.
externalCerts - A certificate store for incoming messages. The store contains public certificates for message signature validation and encyprtion.
trustSettings - A certificate store for certificate anchors. Certificate anchors are certificates that can validate the authenticity of a certificate. They are also used by the agent to determine if a certificate is trusted by the system.
A - trust model implementation that asserts the if a message is trusted.
A - cryptography implementation used to sign, encrypt, and decrypt messages.
Method Detail

getDomains

public java.util.Collection<java.lang.String> getDomains()
Gets the list of domains that the agent is serving.

Specified by:
getDomains in interface NHINDAgent
Returns:
The domains that the agent is serving.

getCryptographer

public Cryptographer getCryptographer()
Gets the Cryptographer used by the agent to perform cryptography operations.

Returns:
The Cryptographer used by the agent to perform cryptography operations.

isEncryptMessages

public boolean isEncryptMessages()
Indicates if messages are required to be encrypted in the agent.

Returns:
True if messages are required to be encrypted in the agent. False otherwise.

setEncryptMessages

public void setEncryptMessages(boolean value)
Sets if messages are required to be encrypted in the agen

Parameters:
value - True if messages are required to be encrypted in the agent. False otherwise.

isWrappingEnabled

public boolean isWrappingEnabled()
Indicates if the agent automatically wraps messages into RFC822 envelopes for hiding headers.

Returns:
True if the agent automatically wraps messages.

setWrappingEnabled

public void setWrappingEnabled(boolean wrappingEnabled)
Sets the auto message wrapping feature of the agent. Message wrapping takes the original message and wraps it into a message of type RFC822 pushing all headers into the message body. Only routing information is propagated up from the original message.

Parameters:
wrappingEnabled -

getPublicCertResolver

public CertificateResolver getPublicCertResolver()
Deprecated. Use {getPublicCertResolvers()

Gets the certificate store used to encrypt messages and validate signatures. This store generally contains only public certificates

Returns:
The certificate store used to encrypt messages and validate signatures.

getPublicCertResolvers

public java.util.Collection<CertificateResolver> getPublicCertResolvers()
Gets the certificate stores used to encrypt messages and validate signatures. This store generally contains only public certificates

Returns:
The certificate stores used to encrypt messages and validate signatures.

getPrivateCertResolver

public CertificateResolver getPrivateCertResolver()
Gets the certificate store used to decrypt and sign messages. Certificates in this store must have access to the certifcate's private key.

Returns:
The certificate store used to decrypt and sign messages.

getTrustAnchors

public TrustAnchorResolver getTrustAnchors()
Gets the certificate store that contains the certificate anchors that validate if certificates are trusted.

Returns:
The certificate store that contains the certificate anchors that validate if certificates are trusted.

getMinTrustRequirement

public TrustEnforcementStatus getMinTrustRequirement()
Gets the minimum trust status applied to messages by the agent.

Returns:
The minimum trust status applied to messages by the agent.

setMinTrustRequirement

public void setMinTrustRequirement(TrustEnforcementStatus value)
Sets the minimum trust status applied to messages by the agent.

Parameters:
value - The minimum trust status applied to messages by the agent.

setEventListener

public void setEventListener(NHINDAgentEventListener listener)
Sets the event listener that will receive notifications at different stages of message processing.

Parameters:
listener - A concrete implementation of an NHINDAgentEventListener.

setCryptographer

public void setCryptographer(Cryptographer _cryptographer)

processIncoming

public IncomingMessage processIncoming(java.lang.String messageText)
Processes an incoming message represented by a raw string. The message will be decrypted and validated that it meets trust assertions.

Specified by:
processIncoming in interface NHINDAgent
Parameters:
messageText - The raw contents of the incoming message that will be processed.
Returns:
An incoming messaging object that contains the unwrapped and decrypted message.

processIncoming

public IncomingMessage processIncoming(java.lang.String messageText,
                                       NHINDAddressCollection recipients,
                                       NHINDAddress sender)
Processes an incoming message represented by a raw string. The message will be decrypted and validated that it meets trust assertions.

Specified by:
processIncoming in interface NHINDAgent
Parameters:
messageText - The raw contents of the incoming message that will be processed.
recipients - The recipients of the message. This overrides the routing headers in the message.
sender - The sender of the message. This overrides the to FROM routing header in the message.
Returns:
An incoming messaging object that contains the unwrapped and decrypted message.

processIncoming

public IncomingMessage processIncoming(MessageEnvelope envelope)
Processes a pre-enveloped message. The message will be decrypted and validated that it meets trust assertions.

Specified by:
processIncoming in interface NHINDAgent
Parameters:
envelope - A message envelope containing the incoming message.
Returns:
An incoming messaging object that contains the unwrapped and decrypted message.

processIncoming

public IncomingMessage processIncoming(javax.mail.internet.MimeMessage msg)
Processes an incoming mime message. The message will be decrypted and validated that it meets trust assertions.

Specified by:
processIncoming in interface NHINDAgent
Parameters:
msg - The incoming mime message.
Returns:
An incoming messaging object that contains the unwrapped and decrypted message.

processIncoming

public IncomingMessage processIncoming(IncomingMessage message)
Processes a pre-enveloped message. The message will be decrypted and validated that it meets trust assertions.

Specified by:
processIncoming in interface NHINDAgent
Parameters:
envelope - A message envelope containing the incoming message.
Returns:
An incoming messaging object that contains the unwrapped and decrypted message.

processOutgoing

public OutgoingMessage processOutgoing(java.lang.String messageText)
Processes an outgoing message represented by a raw string. The message will be wrapped, encrypted, and signed.

Specified by:
processOutgoing in interface NHINDAgent
Parameters:
messageText - The raw contents of the incoming message that will be processed.
Returns:
An outoing messaging object that contains the wrapped message that is and encrypted and signed.

processOutgoing

public OutgoingMessage processOutgoing(java.lang.String messageText,
                                       NHINDAddressCollection recipients,
                                       NHINDAddress sender)
Processes an outgoing message represented by a raw string. The message will be wrapped, encrypted, and signed.

Specified by:
processOutgoing in interface NHINDAgent
Parameters:
messageText - The raw contents of the incoming message that will be processed.
recipients - The recipients of the message. This overrides the routing headers in the message.
sender - The sender of the message. This overrides the to FROM routing header in the message.
Returns:
An outoing messaging object that contains the wrapped message that is and encrypted and signed.

processOutgoing

public OutgoingMessage processOutgoing(MessageEnvelope envelope)
Processes an outgoing pre-enveloped message. The message will be wrapped, encrypted, and signed.

Specified by:
processOutgoing in interface NHINDAgent
Parameters:
envelope - A message envelope containing the outgoing message.
Returns:
An outoing messaging object that contains the wrapped message that is and encrypted and signed.

processOutgoing

public OutgoingMessage processOutgoing(OutgoingMessage message)
Processes an outgoing pre-enveloped message. The message will be wrapped, encrypted, and signed.

Specified by:
processOutgoing in interface NHINDAgent
Parameters:
message - A message envelope containing the incoming message.
Returns:
An outoing messaging object that contains the wrapped message that is and encrypted and signed.


Copyright © 2010-2011 HNIN Direct. All Rights Reserved.