IP*Works! S/MIME V9

ipworkssmime
Class Snntp

java.lang.Object
  extended by ipworkssmime.Snntp

public class Snntp
extends java.lang.Object

The SNNTP Bean is used to read and post articles on Usenet news servers.

The SNNTP Bean is the S/MIME enabled equivalent of the IP*Works! NNTP bean. In addition to standard NNTP functions the SNNTP bean can sign, encrypt, decrypt, and verify message signatures. The methods and properties for encrypting, signing, decrypting, and verifying signatures are identical to those provided with the S/MIME bean. After setting the certificate properties, and specifying ArticleText , call the Encrypt , Sign or SignAndEncrypt method before posting and the result will be stored in ArticleText . When attempting to verify a signed message or when decrypting a message call the Decrypt , VerifySignature , or DecryptAndVerifySignature methods and the resulting text will be replaced in ArticleText .

The SNNTP Bean implements a standard Usenet news reader as specified in RFC 977. It can be used to browse Usenet news groups and read and post articles.

The CurrentGroup property sets the current newsgroup. From then on, news articles from that group can be read by setting the article number in CurrentArticle and then calling the appropriate method. Properties such as ArticleCount , FirstArticle , LastArticle provide information about the current state.

The headers and text of the articles are received respectively through the Header and Transfer events. Additionally, up to MaxLines from the article body are provided in the ArticleText property. The GroupOverview event returns information about a range of articles ( OverviewRange ) in CurrentGroup , and the GroupList event is used when listing newsgroup names. The PITrail event provides a trace of the interaction with the server.

The bean supports posting of articles through the ArticleText and AttachedFile properties. The article text is specified in one or both of the above, and then the PostArticle method is called. Article headers are given in a series of properties like ArticleFrom , ArticleSubject , Organization , etc. that map directly to the USENET article header with the same name.


Field Summary
static int sslAutomatic
           
static int sslExplicit
           
static int sslImplicit
           
static int sslNone
           
 
Constructor Summary
Snntp()
          Creates an instance of Snntp Bean.
Snntp(java.lang.String runtimeLicense)
          Creates an instance of Snntp Bean with specified run-time license.
 
Method Summary
 void addRecipientCert(byte[] certEncoded)
          Used to add recipient certificates used to encrypt messages.
 void addSnntpEventListener(SnntpEventListener l)
           
 java.lang.String config(java.lang.String configurationString)
          Sets or retrieves a configuration setting.
 void connect()
          Connects to the news server.
 void decrypt()
          Decrypts the current Message .
 void decryptAndVerifySignature()
          Decrypts and verifies the signature of the current Message .
 void disconnect()
          Disconnects from the news server.
 void doEvents()
          Processes events from the internal message queue.
 void encrypt()
          Encrypts the current Message .
 void fetchArticle()
          Get the headers and body of an article specified in CurrentArticle .
 void fetchArticleBody()
          Gets only the body of an article specified in CurrentArticle .
 void fetchArticleHeaders()
          Gets only the headers of an article specified in CurrentArticle .
 int getArticleCount()
          The estimated number of articles in CurrentGroup .
 java.lang.String getArticleDate()
          The date of the current article.
 java.lang.String getArticleFrom()
          The email address of the author (for posting articles).
 java.lang.String getArticleHeaders()
          The full headers of the article as retrieved from the server.
 java.lang.String getArticleId()
          The message identifier of the current article.
 ArticleInfoList getArticleList()
          Collection of articles collected through GroupOverview or GroupSearch .
 java.lang.String getArticleReferences()
          Articles to which the posted article follows up.
 java.lang.String getArticleReplyTo()
          The address to reply to (for posting articles).
 java.lang.String getArticleSubject()
          The article subject (for posted articles).
 java.lang.String getArticleText()
          The full text of the article (without the headers).
 java.lang.String getAttachedFile()
          A file name which the contents of will be appended to the ArticleText when posting articles.
 Certificate getCertificate()
          The current selected certificate.
 java.lang.String getCheckDate()
          The date (format YYMMDD HHMMSS) to check for creation of new groups.
 java.lang.String getCurrentArticle()
          The number or message identifier of the current article.
 java.lang.String getCurrentGroup()
          The name of the current group.
 java.lang.String getEncryptingAlgorithm()
          Textual description of the encrypting algorithm.
 Firewall getFirewall()
          A set of properties related to firewall access.
 int getFirstArticle()
          The number of the first article in CurrentGroup .
 GroupInfoList getGroupList()
          Collection of newsgroups listed by ListGroups or ListNewGroups .
 int getLastArticle()
          The number of the last article in CurrentGroup .
 java.lang.String getLastReply()
          The last reply from the server.
 java.lang.String getLocalHost()
          The name of the local host or user-assigned IP interface through which connections are initiated or accepted.
 int getMaxLines()
          The maximum number of message lines aside from headers to retrieve.
 java.lang.String getNewsgroups()
          A comma separated list of newsgroups in which to post the article.
 int getNewsPort()
          The server port for NNTP (default 119).
 java.lang.String getNewsServer()
          The name or address of a news server.
 java.lang.String getOrganization()
          The organization of the author (for posting articles).
 java.lang.String getOtherHeaders()
          An RFC850 compliant string consisting of extra headers (for posting articles).
 java.lang.String getOverviewRange()
          A range for the GroupOverview method (first-last).
 HeaderList getParsedHeaders()
          A collection of headers returned from the last article retrieval.
 java.lang.String getPassword()
          A logon password for the NewsServer .
 CertificateList getRecipientCerts()
          The collection of recipient certificates of the message.
 java.lang.String getSearchHeader()
          A header for the GroupSearch method.
 java.lang.String getSearchPattern()
          A search pattern for the GroupSearch method.
 java.lang.String getSearchRange()
          A range for the GroupSearch method (first-last).
 Certificate getSignerCert()
          Contains the certificate of the message signer.
 java.lang.String getSigningAlgorithm()
          Textual description of the signature hash algorithm.
 Certificate getSSLAcceptServerCert()
          Instructs the bean to unconditionally accept the server certificate that matches the supplied certificate.
 Certificate getSSLCert()
          The certificate to be used during SSL negotiation.
 Certificate getSSLServerCert()
          The server certificate for the last established connection.
 int getSSLStartMode()
          Determines how the bean starts the SSL negotiation.
 int getTimeout()
          A timeout for the bean.
 java.lang.String getUser()
          A user identifier to login as in the NewsServer .
 void groupOverview()
          Receives an overview for the articles in range OverviewRange in the CurrentGroup .
 void groupSearch()
          Receives an overview for the articles in range SearchRange in the CurrentGroup .
 void interrupt()
          Interrupt the current method.
 boolean isConnected()
          Shows whether the bean is connected.
 boolean isIdle()
          The current status of the component.
 boolean isIncludeCertificate()
          Specifies whether to include the signer's certificate with the signed message.
 boolean isIncludeChain()
          Specifies whether to include the signer's certificate chain with the signed message.
 void listGroups()
          Lists all groups on the server.
 void listNewGroups()
          Lists all new groups on the server.
 java.lang.String localizeDate(java.lang.String dateTime)
          Converts a valid RFC 822 message date to local date and time.
 void postArticle()
          Posts the current article and attached file.
 void removeSnntpEventListener(SnntpEventListener l)
           
 void resetHeaders()
          Resets all of the article headers.
 void setArticleFrom(java.lang.String articleFrom)
          The email address of the author (for posting articles).
 void setArticleReferences(java.lang.String articleReferences)
          Articles to which the posted article follows up.
 void setArticleReplyTo(java.lang.String articleReplyTo)
          The address to reply to (for posting articles).
 void setArticleStream(java.io.OutputStream articleStream)
          Sets the stream to which the article downloaded from the server will be written.
 void setArticleSubject(java.lang.String articleSubject)
          The article subject (for posted articles).
 void setArticleText(java.lang.String articleText)
          The full text of the article (without the headers).
 void setAttachedFile(java.lang.String attachedFile)
          A file name which the contents of will be appended to the ArticleText when posting articles.
 void setCertificate(Certificate certificate)
          The current selected certificate.
 void setCheckDate(java.lang.String checkDate)
          The date (format YYMMDD HHMMSS) to check for creation of new groups.
 void setCommand(java.lang.String command)
          Used to send additional commands directly to the server.
 void setConnected(boolean connected)
          Shows whether the bean is connected.
 void setCurrentArticle(java.lang.String currentArticle)
          The number or message identifier of the current article.
 void setCurrentGroup(java.lang.String currentGroup)
          The name of the current group.
 void setEncryptingAlgorithm(java.lang.String encryptingAlgorithm)
          Textual description of the encrypting algorithm.
 void setFirewall(Firewall firewall)
          A set of properties related to firewall access.
 void setIncludeCertificate(boolean includeCertificate)
          Specifies whether to include the signer's certificate with the signed message.
 void setIncludeChain(boolean includeChain)
          Specifies whether to include the signer's certificate chain with the signed message.
 void setLocalHost(java.lang.String localHost)
          The name of the local host or user-assigned IP interface through which connections are initiated or accepted.
 void setMaxLines(int maxLines)
          The maximum number of message lines aside from headers to retrieve.
 void setNewsgroups(java.lang.String newsgroups)
          A comma separated list of newsgroups in which to post the article.
 void setNewsPort(int newsPort)
          The server port for NNTP (default 119).
 void setNewsServer(java.lang.String newsServer)
          The name or address of a news server.
 void setOrganization(java.lang.String organization)
          The organization of the author (for posting articles).
 void setOtherHeaders(java.lang.String otherHeaders)
          An RFC850 compliant string consisting of extra headers (for posting articles).
 void setOverviewRange(java.lang.String overviewRange)
          A range for the GroupOverview method (first-last).
 void setPassword(java.lang.String password)
          A logon password for the NewsServer .
 void setSearchHeader(java.lang.String searchHeader)
          A header for the GroupSearch method.
 void setSearchPattern(java.lang.String searchPattern)
          A search pattern for the GroupSearch method.
 void setSearchRange(java.lang.String searchRange)
          A range for the GroupSearch method (first-last).
 void setSignerCert(Certificate signerCert)
          Contains the certificate of the message signer.
 void setSigningAlgorithm(java.lang.String signingAlgorithm)
          Textual description of the signature hash algorithm.
 void setSSLAcceptServerCert(Certificate SSLAcceptServerCert)
          Instructs the bean to unconditionally accept the server certificate that matches the supplied certificate.
 void setSSLCert(Certificate SSLCert)
          The certificate to be used during SSL negotiation.
 void setSSLStartMode(int SSLStartMode)
          Determines how the bean starts the SSL negotiation.
 void setTimeout(int timeout)
          A timeout for the bean.
 void setUser(java.lang.String user)
          A user identifier to login as in the NewsServer .
 void sign()
          Signs the current Message .
 void signAndEncrypt()
          Signs and encrypts the current Message .
 void verifySignature()
          Verifies the signature of the current Message .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sslAutomatic

