SlideShare a Scribd company logo
1 of 20
COLLAGE NAME:-
SHREE P.M.PATEL INSTITUTE OF POST GRADUATE STUDIES
AND RESEARCH IN APPLIED SCIENCE, ANAND
MANAGED BY:
ANAND PEOPLE MEDICARE SOCIETY, ANAND
SEMINAR ON
NETWORKING AND SECURITY IN JAVA
Prepared By,
Kavankumar Nileshkumar. Solanki
SY MSc.IT Sem.III
Roll No. 03
Date:-19/07/2020
NETWORKING
AND
SECURITY
IN
JAVA
OBJECTIVES
 Sockets in Java
 Creating and using Socket
 java.security Package
 Permission and Security Policy
 Policy Class
SOCKETS IN JAVA
 An IP Port on a specific host machine is called Socket.
 The emergence of sockets first appeared in early Unix systems in the 1970s and have now become the
‘standard’ low-level communication primitive.
 There two types of Sockets
 Connection-Oriented Sockets-
 Almost based on TCP.
 Connection Sockets-
 Usually based on UDP(User Datagram Protocol)
CREATING AND USING SOCKETS
 Communication over the Internet involves sockets for creating connection.
 Sockets connect to numbered communication ports.
 The bottom 1,024 ports are reserved for system use.
 Port 21-FTP
 Port 23-Telnet
 Port 25-Email
 Port 80-HTTP
 Port 119-Usenet
 Java supports sockets with the Socket class.
CONSTRUCTORS OF THE CLIENT SOCKETS
Constructors Does this
Socket() It creates an unconnected socket, with the system-default type of
SocketIm.
Socket(InetAddress address, int port) It creates a stream socket and connections it to specified port
number at the specified IP address.
Socket (InetAddress address, int port, Boolean stream) It is deprecated and it uses DatagramSocket instead for UDP
transport.
Socket (InetAddress address, int port, InetAddress localAddr,
int localPort)
It creates a socket and connects it to the specified remote address
on the specified remote port.
Socket (Proxy proxy) It creates an unconnected socket, specifying the type of proxy that
should be used regardless of any other setting.
protectedSocket(SocketImpl impl) It creates an unconnected Socket with a user-specified SocketImpl.
Socket(String host, int port) It creates a stream socket and connects it to the specified port
number on the named host.
Socket(String host, int port, Boolean stream) It is deprecated and it uses DatagramSocket instead for UDP
transport.
Socket (String host, int port, InetAddress localAddr,
int localPort)
It creates a socket and connects it to the specified remote address
on the specified remote port.
EXAMPLE OF CLIENT SOCKET
import java.io.*;
import java.net.*;
public class SocketDemo{
public static void main(String[] args){
try{
Socket s=new Socket(“www.sun.com”,80); //www.sun.com is InetAddress, 80 is Port Num. for HTTP;
BufferedReader in=new BufferedReader( new InputStreamReader(s.getInputStream())); //To Read From Socket;
PrintWriter out=new PrintWriter(s.getOutputStream()); //To Write to a Socket;
System.out.print(“GET/index.htmlnn”);
out.flush(); //Flush out the PrintWriter Object;
String line;
while((line==in.readLine())!=null){
System.out.println(line);}
}
catch(Exception ex){ }
}
}
OUTPUT
C:>java SocketDemo
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional// EN” http://www.w3.org/TR/REC-
html40/loose.dtd>
………………
JAVA.SECURITY PACKAGE
 This package provides classes and interfaces for security framework.
 The classes of this package implement access control security architecture.
 This implemented security architecture is easily configurable.
 Using this package, we can avail all support for the generation and storage of cryptographic public key.
 It also supports number of cryptographic operations which includes operations for message digest and
generation of signature.
 This package also contains classes for signed/ guarded objects and random number generation.
