Overview
The article will demonstrate how to use the ipclient component in Secure iNet Factory to create TCP/IP client socket connections.
Code Example
01 import java.io.*;
|
« June 2008 | Main | September 2008 »
Overview
The article will demonstrate how to use the ipclient component in Secure iNet Factory to create TCP/IP client socket connections.
Code Example
01 import java.io.*;
|
Posted at 10:55 PM in Java, Tutorials | Permalink | Comments (0) | TrackBack (0)
Overview
The article will demonstrate how to use the imap component in Secure iNet Factory to communicate with imap servers in java using ssl/tls.
Code Example
01 import java.util.Enumeration; The ImapSsl class provides both
implicit and explicit SSL/TLS connections. Implicit SSL/TLSconnections are made by default using remote port 993. Explicit SSL/TLS connections are made using an unencrypted connection to port 143 of an IMAP server and then switching to an encrypted mode using the STARTTLS command prior to sending any additional data. |
01 import java.util.Enumeration;
|
Posted at 10:25 PM in Java, Tutorials | Permalink | Comments (0) | TrackBack (0)
Overview
The article will demonstrate how to use the sftp component in Secure FTP Factory to upload files and directories. This component can be used to transfer files between a client and SSH (Secure Shell).
Code Example
001 // required import statements
|
Posted at 11:57 AM in Tutorials | Permalink | Comments (0) | TrackBack (0)
Overview
The article will demonstrate how to use the dns component in Secure iNet Factory to query dns servers in Java.
The "Domain Name System" is a distributed database that resides in multiple machines on the Internet and is used to convert between names and addresses and to provide e-mail routing information. Each DNS machine can be queried by other machines and maintains it's own database.
A machine access a "local name server" which is able to resolve frequently used domain names by caching information. When a local name server is unable to resolve a name it forwards the query to a "root name server". If the root name server is unsuccessful in resolving the name it forwards the query to a "authoritative name server". If a given name server is unable to resolve the name it will forward to another name server, this process will continue until the name is resolved.
Code Example
01 import java.util.*;tesla.comm.toronto.edu) Argument 2 : The domain name. (www.utoronto.ca)Dns.TYPE_A)142.150.210.13"
|
Posted at 11:55 AM in Java, Tutorials | Permalink | Comments (0) | TrackBack (0)
Overview
FXP is a method of transferring data from one server to another server without routing this data through the client. FTP involves a single client and a single server, FXP on the other hand involves the client having two connections to two different servers (let's call them server A and server B). The client can transfer between these two servers in either direction (from A to B OR from B to A). The obvious advantage of using FXP is that the data transfer is more efficient specially for clients with slow connections.
One potential disadvantage of using FXP is that the server is vulnerable to "FTP Bounce" attack. More information regarding this can be found here.
Example
01 import com.jscape.inet.ftp.*;
|
Posted at 11:53 AM in Java, Tutorials | Permalink | Comments (0) | TrackBack (0)
Overview
The article will demonstrate how to use the zip component in Secure iNet Factory to zip/unzip files in Java.
Code Example
01 import java.io.*;
|
Posted at 11:52 AM in Java, Tutorials | Permalink | Comments (0) | TrackBack (0)
Overview
The article will demonstrate how to use the sftp component in Secure FTP Factory to list contents of remote / local directories.
Code Example
001 import java.io.BufferedReader;
|
Posted at 11:51 AM in Java, Tutorials | Permalink | Comments (0) | TrackBack (0)
Overview
The article will demonstrate how to use the http component in Secure iNet Factory to communicate with Http servers.
Code Example
001 import com.jscape.inet.http.*;
|
Posted at 11:47 AM in Java, Tutorials | Permalink | Comments (0) | TrackBack (0)
Overview
This article will demonstrate how to use the http component in Secure iNet Factory to upload files in Java.
Code Example
Download HttpFileUploadEx.java
01 import com.jscape.inet.http.Http;fieldName - the name of the field, as specified inHTML INPUT TYPE=FILE tag Argument 2 : fileName - the value to set the MIME filename attribute toArgument 3 : file - the File object of the file to be addedFor a complete list of HTTP response codes go here. |
Posted at 11:45 AM in Java, Tutorials | Permalink | Comments (0) | TrackBack (0)
Overview
This article will demonstrate how to use the https component in Secure iNet Factory to communicate with HTTPS servers.
Retrieving secure web pages using HTTPS
To retrieve a secure web page using HTTPS you may use the com.jscape.inet.https.Https class. The Https class is a subclass of the com.jscape.inet.http.Http class so all methods found in the Http class are available in the Https class. See the Http component documentation for more information on creating HTTP requests.
Setting server and client certificates
When establishing a connection you may define any optional client
certificates that should be used for authentication purposes when
establishing an SSL connection. In addition you may define any
optional server certificates that should be validated against to ensure
that the server you are communicating with this the server you are
expecting. Client and server certificates should be stored in separate
Java keystore files and protected using a keystore password.
Existing certificates may be imported into a Java keystore using the keytool.exe utility provided with the JDK.
Example : keytool.exe -import -file x509.cer -keystore your_store_name
The example above imports the certificate x509.cer into a keystore named your_store_name
Provided you have existing keystores you may set the client and server certificates using setClientCertificates() and setServerCertificates() methods respectively.
Example :
// set client certificates
https.setClientCertificates("c:/certs/client_keystore","secret");
// set server certificates
https.setServerCertificates("c:/certs/server_keystore","secret");
Code Example
01 import java.security.Security;
|
Posted at 11:43 AM in Java, Tutorials | Permalink | Comments (0) | TrackBack (0)