public static final int sslAutomatic
See Also:
Constant Field Values

sslImplicit

public static final int sslImplicit
See Also:
Constant Field Values

sslExplicit

public static final int sslExplicit
See Also:
Constant Field Values

sslNone

public static final int sslNone
See Also:
Constant Field Values
Constructor Detail

Snntp

public Snntp()
Creates an instance of Snntp Bean.


Snntp

public Snntp(java.lang.String runtimeLicense)
Creates an instance of Snntp Bean with specified run-time license.

Method Detail

getArticleCount

public int getArticleCount()
The estimated number of articles in CurrentGroup .

This property contains the estimated number of articles in CurrentGroup The value of this property is 0 if there is no current group ( CurrentGroup is ""). Otherwise, when CurrentGroup is set it is the number of articles in the group as shown by the news server. For most news servers, this is an estimated value of the number of the articles, rather than the exact value.


getArticleDate

public java.lang.String getArticleDate()
The date of the current article.

This property contains the date of the current article. If the bean is not connected or CurrentArticle is empty, the value of this property is an empty string. Otherwise, it contains the date of the article as reported by the server. The NewsServer is asked about the headers of the article only if the CurrentArticle property has changed. If CurrentArticle has not changed, the bean returns a cached value.


getArticleFrom

public java.lang.String getArticleFrom()
The email address of the author (for posting articles).

This property contains the email address of the author (for posting articles). The string in this property is posted with a From article header to the news server.

If the resulting header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.


setArticleFrom

public void setArticleFrom(java.lang.String articleFrom)
                    throws IPWorksSMIMEException
The email address of the author (for posting articles).

This property contains the email address of the author (for posting articles). The string in this property is posted with a From article header to the news server.

If the resulting header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.

Throws:
IPWorksSMIMEException

getArticleHeaders

public java.lang.String getArticleHeaders()
The full headers of the article as retrieved from the server.

This property contains the full headers of the article as retrieved from the server. If the bean is not connected or the CurrentArticle is empty, the value of this property is an empty string. Otherwise, it contains the full headers of the article as reported by the server.

The NewsServer is asked about the headers of the article only if the CurrentArticle property has changed. If CurrentArticle has not changed, the bean returns a cached value.


getArticleId

public java.lang.String getArticleId()
The message identifier of the current article.

This property contains the message identifier of the current article. If the bean is not connected or the CurrentArticle is empty, the value of this property is an empty string. Otherwise, it contains the message identifier of the article as reported by the server. The NewsServer is asked about the headers of the article only if the CurrentArticle property has changed. If the CurrentArticle has not changed, the bean returns a cached value.


getArticleList

public ArticleInfoList getArticleList()
Collection of articles collected through GroupOverview or GroupSearch .

This property contains a collection of articles collected through GroupOverview or GroupSearch . This collection consists of a list of articleinfo objects. The returned list contains information about each article in the OverviewRange or SearchRange when either GroupOverview or GroupSearch is called.

MaxArticleInfos can be used to control the number of articles saved.

This collection is indexed from 0 to size - 1.


getArticleReferences

public java.lang.String getArticleReferences()
Articles to which the posted article follows up.

This property contains articles to which the posted article follows up. If this property contains a non-empty string, a References article header is created for the article. This header shows the article identifiers for the posted article to which it refers.

The references must be separated by space characters.

If the resulting header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.


setArticleReferences

public void setArticleReferences(java.lang.String articleReferences)
                          throws IPWorksSMIMEException
Articles to which the posted article follows up.

This property contains articles to which the posted article follows up. If this property contains a non-empty string, a References article header is created for the article. This header shows the article identifiers for the posted article to which it refers.

The references must be separated by space characters.

If the resulting header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.

Throws:
IPWorksSMIMEException

getArticleReplyTo

public java.lang.String getArticleReplyTo()
The address to reply to (for posting articles).

This property contains the address to reply to (for posting articles). If this property contains a non-empty string, a Reply-To article header is created for the article. This header shows the address to use for replies (useful if this address is different from the one in ArticleFrom ).

If the resulting header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.


setArticleReplyTo

public void setArticleReplyTo(java.lang.String articleReplyTo)
                       throws IPWorksSMIMEException
The address to reply to (for posting articles).

This property contains the address to reply to (for posting articles). If this property contains a non-empty string, a Reply-To article header is created for the article. This header shows the address to use for replies (useful if this address is different from the one in ArticleFrom ).

If the resulting header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.

Throws:
IPWorksSMIMEException

getArticleSubject

public java.lang.String getArticleSubject()
The article subject (for posted articles).

The string in this property is posted with a Subject article header to the news server.

If the resulting header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.


setArticleSubject

public void setArticleSubject(java.lang.String articleSubject)
                       throws IPWorksSMIMEException
The article subject (for posted articles).

The string in this property is posted with a Subject article header to the news server.

If the resulting header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.

Throws:
IPWorksSMIMEException

getArticleText

public java.lang.String getArticleText()
The full text of the article (without the headers).

This property contains the full text of the article (without the headers). If the bean is not connected or CurrentArticle is empty, the value of this property is an empty string. Otherwise, it contains the full text of the article as reported by the server.

The NewsServer is asked about the text of the article only if the CurrentArticle property has changed. If CurrentArticle has not changed, the bean returns a cached value.

When posting articles, this property contains the full text of the article to post.

It is advisable that the text contained in this property be a collection of lines with lengths less than or equal to 80 bytes separated by CRLF ("\r\ n") . The text in the article lines must contain 7-bit characters so that the article can be successfully transferred through the various Usenet news servers on the Internet.

The bean automatically escapes lines that start with a "." by adding another "." as specified in RFC 977. The article text is unescaped by the news server, so the process is fully transparent.


setArticleText

public void setArticleText(java.lang.String articleText)
                    throws IPWorksSMIMEException
The full text of the article (without the headers).

This property contains the full text of the article (without the headers). If the bean is not connected or CurrentArticle is empty, the value of this property is an empty string. Otherwise, it contains the full text of the article as reported by the server.

The NewsServer is asked about the text of the article only if the CurrentArticle property has changed. If CurrentArticle has not changed, the bean returns a cached value.

When posting articles, this property contains the full text of the article to post.

It is advisable that the text contained in this property be a collection of lines with lengths less than or equal to 80 bytes separated by CRLF ("\r\ n") . The text in the article lines must contain 7-bit characters so that the article can be successfully transferred through the various Usenet news servers on the Internet.

The bean automatically escapes lines that start with a "." by adding another "." as specified in RFC 977. The article text is unescaped by the news server, so the process is fully transparent.

Throws:
IPWorksSMIMEException

getAttachedFile

public java.lang.String getAttachedFile()
A file name which the contents of will be appended to the ArticleText when posting articles.

The content of this property is appended to the text in ArticleText (if any) and sent to the news server. This property is useful for posting arbitrarily large articles and/or sending MIME attachments.

It is advisable that the text contained in the file be a collection of lines with lengths less than or equal to 80 bytes separated by CRLF ("\r\ n") . The text in the message lines must contain only 7-bit characters so that the message may be successfully sent through the various Usenet news servers on the Internet.