INTERFACES OF THE JAVA.SECURITY PACKAGE
Interface Description
DomainCombiner It provides a means to dynamically update the ProtectionDomain
associated with the current AccessControlContext.
Guard This interface represents a guard, which is used to protect access to
another object.
Key It is a top level interface for all key.
KeyStore.Entry It is a marker interface for KeyStore entry types.
KeyStore.LoadStoreParametere It is a marker interface for KeyStore load and store parameter.
KeyStore.ProtectionParametere It is a marker interface for KeyStore protection parameter.
Policy. Parameters It is marker interface for Policy parameters.
Principal This interface represent the abstract notion of a principal, which can
be used to represent any entity.
PrivateKey Int is private Key.
PrivilegedAction<T> It is computation to be performed with privileges enabled.
Interface description
PrivilegeExceptionAction<T> It is computation to be performed with privileges enabled, that
throws one or more checked exceptions.
PublicKey It is public key.
PERMISSION AND SECURITY POLICY
 The two most important classes of java.security package are the
 java.security.Permission
 java.security.Policy
PERMISSION CLASS
 This is an abstract class in java.security package which represents access to a system resource.
 A permission has a name and abstract function defining the semantics of a particular Permission
subclass.
 A Permission object may include a list of permitted actions.
 All subclasses of Permission class must implement the implies() method to compare Permissions.
CONSTRUCTORS OF THE JAVA,SECURITY.PERMISSION CLASS
Constructor Does this
Permission(String name) It creates a permission with a name specified.
METHODS OF THE JAVA.SECURITY.PERMISSION CLASS
Methods Does this
void checkGuard(Object object) It implements the guard interface for permission.
abstract Boolean equals(Object object) It checks two Permission objects for equality.
abstract String getActions() It gives actions as a String.
String getName() It gives name of this Permission.
abstract int hashCode() It gives hash code value for this Permission object.
abstract Boolean implies(Permission permission) It checks if the specified permission’s actions are
“implied by” this object’s actions.
PermissionCollection new PermissionCollection() It yields an empty PermissionCollection for a given
Permission object, or null if one is not defined.
String toString() It yields a string describing this Permission.
POLICY CLASS
 An object of Policy class is used to determine whether the code running in Java Runtime Environment
has permission to perform security-sensitive operations.
 In the runtime, there is only one Policy object is installed at a time.
 A Policy object is installed by using setPolicy() method and can be obtained by using getPolicy().
 If no Policy object is installed, getPolicy() installs a default Policy implementation.
 To provide a custom implementation, we can subclass Policy class.
 After an instance of Policy object is installed, Java runtime call implice() method to find whether the
running code can perform operations protected by Security Manager.
 The invocation of refresh() method causes the Policy object to refresh/reload its data.
NASTED CLASS OF JAVA.SECURITY.POLICY CLASS
Class Description
static interface Policy.Parameter Its represents a marker interface for Policy
parameters.
FIELD SUMMARY OF JAVA.SECURITY.POLICY CLASS
Field Description
static PermissionCollection
UNSUPPORTED_EMPTY_COLLECTION
It is a read-only empty PermissionCollection
instance.
TITLE LOREM IPSUM DOLOR
Networking and Security in Java

More Related Content

What's hot

Chapter 4 - Defining Your Own Classes - Part I
Chapter 4 - Defining Your Own Classes - Part IChapter 4 - Defining Your Own Classes - Part I
Chapter 4 - Defining Your Own Classes - Part IEduardo Bergavera
 
Reading and writting v2
Reading and writting v2Reading and writting v2
Reading and writting v2ASU Online
 
Concurrency in Java
Concurrency in  JavaConcurrency in  Java
Concurrency in JavaAllan Huang
 
Chapter 7 - Defining Your Own Classes - Part II
Chapter 7 - Defining Your Own Classes - Part IIChapter 7 - Defining Your Own Classes - Part II
Chapter 7 - Defining Your Own Classes - Part IIEduardo Bergavera
 
Java programming basics
Java programming basicsJava programming basics
Java programming basicsHamid Ghorbani
 
Iterator Design Pattern
Iterator Design PatternIterator Design Pattern
Iterator Design PatternVarun Arora
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in javaMonika Mishra
 
Iterator - a powerful but underappreciated design pattern
Iterator - a powerful but underappreciated design patternIterator - a powerful but underappreciated design pattern
Iterator - a powerful but underappreciated design patternNitin Bhide
 
