IPWorks S/MIME 2020 Python Edition

Questions / Feedback?

SNNTP Class

Properties   Methods   Events   Configuration Settings   Errors  

The SNNTP Class is used to read, search, and post articles on Usenet news servers.

Syntax

class ipworkssmime.SNNTP

Remarks

The SNNTP Class is the S/MIME enabled equivalent of the IPWorks NNTP class. In addition to standard NNTP functions the SNNTP class 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 class. After setting the certificate properties, and specifying article_text, call the encrypt, sign or sign_and_encrypt method before posting and the result will be stored in article_text. When attempting to verify a signed message or when decrypting a message call the decrypt, verify_signature, or decrypt_and_verify_signature methods and the resulting text will be replaced in article_text.

The SNNTP Class 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 current_group property sets the current newsgroup. From then on, news articles from that group can be read by setting the article number in current_article and then calling the appropriate method. Properties such as article_count, first_article, last_article provide information about the current state.

The headers and text of the articles are received respectively through the on_header and on_transfer events. Additionally, up to max_lines from the article body are provided in the article_text property. The on_group_overview event returns information about a range of articles (overview_range) in current_group, and the on_group_list event is used when listing newsgroup names. The on_pi_trail event provides a trace of the interaction with the server.

The class supports posting of articles through the article_text and attached_file properties. The article text is specified in one or both of the above, and then the post_article method is called. Article headers are given in a series of properties like article_from, article_subject, organization, etc. that map directly to the USENET article header with the same name.

Property List


The following is the full list of the properties of the class with short descriptions. Click on the links for further details.

article_countThe estimated number of articles in CurrentGroup .
article_dateThe date of the current article.
article_fromThe email address of the author (for posting articles).
article_headersThe full headers of the article as retrieved from the server.
article_idThe message identifier of the current article.
group_overview_countThe number of records in the GroupOverview arrays.
group_overview_article_linesThe number of lines of an article in a newsgroup overview.
group_overview_article_numberThe number of an article in a newsgroup overview.
group_overview_article_sizeThe size of an article in a newsgroup overview.
group_overview_dateThe date of an article in a newsgroup overview.
group_overview_fromThe sender of an article in a newsgroup overview.
group_overview_message_idThe unique message id of an article in a newsgroup overview.
group_overview_other_headersThe remaining headers of an article in a newsgroup overview.
group_overview_referencesThe references of an article in a newsgroup overview.
group_overview_subjectThe subject of an article in a newsgroup overview.
article_referencesArticles to which the posted article follows up.
article_reply_toThe address to reply to (for posting articles).
article_subjectThe article subject (for posted articles).
article_textThe full text of the article (without the headers).
attached_fileA file name which the contents of will be appended to the ArticleText when posting articles.
cert_encodedThe certificate (PEM/base64 encoded).
cert_storeThe name of the certificate store for the client certificate.
cert_store_passwordIf the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store.
cert_store_typeThe type of certificate store for this certificate.
cert_subjectThe subject of the certificate used for client authentication.
check_dateThe date (format YYMMDD HHMMSS) to check for creation of new groups. If the group was created after the date specified, it is considered new.
commandUsed to send additional commands directly to the server.
connectedShows whether the class is connected.
current_articleThe number or message identifier of the current article.
current_groupThe name of the current group.
encrypting_algorithmTextual description of the encrypting algorithm.
firewall_auto_detectThis property tells the class whether or not to automatically detect and use firewall system settings, if available.
firewall_typeThis property determines the type of firewall to connect through.
firewall_hostThis property contains the name or IP address of firewall (optional).
firewall_passwordThis property contains a password if authentication is to be used when connecting through the firewall.
firewall_portThis property contains the TCP port for the firewall Host .
firewall_userThis property contains a user name if authentication is to be used connecting through a firewall.
first_articleThe number of the first article in CurrentGroup .
group_list_countThe number of records in the GroupList arrays.
group_list_can_postThis property indicates whether a group in a newsgroup listing allows postings or articles.
group_list_first_articleThis property shows the first available article in a newsgroup listing.
group_list_groupThis property shows the group name in a newsgroup listing.
group_list_last_articleThis property shows the last available article in a newsgroup listing.
idleThe current status of the class.
include_certificateSpecifies whether to include the signer's certificate with the signed message.
include_chainSpecifies whether to include the signer's certificate chain with the signed message.
last_articleThe number of the last article in CurrentGroup .
last_replyThe last reply from the server.
local_hostThe name of the local host or user-assigned IP interface through which connections are initiated or accepted.
max_linesThe maximum number of message lines aside from headers to retrieve.
newsgroupsA comma separated list of newsgroups in which to post the article.
news_portThe server port for secure NNTP (default 119).
news_serverThe name or address of a news server.
organizationThe organization of the author (for posting articles).
other_headersAn RFC850 compliant string consisting of extra headers (for posting articles).
overview_rangeA range for the GroupOverview method (first-last).
parsed_header_countThe number of records in the ParsedHeader arrays.
parsed_header_fieldThis property contains the name of the HTTP header (same case as it is delivered).
parsed_header_valueThis property contains the header contents.
passwordA logon password for the NewsServer .
recipient_cert_countThe number of records in the RecipientCert arrays.
recipient_cert_encodedThe certificate (PEM/base64 encoded).
recipient_cert_storeThe name of the certificate store for the client certificate.
recipient_cert_store_passwordIf the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store.
recipient_cert_store_typeThe type of certificate store for this certificate.
recipient_cert_subjectThe subject of the certificate used for client authentication.
search_headerA header for the GroupSearch method.
search_patternA search pattern for the GroupSearch method.
search_rangeA range for the GroupSearch method (first-last).
signer_cert_encodedThe certificate (PEM/base64 encoded).
signer_cert_issuerThe issuer of the certificate.
signer_cert_serial_numberThe serial number of the certificate encoded as a string.
signer_cert_storeThe name of the certificate store for the client certificate.
signer_cert_store_passwordIf the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store.
signer_cert_store_typeThe type of certificate store for this certificate.
signer_cert_subjectThe subject of the certificate used for client authentication.
signing_algorithmTextual description of the signature hash algorithm.
ssl_accept_server_cert_encodedThe certificate (PEM/base64 encoded).
ssl_cert_encodedThe certificate (PEM/base64 encoded).
ssl_cert_storeThe name of the certificate store for the client certificate.
ssl_cert_store_passwordIf the certificate store is of a type that requires a password, this property is used to specify that password in order to open the certificate store.
ssl_cert_store_typeThe type of certificate store for this certificate.
ssl_cert_subjectThe subject of the certificate used for client authentication.
ssl_enabledWhether TLS/SSL is enabled.
ssl_server_cert_encodedThe certificate (PEM/base64 encoded).
ssl_start_modeDetermines how the class starts the SSL negotiation.
timeoutA timeout for the class.
userA user identifier to login as in the NewsServer .