The bean automatically escapes lines that start with a "." by adding another as specified in RFC 822. The article text is unescaped by the news server, so the process is fully transparent.


setAttachedFile

public void setAttachedFile(java.lang.String attachedFile)
                     throws IPWorksSMIMEException
A file name which the contents of will be appended to the ArticleText when posting articles.

The content of this property is appended to the text in ArticleText (if any) and sent to the news server. This property is useful for posting arbitrarily large articles and/or sending MIME attachments.

It is advisable that the text contained in the file be a collection of lines with lengths less than or equal to 80 bytes separated by CRLF ("\r\ n") . The text in the message lines must contain only 7-bit characters so that the message may be successfully sent through the various Usenet news servers on the Internet.

The bean automatically escapes lines that start with a "." by adding another as specified in RFC 822. The article text is unescaped by the news server, so the process is fully transparent.

Throws:
IPWorksSMIMEException

getCertificate

public Certificate getCertificate()
The current selected certificate.

This property is populated when a specified certificate is found or loaded by the bean. This property is used for specifying private keys. Set this property to a valid Certificate object to perform different operations such as Sign , Decrypt , SignAndEncrypt , or DecryptAndVerifySignature . To set a certificate, you may set the Encoded field to the encoded certificate. To select a certificate, use the Store and Subject fields.


setCertificate

public void setCertificate(Certificate certificate)
                    throws IPWorksSMIMEException
The current selected certificate.

This property is populated when a specified certificate is found or loaded by the bean. This property is used for specifying private keys. Set this property to a valid Certificate object to perform different operations such as Sign , Decrypt , SignAndEncrypt , or DecryptAndVerifySignature . To set a certificate, you may set the Encoded field to the encoded certificate. To select a certificate, use the Store and Subject fields.

Throws:
IPWorksSMIMEException

getCheckDate

public java.lang.String getCheckDate()
The date (format YYMMDD HHMMSS) to check for creation of new groups. If the group was created after the date specified, it is considered new.

This property contains the date (format YYMMDD HHMMSS) to check for creation of new groups. If the group was created after the date specified, it is considered new. The value of this property is used as an argument for the ListNewGroups method.


setCheckDate

public void setCheckDate(java.lang.String checkDate)
                  throws IPWorksSMIMEException
The date (format YYMMDD HHMMSS) to check for creation of new groups. If the group was created after the date specified, it is considered new.

This property contains the date (format YYMMDD HHMMSS) to check for creation of new groups. If the group was created after the date specified, it is considered new. The value of this property is used as an argument for the ListNewGroups method.

Throws:
IPWorksSMIMEException

setCommand

public void setCommand(java.lang.String command)
                throws IPWorksSMIMEException
Used to send additional commands directly to the server.

This property can be used to send additional commands directly to the server. Check the LastReply property and/or trap the PITrail events coming from the server to get the response.

Throws:
IPWorksSMIMEException

isConnected

public boolean isConnected()
Shows whether the bean is connected.

This property is used to determine whether or not the bean is connected to the remote host.


setConnected

public void setConnected(boolean connected)
                  throws IPWorksSMIMEException
Shows whether the bean is connected.

This property is used to determine whether or not the bean is connected to the remote host.

Throws:
IPWorksSMIMEException

getCurrentArticle

public java.lang.String getCurrentArticle()
The number or message identifier of the current article.

This property specifies either a message identifier or an article number uniquely identifying a particular article. It is then used as an argument to methods such as FetchArticle .


setCurrentArticle

public void setCurrentArticle(java.lang.String currentArticle)
                       throws IPWorksSMIMEException
The number or message identifier of the current article.

This property specifies either a message identifier or an article number uniquely identifying a particular article. It is then used as an argument to methods such as FetchArticle .

Throws:
IPWorksSMIMEException

getCurrentGroup

public java.lang.String getCurrentGroup()
The name of the current group.

This property contains the name of the current group. When this property is set to a valid group name, the bean sends an NNTP GROUP command to the NewsServer and enters the specified group. If the command is successful, FirstArticle , LastArticle , and ArticleCount are set to the reported values for the group. This property is then used for all references to articles (until changed to another group).


setCurrentGroup

public void setCurrentGroup(java.lang.String currentGroup)
                     throws IPWorksSMIMEException
The name of the current group.

This property contains the name of the current group. When this property is set to a valid group name, the bean sends an NNTP GROUP command to the NewsServer and enters the specified group. If the command is successful, FirstArticle , LastArticle , and ArticleCount are set to the reported values for the group. This property is then used for all references to articles (until changed to another group).

Throws:
IPWorksSMIMEException

getEncryptingAlgorithm

public java.lang.String getEncryptingAlgorithm()
Textual description of the encrypting algorithm.

This property contains either the name of the algorithm (such as "RC2", "3DES", "DES", or "AES"), or an object identifier (OID) string representing the algorithm.

In the case of "RC2" ("RC2CBC") the key bit length is specified after the name. The following algorithm names are supported for RC2: "RC2CBC40", "RC2CBC64", and "RC2CBC128", with the default being 128 bit ("RC2CBC128").

RC2 is not supported in the Java edition.

In the case of "AES" ("AESCBC") the key bit length is specified after the name. The following algorithm names are supported for AES: "AESCBC128", "AESCBC192", and "AESCBC256", with the default being 128 bit ("AESCBC128").

When read, the value of the property always contains the OID of the algorithm, or an empty string if the algorithm is unknown.


setEncryptingAlgorithm

public void setEncryptingAlgorithm(java.lang.String encryptingAlgorithm)
                            throws IPWorksSMIMEException
Textual description of the encrypting algorithm.

This property contains either the name of the algorithm (such as "RC2", "3DES", "DES", or "AES"), or an object identifier (OID) string representing the algorithm.

In the case of "RC2" ("RC2CBC") the key bit length is specified after the name. The following algorithm names are supported for RC2: "RC2CBC40", "RC2CBC64", and "RC2CBC128", with the default being 128 bit ("RC2CBC128").

RC2 is not supported in the Java edition.

In the case of "AES" ("AESCBC") the key bit length is specified after the name. The following algorithm names are supported for AES: "AESCBC128", "AESCBC192", and "AESCBC256", with the default being 128 bit ("AESCBC128").

When read, the value of the property always contains the OID of the algorithm, or an empty string if the algorithm is unknown.

Throws:
IPWorksSMIMEException

getFirewall

public Firewall getFirewall()
A set of properties related to firewall access.

This is a Firewall type property which contains fields describing the firewall through which the bean will attempt to connect.


setFirewall

public void setFirewall(Firewall firewall)
                 throws IPWorksSMIMEException
A set of properties related to firewall access.

This is a Firewall type property which contains fields describing the firewall through which the bean will attempt to connect.

Throws:
IPWorksSMIMEException

getFirstArticle

public int getFirstArticle()
The number of the first article in CurrentGroup .

This property contains the number of the first article in CurrentGroup . The value of this property is 0 if there is no current group ( CurrentGroup is "").


getGroupList

public GroupInfoList getGroupList()
Collection of newsgroups listed by ListGroups or ListNewGroups .

This property contains a collection of newsgroups listed by ListGroups or ListNewGroups . This collection consists of a list of groupinfo objects. These objects contain information about each group such as the name, first and last article, and whether or not you can post to the group.

MaxGroupInfos can be used to control the number of groups saved.

This collection is indexed from 0 to size - 1.


isIdle

public boolean isIdle()
The current status of the component.

Idle will be False if the component is currently busy (communicating and/or waiting for an answer), and True at all other times.


isIncludeCertificate

public boolean isIncludeCertificate()
Specifies whether to include the signer's certificate with the signed message.

If this property is set to True, the certificate used to sign the message will be encoded and included in message signature when calling Sign or SignAndEncrypt .

Including a certificate is the preferred method of building signed messages. If you do not include a certificate, the message recipient may not be able to verify the sender's signature.


setIncludeCertificate

public void setIncludeCertificate(boolean includeCertificate)
                           throws IPWorksSMIMEException
Specifies whether to include the signer's certificate with the signed message.

If this property is set to True, the certificate used to sign the message will be encoded and included in message signature when calling Sign or SignAndEncrypt .

Including a certificate is the preferred method of building signed messages. If you do not include a certificate, the message recipient may not be able to verify the sender's signature.

Throws:
IPWorksSMIMEException

isIncludeChain

public boolean isIncludeChain()
Specifies whether to include the signer's certificate chain with the signed message.

If this property is set to True, the entire certificate's chain that was used to sign the message will be encoded and included in the message signature when calling Sign or SignAndEncrypt .

NOTE: To include the chain, the IncludeCertificate property must also be set to true.


setIncludeChain

public void setIncludeChain(boolean includeChain)
                     throws IPWorksSMIMEException
Specifies whether to include the signer's certificate chain with the signed message.

If this property is set to True, the entire certificate's chain that was used to sign the message will be encoded and included in the message signature when calling Sign or SignAndEncrypt .

NOTE: To include the chain, the IncludeCertificate property must also be set to true.