Java Multithreading and Concurrency
Java Multithreading and ConcurrencyJava Multithreading and Concurrency
Java Multithreading and ConcurrencyRajesh Ananda Kumar
 
Network vs. Code Metrics to Predict Defects: A Replication Study
Network vs. Code Metrics  to Predict Defects: A Replication StudyNetwork vs. Code Metrics  to Predict Defects: A Replication Study
Network vs. Code Metrics to Predict Defects: A Replication StudyKim Herzig
 
iPhone Seminar Part 2
iPhone Seminar Part 2iPhone Seminar Part 2
iPhone Seminar Part 2NAILBITER
 

What's hot (20)

Chapter 4 - Defining Your Own Classes - Part I
Chapter 4 - Defining Your Own Classes - Part IChapter 4 - Defining Your Own Classes - Part I
Chapter 4 - Defining Your Own Classes - Part I
 
Reading and writting v2
Reading and writting v2Reading and writting v2
Reading and writting v2
 
Hacking XPATH 2.0
Hacking XPATH 2.0Hacking XPATH 2.0
Hacking XPATH 2.0
 
Xpath injection in XML databases
Xpath injection in XML databasesXpath injection in XML databases
Xpath injection in XML databases
 
Concurrency in Java
Concurrency in  JavaConcurrency in  Java
Concurrency in Java
 
Chapter 7 - Defining Your Own Classes - Part II
Chapter 7 - Defining Your Own Classes - Part IIChapter 7 - Defining Your Own Classes - Part II
Chapter 7 - Defining Your Own Classes - Part II
 
Introduction+To+Java+Concurrency
Introduction+To+Java+ConcurrencyIntroduction+To+Java+Concurrency
Introduction+To+Java+Concurrency
 
Java programming basics
Java programming basicsJava programming basics
Java programming basics
 
Iterator Design Pattern
Iterator Design PatternIterator Design Pattern
Iterator Design Pattern
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
CORE JAVA-2
CORE JAVA-2CORE JAVA-2
CORE JAVA-2
 
Iterator
IteratorIterator
Iterator
 
Iterator - a powerful but underappreciated design pattern
Iterator - a powerful but underappreciated design patternIterator - a powerful but underappreciated design pattern
Iterator - a powerful but underappreciated design pattern
 
Java Multithreading and Concurrency
Java Multithreading and ConcurrencyJava Multithreading and Concurrency
Java Multithreading and Concurrency
 
Mca 504 dotnet_unit3
Mca 504 dotnet_unit3Mca 504 dotnet_unit3
Mca 504 dotnet_unit3
 
Java Concurrency by Example
Java Concurrency by ExampleJava Concurrency by Example
Java Concurrency by Example
 
Network vs. Code Metrics to Predict Defects: A Replication Study
Network vs. Code Metrics  to Predict Defects: A Replication StudyNetwork vs. Code Metrics  to Predict Defects: A Replication Study
Network vs. Code Metrics to Predict Defects: A Replication Study
 
CORE JAVA
CORE JAVACORE JAVA
CORE JAVA
 
iPhone Seminar Part 2
iPhone Seminar Part 2iPhone Seminar Part 2
iPhone Seminar Part 2
 
XPath Injection
XPath InjectionXPath Injection
XPath Injection
 

Similar to Networking and Security in Java

Security In .Net Framework
Security In .Net FrameworkSecurity In .Net Framework
Security In .Net FrameworkRamakanta Behera
 
Java- Concurrent programming - Synchronization (part 1)
Java- Concurrent programming - Synchronization (part 1)Java- Concurrent programming - Synchronization (part 1)
Java- Concurrent programming - Synchronization (part 1)Riccardo Cardin
 
Java EE Connector Architecture 1.6 (JSR 322) Technology
Java EE Connector Architecture 1.6 (JSR 322) TechnologyJava EE Connector Architecture 1.6 (JSR 322) Technology
Java EE Connector Architecture 1.6 (JSR 322) TechnologySivakumar Thyagarajan
 
Java Performance Tuning
Java Performance TuningJava Performance Tuning
Java Performance TuningMinh Hoang
 