Method List


The following is the full list of the methods of the class with short descriptions. Click on the links for further details.

add_recipient_certUsed to add recipient certificates used to encrypt messages.
configSets or retrieves a configuration setting.
connectConnects to the news server.
decryptDecrypts the current Message .
decrypt_and_verify_signatureDecrypts and verifies the signature of the current message.
disconnectDisconnects from the news server.
do_eventsProcesses events from the internal message queue.
encryptEncrypts the message.
fetch_articleGet the headers and body of an article specified in CurrentArticle .
fetch_article_bodyGets only the body of an article specified in CurrentArticle .
fetch_article_headersGets only the headers of an article specified in CurrentArticle .
group_overviewReceives an overview for the articles in range OverviewRange in the CurrentGroup .
group_searchReceives an overview for the articles in range SearchRange in the CurrentGroup .
interruptInterrupt the current method.
list_groupsLists all groups on the server.
list_new_groupsLists all new groups on the server.
localize_dateConverts a valid RFC 822 message date to local date and time.
post_articlePosts the current article and attached file.
resetReset the class.
reset_headersResets all of the article headers.
signSigns the current message.
sign_and_encryptSigns and encrypts the current message.
verify_signatureVerifies the signature of the current message.

Event List


The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.

on_connection_statusFired to indicate changes in connection state.
on_end_transferFired when the article text completes transferring.
on_errorInformation about errors during data delivery.
on_group_listFired while group data transfers (during group listings).
on_group_overviewFired for each line of article overview data (during group overviews).
on_group_searchFired for each line of group search data (during group searches).
on_headerFired for every article header being retrieved during article retrieval.
on_pi_trailTraces the commands sent to the news server, and the respective replies.
on_ssl_server_authenticationFired after the server presents its certificate to the client.
on_ssl_statusShows the progress of the secure connection.
on_start_transferFired when the article text starts transferring.
on_transferFired while the article text gets transferred (to or from the NewsServer ).

Configuration Settings


The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.