Throws:
IPWorksSMIMEException

getLastArticle

public int getLastArticle()
The number of the last article in CurrentGroup .

This property contains the number of the last article in CurrentGroup . The value of this property is 0 if there is no current group ( CurrentGroup is "").


getLastReply

public java.lang.String getLastReply()
The last reply from the server.

This property indicates the last reply received from the server. It can be used for informational purposes. The same information and more can also be retrieved through the PITrail event.


getLocalHost

public java.lang.String getLocalHost()
The name of the local host or user-assigned IP interface through which connections are initiated or accepted.

The LocalHost property contains the name of the local host as obtained by the gethostname() system call, or if the user has assigned an IP address, the value of that address.

In multi-homed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the bean initiate connections (or accept in the case of server beans) only through that interface.

If the bean is connected, the LocalHost property shows the IP address of the interface through which the connection is made in internet dotted format (aaa.bbb.ccc.ddd). In most cases, this is the address of the local host, except for multi-homed hosts (machines with more than one IP interface).

NOTE: LocalHost is not persistent. You must always set it in code, and never in the property window.


setLocalHost

public void setLocalHost(java.lang.String localHost)
                  throws IPWorksSMIMEException
The name of the local host or user-assigned IP interface through which connections are initiated or accepted.

The LocalHost property contains the name of the local host as obtained by the gethostname() system call, or if the user has assigned an IP address, the value of that address.

In multi-homed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the bean initiate connections (or accept in the case of server beans) only through that interface.

If the bean is connected, the LocalHost property shows the IP address of the interface through which the connection is made in internet dotted format (aaa.bbb.ccc.ddd). In most cases, this is the address of the local host, except for multi-homed hosts (machines with more than one IP interface).

NOTE: LocalHost is not persistent. You must always set it in code, and never in the property window.

Throws:
IPWorksSMIMEException

getMaxLines

public int getMaxLines()
The maximum number of message lines aside from headers to retrieve.

This property is used to limit the number of text lines aside from headers retrieved for messages. This property is used in conjunction with the ArticleText property. Please note that due to NNTP protocol limitations, the full text of the article is always retrieved from the server, but only MaxLines will be stored in ArticleText .

The default value of the property is 0. In this case the entire message will be retrieved, without interruptions.


setMaxLines

public void setMaxLines(int maxLines)
                 throws IPWorksSMIMEException
The maximum number of message lines aside from headers to retrieve.

This property is used to limit the number of text lines aside from headers retrieved for messages. This property is used in conjunction with the ArticleText property. Please note that due to NNTP protocol limitations, the full text of the article is always retrieved from the server, but only MaxLines will be stored in ArticleText .

The default value of the property is 0. In this case the entire message will be retrieved, without interruptions.

Throws:
IPWorksSMIMEException

getNewsgroups

public java.lang.String getNewsgroups()
A comma separated list of newsgroups in which to post the article.

The string in this property is posted with a Newsgroups article header to the news server. It specifies the list of groups where the article is posted (comma separated).

If this property contains "" (empty string), then the value of the CurrentGroup property is used to specify the target newsgroup for the posted article.

If the resulting header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.


setNewsgroups

public void setNewsgroups(java.lang.String newsgroups)
                   throws IPWorksSMIMEException
A comma separated list of newsgroups in which to post the article.

The string in this property is posted with a Newsgroups article header to the news server. It specifies the list of groups where the article is posted (comma separated).

If this property contains "" (empty string), then the value of the CurrentGroup property is used to specify the target newsgroup for the posted article.

If the resulting header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.

Throws:
IPWorksSMIMEException

getNewsPort

public int getNewsPort()
The server port for NNTP (default 119).

This property contains the server port for NNTP (default 119). A valid port number (a value between 1 and 65535) is required for the connection to take place. The property must be set before a connection is attempted and cannot be changed once a connection is established. Any attempt to change this property while connected will fail with an error.


setNewsPort

public void setNewsPort(int newsPort)
                 throws IPWorksSMIMEException
The server port for NNTP (default 119).

This property contains the server port for NNTP (default 119). A valid port number (a value between 1 and 65535) is required for the connection to take place. The property must be set before a connection is attempted and cannot be changed once a connection is established. Any attempt to change this property while connected will fail with an error.

Throws:
IPWorksSMIMEException

getNewsServer

public java.lang.String getNewsServer()
The name or address of a news server.

This property specifies the IP address (IP number in dotted internet format) or the Domain Name for the news server. It is set before a connection is attempted and cannot be changed once a connection is in progress.

If this property is set to a Domain Name, a DNS request is initiated and upon successful termination of the request, this property is set to the corresponding address. If the search is not successful, an error is returned.

If the bean is configured to use a SOCKS firewall, the value assigned to this property may be preceded with an "*". If this is the case, the host name is passed to the firewall unresolved and the firewall performs the DNS resolution.


setNewsServer

public void setNewsServer(java.lang.String newsServer)
                   throws IPWorksSMIMEException
The name or address of a news server.

This property specifies the IP address (IP number in dotted internet format) or the Domain Name for the news server. It is set before a connection is attempted and cannot be changed once a connection is in progress.

If this property is set to a Domain Name, a DNS request is initiated and upon successful termination of the request, this property is set to the corresponding address. If the search is not successful, an error is returned.

If the bean is configured to use a SOCKS firewall, the value assigned to this property may be preceded with an "*". If this is the case, the host name is passed to the firewall unresolved and the firewall performs the DNS resolution.

Throws:
IPWorksSMIMEException

getOrganization

public java.lang.String getOrganization()
The organization of the author (for posting articles).

This property contains the organization of the article's author. If this property contains a non-empty string, an Organization article header is created for the article. This header shows the organization of the author and is used for information purposes only.

If the resulting header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.


setOrganization

public void setOrganization(java.lang.String organization)
                     throws IPWorksSMIMEException
The organization of the author (for posting articles).

This property contains the organization of the article's author. If this property contains a non-empty string, an Organization article header is created for the article. This header shows the organization of the author and is used for information purposes only.

If the resulting header is longer than MaxHeaderLength , then it is folded according to RFC 850 specifications.

Throws:
IPWorksSMIMEException

getOtherHeaders

public java.lang.String getOtherHeaders()
An RFC850 compliant string consisting of extra headers (for posting articles).

This property contains a string of headers to be appended to the message headers created from other properties like From , Subject , etc.