A Cocktail of Guice and Seam, the missing ingredients for Java EE 6
A Cocktail of Guice and Seam, the missing ingredients for Java EE 6A Cocktail of Guice and Seam, the missing ingredients for Java EE 6
A Cocktail of Guice and Seam, the missing ingredients for Java EE 6Saltmarch Media
 
Openstack: security beyond firewalls
Openstack: security beyond firewallsOpenstack: security beyond firewalls
Openstack: security beyond firewallsGARL
 
OpenStack: Security Beyond Firewalls
OpenStack: Security Beyond FirewallsOpenStack: Security Beyond Firewalls
OpenStack: Security Beyond FirewallsGiuseppe Paterno'
 
Unit8 java
Unit8 javaUnit8 java
Unit8 javamrecedu
 
Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Akshay Nagpurkar
 
Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Akshay Nagpurkar
 
JDD 2016 - Michał Balinski, Oleksandr Goldobin - Practical Non Blocking Micro...
JDD 2016 - Michał Balinski, Oleksandr Goldobin - Practical Non Blocking Micro...JDD 2016 - Michał Balinski, Oleksandr Goldobin - Practical Non Blocking Micro...
JDD 2016 - Michał Balinski, Oleksandr Goldobin - Practical Non Blocking Micro...PROIDEA
 

Similar to Networking and Security in Java (20)

Java seminar.pptx
Java seminar.pptxJava seminar.pptx
Java seminar.pptx
 
Lecture10
Lecture10Lecture10
Lecture10
 
Advance Java
Advance JavaAdvance Java
Advance Java
 
Java adv
Java advJava adv
Java adv
 
Security In .Net Framework
Security In .Net FrameworkSecurity In .Net Framework
Security In .Net Framework
 
Java- Concurrent programming - Synchronization (part 1)
Java- Concurrent programming - Synchronization (part 1)Java- Concurrent programming - Synchronization (part 1)
Java- Concurrent programming - Synchronization (part 1)
 
Java EE Connector Architecture 1.6 (JSR 322) Technology
Java EE Connector Architecture 1.6 (JSR 322) TechnologyJava EE Connector Architecture 1.6 (JSR 322) Technology
Java EE Connector Architecture 1.6 (JSR 322) Technology
 
Java Performance Tuning
Java Performance TuningJava Performance Tuning
Java Performance Tuning
 
A Cocktail of Guice and Seam, the missing ingredients for Java EE 6
A Cocktail of Guice and Seam, the missing ingredients for Java EE 6A Cocktail of Guice and Seam, the missing ingredients for Java EE 6
A Cocktail of Guice and Seam, the missing ingredients for Java EE 6
 
Openstack: security beyond firewalls
Openstack: security beyond firewallsOpenstack: security beyond firewalls
Openstack: security beyond firewalls
 
OpenStack: Security Beyond Firewalls
OpenStack: Security Beyond FirewallsOpenStack: Security Beyond Firewalls
OpenStack: Security Beyond Firewalls
 
Unit8 java
Unit8 javaUnit8 java
Unit8 java
 
Java Tutorial 1
Java Tutorial 1Java Tutorial 1
Java Tutorial 1
 
Java Networking
Java NetworkingJava Networking
Java Networking
 
Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Ppl for students unit 4 and 5
Ppl for students unit 4 and 5
 
Ppl for students unit 4 and 5
Ppl for students unit 4 and 5Ppl for students unit 4 and 5
Ppl for students unit 4 and 5
 
Struts2 - 101
Struts2 - 101Struts2 - 101
Struts2 - 101
 
A.java
A.javaA.java
A.java
 
JDD 2016 - Michał Balinski, Oleksandr Goldobin - Practical Non Blocking Micro...
JDD 2016 - Michał Balinski, Oleksandr Goldobin - Practical Non Blocking Micro...JDD 2016 - Michał Balinski, Oleksandr Goldobin - Practical Non Blocking Micro...
JDD 2016 - Michał Balinski, Oleksandr Goldobin - Practical Non Blocking Micro...
 
Java
JavaJava
Java
 

More from Conestoga Collage

More from Conestoga Collage (13)