ArticleInfoLimitInstructs class to save the amount of articles specified that are returned by the server when a GroupOverview event is fired.
GroupInfoLimitInstructs class to save the amount of group info objects specified that are returned by the server after a ListGroups call has been made.
MaxHeaderLengthMaximum length for headers to avoid line folding (default 80).
ConnectionTimeoutSets a separate timeout value for establishing a connection.
FirewallAutoDetectTells the class whether or not to automatically detect and use firewall system settings, if available.
FirewallHostName or IP address of firewall (optional).
FirewallPasswordPassword to be used if authentication is to be used when connecting through the firewall.
FirewallPortThe TCP port for the FirewallHost;.
FirewallTypeDetermines the type of firewall to connect through.
FirewallUserA user name if authentication is to be used connecting through a firewall.
KeepAliveIntervalThe retry interval, in milliseconds, to be used when a TCP keep-alive packet is sent and no response is received.
KeepAliveTimeThe inactivity time in milliseconds before a TCP keep-alive packet is sent.
LingerWhen set to True, connections are terminated gracefully.
LingerTimeTime in seconds to have the connection linger.
LocalHostThe name of the local host through which connections are initiated or accepted.
LocalPortThe port in the local host where the class binds.
MaxLineLengthThe maximum amount of data to accumulate when no EOL is found.
MaxTransferRateThe transfer rate limit in bytes per second.
ProxyExceptionsListA semicolon separated list of hosts and IPs to bypass when using a proxy.
TCPKeepAliveDetermines whether or not the keep alive socket option is enabled.
TcpNoDelayWhether or not to delay when sending packets.
UseIPv6Whether to use IPv6.
LogSSLPacketsControls whether SSL packets are logged when using the internal security API.
OpenSSLCADirThe path to a directory containing CA certificates.
OpenSSLCAFileName of the file containing the list of CA's trusted by your application.
OpenSSLCipherListA string that controls the ciphers to be used by SSL.
OpenSSLPrngSeedDataThe data to seed the pseudo random number generator (PRNG).
ReuseSSLSessionDetermines if the SSL session is reused.
SSLCACertFilePathsThe paths to CA certificate files on Unix/Linux.
SSLCACertsA newline separated list of CA certificate to use during SSL client authentication.
SSLCheckCRLWhether to check the Certificate Revocation List for the server certificate.
SSLCipherStrengthThe minimum cipher strength used for bulk encryption.
SSLEnabledCipherSuitesThe cipher suite to be used in an SSL negotiation.
SSLEnabledProtocolsUsed to enable/disable the supported security protocols.
SSLEnableRenegotiationWhether the renegotiation_info SSL extension is supported.
SSLIncludeCertChainWhether the entire certificate chain is included in the SSLServerAuthentication event.
SSLNegotiatedCipherReturns the negotiated ciphersuite.
SSLNegotiatedCipherStrengthReturns the negotiated ciphersuite strength.
SSLNegotiatedCipherSuiteReturns the negotiated ciphersuite.
SSLNegotiatedKeyExchangeReturns the negotiated key exchange algorithm.
SSLNegotiatedKeyExchangeStrengthReturns the negotiated key exchange algorithm strength.
SSLNegotiatedProtocolReturns the negotiated protocol version.
SSLProviderThe name of the security provider to use.
SSLSecurityFlagsFlags that control certificate verification.
SSLServerCACertsA newline separated list of CA certificate to use during SSL server certificate validation.
TLS12SignatureAlgorithmsDefines the allowed TLS 1.2 signature algorithms when UseInternalSecurityAPI is True.
TLS12SupportedGroupsThe supported groups for ECC.
TLS13KeyShareGroupsThe groups for which to pregenerate key shares.
TLS13SignatureAlgorithmsThe allowed certificate signature algorithms.
TLS13SupportedGroupsThe supported groups for (EC)DHE key exchange.
AbsoluteTimeoutDetermines whether timeouts are inactivity timeouts or absolute timeouts.
FirewallDataUsed to send extra data to the firewall.
InBufferSizeThe size in bytes of the incoming queue of the socket.
OutBufferSizeThe size in bytes of the outgoing queue of the socket.
BuildInfoInformation about the product's build.
CodePageThe system code page used for Unicode to Multibyte translations.
LicenseInfoInformation about the current license.
ProcessIdleEventsWhether the class uses its internal event loop to process events when the main thread is idle.
SelectWaitMillisThe length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.
UseInternalSecurityAPITells the class whether or not to use the system security libraries or an internal implementation.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks S/MIME 2020 Python Edition - Version 20.0 [Build 8154]