The headers must be of the format "header: value" as specified in RFC 850. [Header lines should be separated by CRLF ("\r\ n") .

Use this property with caution. If this property contains invalid headers, article posting might not be successful.

This property is useful for extending the functionality of the bean. A good example is posting of MIME attachments.

SPECIAL CASE: if this property starts with an empty line (CRLF), then the value of this property is used instead of the normally computed article headers.


setOtherHeaders

public void setOtherHeaders(java.lang.String otherHeaders)
                     throws IPWorksSMIMEException
An RFC850 compliant string consisting of extra headers (for posting articles).

This property contains a string of headers to be appended to the message headers created from other properties like From , Subject , etc.

The headers must be of the format "header: value" as specified in RFC 850. [Header lines should be separated by CRLF ("\r\ n") .

Use this property with caution. If this property contains invalid headers, article posting might not be successful.

This property is useful for extending the functionality of the bean. A good example is posting of MIME attachments.

SPECIAL CASE: if this property starts with an empty line (CRLF), then the value of this property is used instead of the normally computed article headers.

Throws:
IPWorksSMIMEException

getOverviewRange

public java.lang.String getOverviewRange()
A range for the GroupOverview method (first-last).

This property specifies a range of articles for which to retrieve article overviews from the server. The format is 'first-last' where first is "" (empty string) or a positive number, and last is "" (empty string), a positive number, or the token end .

The default value of this property is '-', meaning 'all articles in the group' .


setOverviewRange

public void setOverviewRange(java.lang.String overviewRange)
                      throws IPWorksSMIMEException
A range for the GroupOverview method (first-last).

This property specifies a range of articles for which to retrieve article overviews from the server. The format is 'first-last' where first is "" (empty string) or a positive number, and last is "" (empty string), a positive number, or the token end .

The default value of this property is '-', meaning 'all articles in the group' .

Throws:
IPWorksSMIMEException

getParsedHeaders

public HeaderList getParsedHeaders()
A collection of headers returned from the last article retrieval.

This property contains a collection of headers returned from the last article retrieval. This property is populated when either FetchArticle or FetchArticleHeaders is called, and contains a list of all of the headers from the article fetched.

If the header line being retrieved is a continuation header line, then the Field parameter contains "" (empty string).

MaxHeaders can be used to control the number of headers saved.

This collection is indexed from 0 to size - 1.


getPassword

public java.lang.String getPassword()
A logon password for the NewsServer .

This property contains a logon password for the NewsServer . If this property is set to a non-empty string, then when connecting to the NewsServer an AUTHINFO PASS command is sent in order to provide authentication information for the user. This command is not part of the NNTP protocol, but it is widely used by popular news servers.


setPassword

public void setPassword(java.lang.String password)
                 throws IPWorksSMIMEException
A logon password for the NewsServer .

This property contains a logon password for the NewsServer . If this property is set to a non-empty string, then when connecting to the NewsServer an AUTHINFO PASS command is sent in order to provide authentication information for the user. This command is not part of the NNTP protocol, but it is widely used by popular news servers.

Throws:
IPWorksSMIMEException

getRecipientCerts

public CertificateList getRecipientCerts()
The collection of recipient certificates of the message.

This property is used to specify the certificates of the intended recipients of the encrypted message. This property must be set prior to calling Encrypt or SignAndEncrypt methods.

This property's collection must be filled out with valid public key Certificate type objects. To set a certificate, you may set the Encoded field to the encoded certificate. To select a certificate, use the Store and Subject fields.

This collection is indexed from 0 to size - 1.


getSearchHeader

public java.lang.String getSearchHeader()
A header for the GroupSearch method.

This property specifies the header to search for SearchPattern (e.g. "Subject").


setSearchHeader

public void setSearchHeader(java.lang.String searchHeader)
                     throws IPWorksSMIMEException
A header for the GroupSearch method.

This property specifies the header to search for SearchPattern (e.g. "Subject").

Throws:
IPWorksSMIMEException

getSearchPattern

public java.lang.String getSearchPattern()
A search pattern for the GroupSearch method.

This property contains a search pattern for the GroupSearch method. The format of the pattern is the same as the patterns used by the UNIX 'find' command.

As an example, "* new *" will match all headers that contain the word "new".


setSearchPattern

public void setSearchPattern(java.lang.String searchPattern)
                      throws IPWorksSMIMEException
A search pattern for the GroupSearch method.

This property contains a search pattern for the GroupSearch method. The format of the pattern is the same as the patterns used by the UNIX 'find' command.

As an example, "* new *" will match all headers that contain the word "new".

Throws:
IPWorksSMIMEException

getSearchRange

public java.lang.String getSearchRange()
A range for the GroupSearch method (first-last).

This property specifies a range of articles for which to do a search on the server. The format is 'first-last' where first is "" (empty string) or a positive number, and last is "" (empty string), a positive number, or the token end .

The default value of the property is '-', meaning 'search all articles in the group' .


setSearchRange

public void setSearchRange(java.lang.String searchRange)
                    throws IPWorksSMIMEException
A range for the GroupSearch method (first-last).

This property specifies a range of articles for which to do a search on the server. The format is 'first-last' where first is "" (empty string) or a positive number, and last is "" (empty string), a positive number, or the token end .

The default value of the property is '-', meaning 'search all articles in the group' .

Throws:
IPWorksSMIMEException

getSignerCert

public Certificate getSignerCert()
Contains the certificate of the message signer.

This property contains the certificate of the message signer. When calling VerifySignature or DecryptAndVerifySignature this property will contain the certificate of the sender if attached.

To verify messages without an attached certificate, set this property before calling VerifySignature or DecryptAndVerifySignature .


setSignerCert

public void setSignerCert(Certificate signerCert)
                   throws IPWorksSMIMEException
Contains the certificate of the message signer.

This property contains the certificate of the message signer. When calling VerifySignature or DecryptAndVerifySignature this property will contain the certificate of the sender if attached.

To verify messages without an attached certificate, set this property before calling VerifySignature or DecryptAndVerifySignature .

Throws:
IPWorksSMIMEException

getSigningAlgorithm

public java.lang.String getSigningAlgorithm()
Textual description of the signature hash algorithm.

This property specifies the hash algorithm used to prepare the message digest for signature.

This property must contain either the name of the algorithm (such as "MD5" or "SHA1"), or an object id (OID) string representing the hash algorithm.

When read, the value of the property always contains the OID of the algorithm, or an empty string if the algorithm is unknown.


setSigningAlgorithm

public void setSigningAlgorithm(java.lang.String signingAlgorithm)
                         throws IPWorksSMIMEException
Textual description of the signature hash algorithm.

This property specifies the hash algorithm used to prepare the message digest for signature.

This property must contain either the name of the algorithm (such as "MD5" or "SHA1"), or an object id (OID) string representing the hash algorithm.

When read, the value of the property always contains the OID of the algorithm, or an empty string if the algorithm is unknown.

Throws:
IPWorksSMIMEException

getSSLAcceptServerCert

public Certificate getSSLAcceptServerCert()
Instructs the bean to unconditionally accept the server certificate that matches the supplied certificate.

If it finds any issues with the certificate presented by the server, the bean will normally terminate the connection with an error.

You may override this behavior by supplying a value for SSLAcceptServerCert . If the certificate supplied in SSLAcceptServerCert is the same as the certificate presented by the server, then the server certificate is accepted unconditionally, and the connection will continue normally.

Please note that this functionality is provided only for cases where you otherwise know that you are communicating with the right server. If used improperly, this property may create a security breach. Use it at your own risk.


setSSLAcceptServerCert

public void setSSLAcceptServerCert(Certificate SSLAcceptServerCert)
                            throws IPWorksSMIMEException
Instructs the bean to unconditionally accept the server certificate that matches the supplied certificate.

If it finds any issues with the certificate presented by the server, the bean will normally terminate the connection with an error.

You may override this behavior by supplying a value for SSLAcceptServerCert . If the certificate supplied in SSLAcceptServerCert is the same as the certificate presented by the server, then the server certificate is accepted unconditionally, and the connection will continue normally.

Please note that this functionality is provided only for cases where you otherwise know that you are communicating with the right server. If used improperly, this property may create a security breach. Use it at your own risk.

Throws:
IPWorksSMIMEException

getSSLCert

public Certificate getSSLCert()
The certificate to be used during SSL negotiation.

The digital certificate that the bean will use during SSL negotiation. Set this property to a valid certificate before starting SSL negotiation. To set a certificate, you may set the Encoded field to the encoded certificate. To select a certificate, use the store and subject fields.


setSSLCert

public void setSSLCert(Certificate SSLCert)
                throws IPWorksSMIMEException
The certificate to be used during SSL negotiation.

The digital certificate that the bean will use during SSL negotiation. Set this property to a valid certificate before starting SSL negotiation. To set a certificate, you may set the Encoded field to the encoded certificate. To select a certificate, use the store and subject fields.

Throws:
IPWorksSMIMEException

getSSLServerCert

public Certificate getSSLServerCert()
The server certificate for the last established connection.

SSLServerCert contains the server certificate for the last established connection.

SSLServerCert is reset every time a new connection is attempted.


getSSLStartMode

public int getSSLStartMode()
Determines how the bean starts the SSL negotiation.

The SSLStartMode property may have one of the following values:

0 (sslAutomatic)
If the remote port is set to the standard plaintext port of the protocol (where applicable), the bean will behave the same as if SSLStartMode is set to sslExplicit . In all other cases, SSL negotiation will be implicit ( sslImplicit ).
1 (sslImplicit)
The SSL negotiation will start immediately after the connection is established.
2 (sslExplicit)
The bean will first connect in plaintext, and then explicitly start SSL negotiation through a protocol command such as STARTTLS.
3 (sslNone - default)
No SSL negotiation, no SSL security. All communication will be in plaintext mode.


setSSLStartMode

public void setSSLStartMode(int SSLStartMode)
                     throws IPWorksSMIMEException
Determines how the bean starts the SSL negotiation.

The SSLStartMode property may have one of the following values:

0 (sslAutomatic)
If the remote port is set to the standard plaintext port of the protocol (where applicable), the bean will behave the same as if SSLStartMode is set to sslExplicit . In all other cases, SSL negotiation will be implicit ( sslImplicit ).
1 (sslImplicit)
The SSL negotiation will start immediately after the connection is established.
2 (sslExplicit)
The bean will first connect in plaintext, and then explicitly start SSL negotiation through a protocol command such as STARTTLS.
3 (sslNone - default)
No SSL negotiation, no SSL security. All communication will be in plaintext mode.

Throws:
IPWorksSMIMEException

getTimeout

public int getTimeout()
A timeout for the bean.

If the Timeout property is set to 0, all operations will run uninterrupted until successful completion or an error condition is encountered.

If Timeout is set to a positive value, the bean will wait for the operation to complete before returning control.

The bean will use DoEvents to enter an efficient wait loop during any potential waiting period, making sure that all system events are processed immediately as they arrive. This ensures that the host application does not "freeze" and remains responsive.

If Timeout expires, and the operation is not yet complete, the bean throws an exception.

Please note that by default, all timeouts are inactivity timeouts , i.e. the timeout period is extended by Timeout seconds when any amount of data is successfully sent or received.

Optionally, the behavior of the bean may be changed to absolute timeouts , i.e. the bean will wait for a maximum of Timeout seconds since the beginning of the operation, without extending the timeout period during communications.

This behavior is controlled by the AbsoluteTimeout configuration setting.

The default value for the Timeout property is 60 (seconds).


setTimeout

public void setTimeout(int timeout)
                throws IPWorksSMIMEException
A timeout for the bean.

If the Timeout property is set to 0, all operations will run uninterrupted until successful completion or an error condition is encountered.

If Timeout is set to a positive value, the bean will wait for the operation to complete before returning control.

The bean will use DoEvents to enter an efficient wait loop during any potential waiting period, making sure that all system events are processed immediately as they arrive. This ensures that the host application does not "freeze" and remains responsive.

If Timeout expires, and the operation is not yet complete, the bean throws an exception.

Please note that by default, all timeouts are inactivity timeouts , i.e. the timeout period is extended by Timeout seconds when any amount of data is successfully sent or received.

Optionally, the behavior of the bean may be changed to absolute timeouts , i.e. the bean will wait for a maximum of Timeout seconds since the beginning of the operation, without extending the timeout period during communications.

This behavior is controlled by the AbsoluteTimeout configuration setting.

The default value for the Timeout property is 60 (seconds).

Throws:
IPWorksSMIMEException

getUser

public java.lang.String getUser()
A user identifier to login as in the NewsServer .

This property contains a user identifier to login as in the NewsServer . If this property is set to a non-empty string, then when connecting to the NewsServer an AUTHINFO USER command is sent in order to provide authentication information for the user. Although this command is not part of the NNTP protocol, it is widely used by news servers for authentication purposes.


setUser

public void setUser(java.lang.String user)
             throws IPWorksSMIMEException
A user identifier to login as in the NewsServer .

This property contains a user identifier to login as in the NewsServer . If this property is set to a non-empty string, then when connecting to the NewsServer an AUTHINFO USER command is sent in order to provide authentication information for the user. Although this command is not part of the NNTP protocol, it is widely used by news servers for authentication purposes.

Throws:
IPWorksSMIMEException

addRecipientCert

public void addRecipientCert(byte[] certEncoded)
                      throws IPWorksSMIMEException
Used to add recipient certificates used to encrypt messages.

This method is used to add recipient certificates to the internal MessageRecipients collection used to encrypt the Message . The recipient certificate must be a valid PKCS encoded certificate. If the certificate provided is Base64 encoded it will be decoded first by the object.

The CertMgr bean may be used to retrieve the appropriate certificate from the system.

Throws:
IPWorksSMIMEException

config

public java.lang.String config(java.lang.String configurationString)
                        throws IPWorksSMIMEException
Sets or retrieves a configuration setting.

Config is a generic method available in every bean. It is used to set and retrieve configuration settings for the bean.

Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the bean, access to these internal properties is provided through the Config method.

To set a configuration setting named PROPERTY , you must call Config("PROPERTY=VALUE") , where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a configuration setting, you must call Config("PROPERTY") . The value will be returned as a string.

The bean accepts one or more of the following configuration settings . Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the bean, access to these internal properties is provided through the Config method.

NNTP Configuration Settings

ArticleInfoLimit
Instructs bean to save the amount of articles specified that are returned by the server when a GroupOverview event is fired
This config should be set when the ArticleList collection will be populated after a call to either GroupOverview or GroupSearch . This value represents the number of articles that are to be saved in the collection .To save all items to the collection , set this config to -1. If no items are wanted, set this to 0, which will not save any to the collection . The default for this config is -1, so all items will be included in the collection .

GroupInfoLimit
Instructs bean to save the amount of group info objects specified that are returned by the server after a ListGroups call has been made
This config should be set when the GroupList collection will be populated after a call to ListGroups . This value represents the number of group info objects that are to be saved in the collection .To save all items to the collection , set this config to -1. If no items are wanted, set this to 0, which will not save any to the collection . The default for this config is -1, so all items will be included in the collection .

HeaderLimit
Instructs bean to save the amount of headers specified that are returned by the server after a Header event has been fired
This config should be set when the ParsedHeaders collection will be populated when a Header event has been fired. This value represents the number of headers that are to be saved in the collection .To save all items to the collection , set this config to -1. If no items are wanted, set this to 0, which will not save any to the collection . The default for this config is 0, so no items will be included in the collection .

MaxHeaderLength
Maximum length for headers to avoid line folding (default 80)
The MaxHeaderLength specifies the maximum line length supported by the news delivery system. Any headers longer than MaxHeaderLength are folded as specified in RFC 850.It is generally a good idea to use a MaxHeaderLength of less than 100 bytes, although different news servers have different requirements for header lengths.

IPPort Configuration Settings

FirewallAutoDetect
Tells the bean whether or not to automatically detect and use firewall system settings, if available
This is the same as AutoDetect . This setting is provided for use by beans that do not directly expose Firewall properties.
FirewallHost
Name or IP address of firewall (optional)
If a FirewallHost is given, requested connections will be authenticated through the specified firewall when connecting.If the FirewallHost setting is set to a Domain Name, a DNS request is initiated. Upon successful termination of the request, the FirewallHost setting is set to the corresponding address. If the search is not successful, an error is returned.

NOTE: This is the same as Host . This setting is provided for use by beans that do not directly expose Firewall properties.

FirewallListener
If true, the component binds to a SOCKS firewall as a server (IPPort only)
This entry is for IPPort only and does not work for other components that descend from IPPort.If this entry is set, the bean acts as a server. RemoteHost and RemotePort are used to tell the SOCKS firewall in which address and port to listen to. The firewall rules may ignore RemoteHost , and it is recommended that RemoteHost be set to empty string in this case.

RemotePort is the port in which the firewall will listen to. If set to 0, the firewall will select a random port. The binding (address and port) is provided through the ConnectionStatus event.

The connection to the firewall is made by calling the Connect method.

FirewallPassword
Password to be used if authentication is to be used when connecting through the firewall
If FirewallHost is specified, the FirewallUser and FirewallPassword settings are used to connect and authenticate to the given firewall. If the authentication fails, the bean throws an exception.NOTE: This is the same as Password . This setting is provided for use by beans that do not directly expose Firewall properties.

FirewallPort
The TCP port for the FirewallHost;
Note that the FirewallPort is set automatically when FirewallType is set to a valid value.NOTE: This is the same as Port . This setting is provided for use by beans that do not directly expose Firewall properties.

FirewallType
Determines the type of firewall to connect through
The appropriate values are as follows:
0
No firewall (default setting).
1
Connect through a tunneling proxy. FirewallPort is set to 80.
2
Connect through a SOCKS4 Proxy. FirewallPort is set to 1080.
3
Connect through a SOCKS5 Proxy. FirewallPort is set to 1080.
NOTE: This is the same as FirewallType . This setting is provided for use by beans that do not directly expose Firewall properties.

FirewallUser
A user name if authentication is to be used connecting through a firewall
If the FirewallHost is specified, the FirewallUser and FirewallPassword settings are used to connect and authenticate to the Firewall. If the authentication fails, the bean throws an exception.NOTE: This is the same as User . This setting is provided for use by beans that do not directly expose Firewall properties.

KeepAliveTime
The inactivity time in milliseconds before a TCP keep-alive packet is sent
When set, TCPKeepAlive will automatically be set to true. By default the operating system will determine the time a connection is idle before a TCP keep-alive packet is sent. This system default if this value is not specified here is 2 hours. In many cases a shorter interval is more useful. Set this value to the desired interval in milliseconds.Note: This value is not applicable in Java.

KeepAliveInterval
The retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received
When set, TCPKeepAlive will automatically be set to true. A TCP keep-alive packet will be sent after a period of inactivity as defined by KeepAliveTime . If no acknowledgement is received from the remote host the keep-alive packet will be re-sent. This setting specifies the interval at which the successive keep-alive packets are sent in milliseconds. This system default if this value is not specified here is 1 second.Note: This value is not applicable in Java or MAC.

Linger
When set to True, connections are terminated gracefully
This property controls how a connection is closed. The default is True.In the case that Linger is True (default), there are two scenarios for determining how long the connection will linger. The first, if LingerTime is 0 (default), the system will attempt to send pending data for a connection until the default IP protocol timeout expires.

In the second scenario, LingerTime is a positive value, the system will attempt to send pending data until the specified LingerTime is reached. If this attempt fails, then the system will reset the connection.

The default behavior (which is also the default mode for stream sockets) might result in a long delay in closing the connection. Although the bean returns control immediately, the system could hold system resources until all pending data is sent (even after your application closes).

Setting this property to False forces an immediate disconnection. If you know that the other side has received all the data you sent (by a client acknowledgment, for example), setting this property to False might be the appropriate course of action.

LingerTime
Time in seconds to have the connection linger
LingerTime is the time, in seconds, to leave the socket connection linger. This value is 0 by default, which means it will use the default IP protocol timeout.
LocalHost
The name of the local host through which connections are initiated or accepted
The LocalHost setting contains the name of the local host as obtained by the gethostname() system call, or if the user has assigned an IP address, the value of that address.In multi-homed hosts (machines with more than one IP interface) setting LocalHost to the value of an interface will make the bean initiate connections (or accept in the case of server beans) only through that interface.

If the bean is connected, the LocalHost setting shows the IP address of the interface through which the connection is made in internet dotted format (aaa.bbb.ccc.ddd). In most cases, this is the address of the local host, except for multi-homed hosts (machines with more than one IP interface).

LocalPort
The TCP port in the local host where the bean binds
This must be set before a connection is attempted. It instructs the bean to bind to a specific port (or communication endpoint) in the local machine.Setting this to 0 (default) enables the system to choose a port at random. The chosen port will be shown by LocalPort after the connection is established.

LocalPort cannot be changed once a connection is made. Any attempt to set this when a connection is active will generate an error.

This; setting is useful when trying to connect to services that require a trusted port in the client side. An example is the remote shell (rsh) service in UNIX systems.

MaxLineLength
The maximum amount of data to accumulate when no EOL is found
MaxLineLength is the size of an internal buffer, which holds received data while waiting for an EOL string.If an EOL string is found in the input stream before MaxLineLength bytes are received, the DataIn event is fired with the EOL parameter set to True, and the buffer is reset.

If no EOL is found, and MaxLineLength bytes are accumulated in the buffer, the DataIn event is fired with the EOL parameter set to False, and the buffer is reset.

The minimum value for MaxLineLength is 256 bytes. The default value is 2048 bytes. The maximum value is 65536 bytes.

MaxTransferRate
The transfer rate limit in bytes per second
This setting can be used to throttle outbound TCP traffic. Set this to the number of bytes to be sent per second. By default this is not set and there is no limit.
TCPKeepAlive
Determines whether or not the keep alive socket option is enabled
If set to true, the socket's keep-alive option is enabled and keep-alive packets will be sent periodically to maintain the connection. Set KeepAliveTime and KeepAliveInterval to configure the timing of the keep-alive packets.Note: This value is not applicable in Java.

UseIPv6
Whether or not to use IPv6
By default, the component expects an IPv4 address for local and remote host properties, and will create an IPv4 socket. To use IPv6 instead, set this to True.
CloseStreamAfterTransfer
If true, the component will close the upload or download stream after the transfer
This entry is for bean and all the components that descend from it.This property is true by default. Therefore, by default, all streams will be closed after a transfer is completed. In order to keep streams open after the transfer of data, you must set this config to false.

TcpNoDelay
Whether or not to delay when sending packets
When true, the socket will send all data that is ready to send at once. When false, the socket will send smaller buffered packets of data at small intervals. This is known as the Nagle algorithm.By default, this config is set to false.

SSL Configuration Settings

ReuseSSLSession
Determines if the SSL session is reused
If set to true, the component will reuse the context if and only if the following criteria are met:
  • The target host name is the same.
  • The system cache entry has not expired (default timeout is 10 hours).
  • The application process that calls the function is the same.
  • The logon session is the same.
  • The instance of the component is the same.

SSLCipherStrength
The minimum cipher strength used for bulk encryption
This minimum cipher strength largely dependent on the security modules installed on the system. If the cipher strength specified is not supported, an error will be returned when connections are initiated.Please note that this setting contains the minimum cipher strength requested from the security library. The actual cipher strength used for the connection is shown by the SSLStatus event.

Use this setting with caution. Requesting a lower cipher strength than necessary could potentially cause serious security vulnerabilities in your application.

When the provider is OpenSSL, SSLCipherStrength is currently not supported. This functionality is instead made available through the OpenSSLCipherList config setting.

SSLEnabledProtocols
Used to enable/disable the supported security protocols
Used to enable/disable the supported security protocols.Not all supported protocols are enabled by default (the value of this setting is 240). If you want more granular control over the enabled protocols, you can set this property to the binary 'OR' of one or more of the following values:
TLS1.2
3072 (Hex C00)
TLS1.1
768 (Hex 300)
TLS1
192 (Hex C0) (Default)
SSL3
48 (Hex 30) (Default)
SSL2
12 (Hex 0C)
Please note that although a number of sites still support SSL2, it is usually a good idea to disable it because of potential security vulnerabilities.

When the provider is OpenSSL, SSLCipherStrength is currently not supported. This functionality is instead made available through the OpenSSLCipherList config setting.

TLS 1.1 and TLS1.2 support are only available starting with Windows 7.

NOTE: setting the property to 0 has the same effect as setting it to 4095 (enables all protocols).

SSLProvider
The name of the security provider to use
Change this setting to use security providers other than the system default.Use this setting with caution. Disabling SSL security or pointing to the wrong provider could potentially cause serious security vulnerabilities in your application.

The special value "*" (default) picks the default SSL provider defined in the system. On Windows, this is "Microsoft Unified Security Protocol Provider".

SSLSecurityFlags
Flags that control certificate verification
The following flags are defined (specified in hexadecimal notation). They can be or-ed together to exclude multiple conditions:
0x00000001
Ignore time validity status of certificate.
0x00000002
Ignore time validity status of CTL.
0x00000004
Ignore non-nested certificate times.
0x00000010
Allow unknown Certificate Authority.
0x00000020
Ignore wrong certificate usage.
0x00000100
Ignore unknown certificate revocation status.
0x00000200
Ignore unknown CTL signer revocation status.
0x00000400
Ignore unknown Certificate Authority revocation status.
0x00000800
Ignore unknown Root revocation status.
0x00008000
Allow test Root certificate.
0x00004000
Trust test Root certificate.
0x80000000
Ignore non-matching CN (certificate CN not-matching server name).
This functionality is currently not available in Java or when the provider is OpenSSL.

SSLContextProtocol
The protocol used when getting an SSLContext instance
SSLEnabledCipherSuites
The cipher suite to be used in an SSL negotiation
The enabled cipher suites to be used in SSL negotiation.By default, the enabled cipher suites will include all available ciphers ("*").

The special value "*" means that the component will pick all of the supported cipher suites. If SSLEnabledCipherSuites is set to any other value, only the specified cipher suites will be considered.

Multiple cipher suites are separated by semicolons.

Some sample settings:

 obj.config("SSLEnabledCipherSuites=*");
 obj.config("SSLEnabledCipherSuites=SSL_RSA_WITH_RC4_128_SHA");
 obj.config("SSLEnabledCipherSuites=SSL_RSA_WITH_RC4_128_SHA; SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA"); 
Possible values include:
  • SSL_RSA_WITH_NULL_MD5
  • SSL_RSA_WITH_NULL_SHA
  • SSL_RSA_EXPORT_WITH_RC4_40_MD5
  • SSL_RSA_WITH_RC4_128_MD5
  • SSL_RSA_WITH_RC4_128_SHA
  • SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5
  • SSL_RSA_WITH_IDEA_CBC_SHA
  • SSL_RSA_EXPORT_WITH_DES40_CBC_SHA
  • SSL_RSA_WITH_DES_CBC_SHA
  • SSL_RSA_WITH_3DES_EDE_CBC_SHA
  • SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA
  • SSL_DH_DSS_WITH_DES_CBC_SHA
  • SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA
  • SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA
  • SSL_DH_RSA_WITH_DES_CBC_SHA
  • SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA
  • SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA
  • SSL_DHE_DSS_WITH_DES_CBC_SHA
  • SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA
  • SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA
  • SSL_DHE_RSA_WITH_DES_CBC_SHA
  • SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA
  • SSL_DH_anon_EXPORT_WITH_RC4_40_MD5
  • SSL_DH_anon_WITH_RC4_128_MD5
  • SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA
  • SSL_DH_anon_WITH_DES_CBC_SHA
  • SSL_DH_anon_WITH_3DES_EDE_CBC_SHA

SSLEnabledCipherSuites is used together with SSLCipherStrength .

NOTE: This configuration setting is available only for Java products. Possible values are SSL, SSLv2, SSLv3, TLS and TLSv1. Use it only in case your security provider does not support TLS. This is the parameter "protocol" inside the SSLContext.getInstance(protocol) call.

SSLTrustManagerFactoryAlgorithm
The algorithm to be used to create a TrustManager through TrustManagerFactory
Possible values include SunX509. This is the parameter "algorithm" inside the TrustManagerFactory.getInstance(algorithm) call.

Socket Configuration Settings

AbsoluteTimeout
Determines whether timeouts are inactivity timeouts or absolute timeouts
If AbsoluteTimeout is set to True, any method which does not complete within Timeout seconds will be aborted. By default, AbsoluteTimeout is False, and the timeout is an inactivity timeout.Note: This option is not valid for UDP ports.

FirewallData
Used to send extra data to the firewall
When the firewall is a tunneling proxy, use this property to send custom (additional) headers to the firewall (e.g. headers for custom authentication schemes).
InBufferSize
The size in bytes of the incoming queue of the socket
This is the size of an internal queue in the TCP/IP stack. You can increase or decrease its size depending on the amount of data that you will be receiving. Increasing the value of the InBufferSize setting can provide significant improvements in performance in some cases.Some TCP/IP implementations do not support variable buffer sizes. If that is the case, when the bean is activated the InBufferSize reverts to its defined size. The same happens if you attempt to make it too large or too small.

OutBufferSize
The size in bytes of the outgoing queue of the socket
This is the size of an internal queue in the TCP/IP stack. You can increase or decrease its size depending on the amount of data that you will be sending. Increasing the value of the OutBufferSize setting can provide significant improvements in performance in some cases.Some TCP/IP implementations do not support variable buffer sizes. If that is the case, when the bean is activated the OutBufferSize reverts to its defined size. The same happens if you attempt to make it too large or too small.

Base Configuration Settings

GUIAvailable
Tells the bean whether or not a message loop is available for processing events
In a GUI-based application, long-running blocking operations may cause the application to stop responding to input until the operation returns. The bean will attempt to discover whether or not the application has a message loop and, if one is discovered, it will process events in that message loop during any such blocking operation.In some non-GUI applications an invalid message loop may be discovered that will result in errant behavior. In these cases, setting GuiAvailable to false will ensure that the bean does not attempt to process external events.

Throws:
IPWorksSMIMEException

connect

public void connect()
             throws IPWorksSMIMEException
Connects to the news server.

This method is used to connect to the news server. If the User and/or Password are set, then corresponding AUTHINFO commands are sent to the NewsServer as well.

Throws:
IPWorksSMIMEException

decrypt

public void decrypt()
             throws IPWorksSMIMEException
Decrypts the current Message .

This method takes the Message property and attempts to decrypt the encrypted PKCS envelope using the certificate in Certificate . If the bean is able to decrypt it will replace Message and MessageHeaders with the decrypted text.

Throws:
IPWorksSMIMEException

decryptAndVerifySignature

public void decryptAndVerifySignature()
                               throws IPWorksSMIMEException
Decrypts and verifies the signature of the current Message .

This method attempts to both decrypt and verify the signature of the message data included in Message . All of the properties affected by calling the Decrypt and VerifySignature methods are affected in the same manner.

NOTE: This function does not attempt to check the validity of the signing certificate itself.

Throws:
IPWorksSMIMEException

disconnect

public void disconnect()
                throws IPWorksSMIMEException
Disconnects from the news server.

This method is used to disconnect from the NewsServer . First the bean attempts to send a QUIT command, and if that fails, the connection is broken.

Throws:
IPWorksSMIMEException

doEvents

public void doEvents()
              throws IPWorksSMIMEException
Processes events from the internal message queue.

When DoEvents is called, the bean processes any available events. If no events are available, it waits for a preset period of time, and then returns.

Throws:
IPWorksSMIMEException

encrypt

public void encrypt()
             throws IPWorksSMIMEException
Encrypts the current Message .

This method encrypts the current data in Message in a PKCS encoded envelope with all of the recipient certificates specified in the MessageRecipients collection .

The result of the encrypted data will be replaced in the Message property and the MessageHeaders property will be filled with the required S/MIME headers.

Please note that the message headers, including the Sender, Recipient(s), and Subject, are not encrypted. If this is sensitive information, consider including these headers in the message body as a MIME entity, and providing other headers for the S/MIME wrapper.

Throws:
IPWorksSMIMEException

fetchArticle

public void fetchArticle()
                  throws IPWorksSMIMEException
Get the headers and body of an article specified in CurrentArticle .

This method gets the headers and body of the article specified in CurrentArticle . The headers are delivered via the Header event, and the article body via the Transfer event.

If a connection to the NewsServer doesn't already exist, a new one is created.

Throws:
IPWorksSMIMEException

fetchArticleBody

public void fetchArticleBody()
                      throws IPWorksSMIMEException
Gets only the body of an article specified in CurrentArticle .

This method gets only the body of the article specified in CurrentArticle . The body via the Transfer event.

If a connection to the NewsServer doesn't already exist, a new one is created.

Throws:
IPWorksSMIMEException

fetchArticleHeaders

public void fetchArticleHeaders()
                         throws IPWorksSMIMEException
Gets only the headers of an article specified in CurrentArticle .

This method gets only the headers of the article specified in CurrentArticle . The headers are delivered via the Header event.

If a connection to the NewsServer doesn't already exist, a new one is created.

Throws:
IPWorksSMIMEException

groupOverview

public void groupOverview()
                   throws IPWorksSMIMEException
Receives an overview for the articles in range OverviewRange in the CurrentGroup .

This method receives an overview for the articles in range OverviewRange in the CurrentGroup . The overview data is delivered via the GroupOverview event.

If a connection to the NewsServer doesn't already exist, a new one is created.

Throws:
IPWorksSMIMEException

groupSearch

public void groupSearch()
                 throws IPWorksSMIMEException
Receives an overview for the articles in range SearchRange in the CurrentGroup .

This method searches the current newsgroup for articles in range SearchRange in the CurrentGroup , where SearchHeader matches SearchPattern . The results are delivered via the GroupSearch event.

If a connection to the NewsServer doesn't already exist, a new one is created.

Throws:
IPWorksSMIMEException

interrupt

public void interrupt()
               throws IPWorksSMIMEException
Interrupt the current method.

If there is no method in progress, Interrupt simply returns, doing nothing.

Throws:
IPWorksSMIMEException

listGroups

public void listGroups()
                throws IPWorksSMIMEException
Lists all groups on the server.

This method asks the server to list all its newsgroups. Use this method with caution as listing groups may take quite a long over slow links. The group names and other information are returned via the GroupList event.

If a connection to the NewsServer doesn't already exist, a new one is created.

Throws:
IPWorksSMIMEException

listNewGroups

public void listNewGroups()
                   throws IPWorksSMIMEException
Lists all new groups on the server.

This method asks the server to list all the newsgroups created since CheckDate . The group names (if any) and other information are returned via the GroupList event.

If a connection to the NewsServer doesn't already exist, a new one is created.

Throws:
IPWorksSMIMEException

localizeDate

public java.lang.String localizeDate(java.lang.String dateTime)
                              throws IPWorksSMIMEException
Converts a valid RFC 822 message date to local date and time.

This method can be used to convert an RFC 822 date/time string to the corresponding local date and time.

Dates will be returned in the format: "MM/dd/yyyy hh:mm:ss".

Throws:
IPWorksSMIMEException

postArticle

public void postArticle()
                 throws IPWorksSMIMEException
Posts the current article and attached file.

This method posts the current article and attached file (if any). If a connection to the NewsServer doesn't already exist, a new one is created.

Throws:
IPWorksSMIMEException

resetHeaders

public void resetHeaders()
                  throws IPWorksSMIMEException
Resets all of the article headers.

This method resets all the article headers to "" (empty string). Use this method before posting a new article, so that headers from the previous article are not carried over to the next one.

Throws:
IPWorksSMIMEException

setArticleStream

public void setArticleStream(java.io.OutputStream articleStream)
                      throws IPWorksSMIMEException
Sets the stream to which the article downloaded from the server will be written.

This method sets the stream to which the article downloaded from the server will be written. If a download stream is set before the FetchArticle or FetchArticleBody methods are called, the downloaded data will be written to the stream. The stream should be open and normally set to position 0. The bean will automatically close this stream if CloseStreamAfterTransfer is set to true (default). If the stream is closed, you will need to call SetArticleStream again before calling FetchArticle or FetchArticleBody again. The downloaded content will be written starting at the current position in the stream.

Note: SetArticleStream and LocalFile will reset the other.

Throws:
IPWorksSMIMEException

sign

public void sign()
          throws IPWorksSMIMEException
Signs the current Message .

This method digitally signs the current data included in Message with the the certificate provided. Certificates are provided by specifying the Certificate property. The IncludeCertificate and DetachedSignature properties allow you to specify addition details about what to include when signing the message.

The result of the signed data will be replaced in the Message property and the MessageHeaders property will be filled with the required S/MIME headers.

Throws:
IPWorksSMIMEException

signAndEncrypt

public void signAndEncrypt()
                    throws IPWorksSMIMEException
Signs and encrypts the current Message .

This method both signs and encrypts the message data included in Message into a single PKCS encoded envelope. The value in DetachedSignature is ignored: the bean will always generate an attached signature when calling this method. All other properties used by calling the Sign and Encrypt methods are used in the same manner.

The result of the encrypted data will be replaced in the Message property and the MessageHeaders property will be filled with the required S/MIME headers.

Please note that the message headers, including the Sender, Recipient(s), and Subject, are not encrypted. If this is sensitive information, consider including these headers in the message body as a MIME entity, and providing other headers for the S/MIME wrapper.

Throws:
IPWorksSMIMEException

verifySignature

public void verifySignature()
                     throws IPWorksSMIMEException
Verifies the signature of the current Message .

This method attempts to verify the signature contained in Message . If the message does not have a certificate attached, the bean will attempt to verify the signature using the certificate supplied in SignerCert (if any). If no certificate is found, the bean throws an exception.

If this method is successful, the SignerCert property will contain the certificate information of the message signer.

NOTE: This function does not attempt to check the validity of the signing certificate itself.

Throws:
IPWorksSMIMEException

addSnntpEventListener

public void addSnntpEventListener(SnntpEventListener l)
                           throws java.util.TooManyListenersException
Throws:
java.util.TooManyListenersException

removeSnntpEventListener

public void removeSnntpEventListener(SnntpEventListener l)

IP*Works! S/MIME V9

Copyright (c) 2013 /n software inc. - All rights reserved.