Ps02 eint21 electronic data interchange
Ps02 eint21 electronic data interchangePs02 eint21 electronic data interchange
Ps02 eint21 electronic data interchange
 
Ps02 cint21 enterprise information system
Ps02 cint21 enterprise information systemPs02 cint21 enterprise information system
Ps02 cint21 enterprise information system
 
Ps02 cint23 ado
Ps02 cint23 adoPs02 cint23 ado
Ps02 cint23 ado
 
Ps02 cint24 mvc in php
Ps02 cint24 mvc in phpPs02 cint24 mvc in php
Ps02 cint24 mvc in php
 
PS02CINT22 SE Software Maintenance
PS02CINT22 SE Software MaintenancePS02CINT22 SE Software Maintenance
PS02CINT22 SE Software Maintenance
 
Operating systems &amp; its future
Operating systems &amp; its futureOperating systems &amp; its future
Operating systems &amp; its future
 
Bluetooth
BluetoothBluetooth
Bluetooth
 
Blue Brain project
Blue Brain projectBlue Brain project
Blue Brain project
 
AI programming languages
AI programming languagesAI programming languages
AI programming languages
 
Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligence
 
Web Based Claim Processing System
Web Based Claim Processing SystemWeb Based Claim Processing System
Web Based Claim Processing System
 
Blue Brain Project
Blue Brain ProjectBlue Brain Project
Blue Brain Project
 
Menu stripe
Menu stripeMenu stripe
Menu stripe
 

Recently uploaded

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 

Recently uploaded (20)

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 

Networking and Security in Java

  • 1. COLLAGE NAME:- SHREE P.M.PATEL INSTITUTE OF POST GRADUATE STUDIES AND RESEARCH IN APPLIED SCIENCE, ANAND MANAGED BY: ANAND PEOPLE MEDICARE SOCIETY, ANAND SEMINAR ON NETWORKING AND SECURITY IN JAVA Prepared By, Kavankumar Nileshkumar. Solanki SY MSc.IT Sem.III Roll No. 03 Date:-19/07/2020
  • 3. OBJECTIVES  Sockets in Java  Creating and using Socket  java.security Package  Permission and Security Policy  Policy Class
  • 4. SOCKETS IN JAVA  An IP Port on a specific host machine is called Socket.  The emergence of sockets first appeared in early Unix systems in the 1970s and have now become the ‘standard’ low-level communication primitive.  There two types of Sockets  Connection-Oriented Sockets-  Almost based on TCP.  Connection Sockets-  Usually based on UDP(User Datagram Protocol)
  • 5. CREATING AND USING SOCKETS  Communication over the Internet involves sockets for creating connection.  Sockets connect to numbered communication ports.  The bottom 1,024 ports are reserved for system use.  Port 21-FTP  Port 23-Telnet  Port 25-Email  Port 80-HTTP  Port 119-Usenet  Java supports sockets with the Socket class.
  • 6. CONSTRUCTORS OF THE CLIENT SOCKETS Constructors Does this Socket() It creates an unconnected socket, with the system-default type of SocketIm. Socket(InetAddress address, int port) It creates a stream socket and connections it to specified port number at the specified IP address. Socket (InetAddress address, int port, Boolean stream) It is deprecated and it uses DatagramSocket instead for UDP transport. Socket (InetAddress address, int port, InetAddress localAddr, int localPort) It creates a socket and connects it to the specified remote address on the specified remote port. Socket (Proxy proxy) It creates an unconnected socket, specifying the type of proxy that should be used regardless of any other setting. protectedSocket(SocketImpl impl) It creates an unconnected Socket with a user-specified SocketImpl. Socket(String host, int port) It creates a stream socket and connects it to the specified port number on the named host. Socket(String host, int port, Boolean stream) It is deprecated and it uses DatagramSocket instead for UDP transport. Socket (String host, int port, InetAddress localAddr, int localPort) It creates a socket and connects it to the specified remote address on the specified remote port.
  • 7. EXAMPLE OF CLIENT SOCKET import java.io.*; import java.net.*; public class SocketDemo{ public static void main(String[] args){ try{ Socket s=new Socket(“www.sun.com”,80); //www.sun.com is InetAddress, 80 is Port Num. for HTTP; BufferedReader in=new BufferedReader( new InputStreamReader(s.getInputStream())); //To Read From Socket; PrintWriter out=new PrintWriter(s.getOutputStream()); //To Write to a Socket; System.out.print(“GET/index.htmlnn”); out.flush(); //Flush out the PrintWriter Object; String line; while((line==in.readLine())!=null){ System.out.println(line);} } catch(Exception ex){ } } }
  • 8. OUTPUT C:>java SocketDemo <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional// EN” http://www.w3.org/TR/REC- html40/loose.dtd> ………………
  • 9. JAVA.SECURITY PACKAGE  This package provides classes and interfaces for security framework.  The classes of this package implement access control security architecture.  This implemented security architecture is easily configurable.  Using this package, we can avail all support for the generation and storage of cryptographic public key.  It also supports number of cryptographic operations which includes operations for message digest and generation of signature.  This package also contains classes for signed/ guarded objects and random number generation.
  • 10. INTERFACES OF THE JAVA.SECURITY PACKAGE Interface Description DomainCombiner It provides a means to dynamically update the ProtectionDomain associated with the current AccessControlContext. Guard This interface represents a guard, which is used to protect access to another object. Key It is a top level interface for all key. KeyStore.Entry It is a marker interface for KeyStore entry types. KeyStore.LoadStoreParametere It is a marker interface for KeyStore load and store parameter. KeyStore.ProtectionParametere It is a marker interface for KeyStore protection parameter. Policy. Parameters It is marker interface for Policy parameters. Principal This interface represent the abstract notion of a principal, which can be used to represent any entity. PrivateKey Int is private Key. PrivilegedAction<T> It is computation to be performed with privileges enabled.
  • 11. Interface description PrivilegeExceptionAction<T> It is computation to be performed with privileges enabled, that throws one or more checked exceptions. PublicKey It is public key.
  • 12. PERMISSION AND SECURITY POLICY  The two most important classes of java.security package are the  java.security.Permission  java.security.Policy
  • 13. PERMISSION CLASS  This is an abstract class in java.security package which represents access to a system resource.  A permission has a name and abstract function defining the semantics of a particular Permission subclass.  A Permission object may include a list of permitted actions.  All subclasses of Permission class must implement the implies() method to compare Permissions.
  • 14. CONSTRUCTORS OF THE JAVA,SECURITY.PERMISSION CLASS Constructor Does this Permission(String name) It creates a permission with a name specified.
  • 15. METHODS OF THE JAVA.SECURITY.PERMISSION CLASS Methods Does this void checkGuard(Object object) It implements the guard interface for permission. abstract Boolean equals(Object object) It checks two Permission objects for equality. abstract String getActions() It gives actions as a String. String getName() It gives name of this Permission. abstract int hashCode() It gives hash code value for this Permission object. abstract Boolean implies(Permission permission) It checks if the specified permission’s actions are “implied by” this object’s actions. PermissionCollection new PermissionCollection() It yields an empty PermissionCollection for a given Permission object, or null if one is not defined. String toString() It yields a string describing this Permission.
  • 16. POLICY CLASS  An object of Policy class is used to determine whether the code running in Java Runtime Environment has permission to perform security-sensitive operations.  In the runtime, there is only one Policy object is installed at a time.  A Policy object is installed by using setPolicy() method and can be obtained by using getPolicy().  If no Policy object is installed, getPolicy() installs a default Policy implementation.  To provide a custom implementation, we can subclass Policy class.  After an instance of Policy object is installed, Java runtime call implice() method to find whether the running code can perform operations protected by Security Manager.  The invocation of refresh() method causes the Policy object to refresh/reload its data.
  • 17. NASTED CLASS OF JAVA.SECURITY.POLICY CLASS Class Description static interface Policy.Parameter Its represents a marker interface for Policy parameters.
  • 18. FIELD SUMMARY OF JAVA.SECURITY.POLICY CLASS Field Description static PermissionCollection UNSUPPORTED_EMPTY_COLLECTION It is a read-only empty PermissionCollection instance.