Programmation RMI Sécurisée

Similar documents
! "# $%&'( ) * ).) "%&' 1* ( %&' ! "%&'2 (! ""$ 1! ""3($

Network Communication

When the transport layer tries to establish a connection with the server, it is blocked by the firewall. When this happens, the RMI transport layer

Remote Method Invocation (RMI)

Lecture 7: Java RMI. CS178: Programming Parallel and Distributed Systems. February 14, 2001 Steven P. Reiss

Remote Method Invocation

Remote Method Invocation

TP1 : Correction. Rappels : Stream, Thread et Socket TCP

ExempleRMI.java. // Fichier de defintion des droits et proprietes // System.setProperty("java.security.policy","../server.java.

Java Programming Unit 10. Stock Price Quotes with URL, Sockets, and RMI

Remote Method Invocation in JAVA

WSDL Example (Interface) WSDL Example (Implementation) Universal Description, Discovery and Integration. UDDI Usage

Concevoir et déployer vos applications à base de microservices sur Cloud Foundry

Jini an Infrastructure for Dynamic Service Networks

Licence Informatique Année Exceptions

EJB 3.0 and IIOP.NET. Table of contents. Stefan Jäger / stefanjaeger@bluewin.ch

Module 13 Implementing Java EE Web Services with JAX-WS

Index. Registry Report

Netscape Internet Service Broker for C++ Programmer's Guide. Contents

Java Network. Slides prepared by : Farzana Rahman

Brazil + JDBC Juin 2001, douin@cnam.fr

Web Services ( )

Tuple spaces and Object spaces. Distributed Object Systems 12. Tuple spaces and Object spaces. Communication. Tuple space. Mechanisms 2.

LAB 1. Familiarization of Rational Rose Environment And UML for small Java Application Development

Hello World RESTful web service tutorial

Division of Informatics, University of Edinburgh

Consuming a Web Service(SOAP and RESTful) in Java. Cheat Sheet For Consuming Services in Java

Smalltalk in Enterprise Applications. ESUG Conference 2010 Barcelona

Introduction to Object-Oriented Programming

H2O A Lightweight Approach to Grid Computing

Langages Orientés Objet Java

POB-JAVA Documentation

Capabilities of a Java Test Execution Framework by Erick Griffin

RPC over XML. Web services with Java. How to install it? Reference implementation. Setting the environment variables. Preparing the system

Interfaces de programmation pour les composants de la solution LiveCycle ES (juillet 2008)

WHAT ARE PACKAGES? A package is a collection of related classes. This is similar to the notion that a class is a collection of related methods.

Report of the case study in Sistemi Distribuiti A simple Java RMI application

First Java Programs. V. Paúl Pauca. CSC 111D Fall, Department of Computer Science Wake Forest University. Introduction to Computer Science

Java E-Commerce Martin Cooke,

CGI Vs. Java - Which is Better For Marketing

Web Service Development Using CXF. - Praveen Kumar Jayaram

Programmation Orientée Objets. et langage Java

Effective unit testing with JUnit

Java - gently. Originaux. Prérequis. Objectifs

Java and ActiveX Projects

CS506 Web Design and Development Solved Online Quiz No. 01

Aucune validation n a été faite sur l exemple.

java Features Version April 19, 2013 by Thorsten Kracht

Konzepte objektorientierter Programmierung

Remote Method Invocation

Invocación remota (based on M. L. Liu Distributed Computing -- Concepts and Application

Transparent Redirection of Network Sockets 1

The Java Series Introduction to Java RMI and CORBA. The Java Series. Java RMI and CORBA Raul RAMOS / CERN-IT User Support Slide 1

Supplement IV.C: Tutorial for Oracle. For Introduction to Java Programming By Y. Daniel Liang

How To Create A C++ Web Service

Using EDA Databases: Milkyway & OpenAccess

Lesson: All About Sockets

Lecture 17. Process Management. Process Management. Process Management. Inter-Process Communication. Inter-Process Communication

Transparent Redirection of Network Sockets 1

private byte[] encryptcommand = {(byte)0xa0, (byte)0xc1, (byte)0x00, (byte)0x00, (byte) 0x00};

A Sample OFBiz application implementing remote access via RMI and SOAP Table of contents

Chapter 5 Aspect Oriented Programming

Third AP Edition. Object-Oriented Programming and Data Structures. Maria Litvin. Gary Litvin. Phillips Academy, Andover, Massachusetts

Cours. Client/serveur avancé en Java (servlets, RMI, etc.) M.M.F.A.I. François Bourdoncle

Overview of Web Services API

CORBA, DCOP and DBUS. A performance comparison.

CSE 452: Programming Languages. Acknowledgements. Contents. Java and its Evolution

ADF Code Corner. 92. Caching ADF Web Service results for in-memory filtering. Abstract: twitter.com/adfcodecorner

How To Run A Test File Extension On A Rexx (Unix) On A Microsoft Linux (Amd64) (Orchestra) (For Windows) (

A Java-based system support for distributed applications on the Internet

Message Oriented Middlewares

Hacking (and securing) JBoss AS

Brekeke PBX Web Service

JAVA Program For Processing SMS Messages

CS5233 Components Models and Engineering

Web-Service Example. Service Oriented Architecture

1001ICT Introduction To Programming Lecture Notes

Creating Web Services in NetBeans

Contents. Java - An Introduction. Java Milestones. Java and its Evolution

Applets, RMI, JDBC Exam Review

Learning Outcomes. Networking. Sockets. TCP/IP Networks. Hostnames and DNS TCP/IP

BEAWebLogic Server. Programming WebLogic RMI

Preet raj Core Java and Databases CS4PR. Time Allotted: 3 Hours. Final Exam: Total Possible Points 75

WebOTX Application Server

Audit de sécurité avec Backtrack 5

Android Security Lab WS 2014/15 Lab 1: Android Application Programming

Moving beyond hardware

Crash Course in Java

Integrate 'Oracle Forms', 'Oracle Reports', 'Oracle

Creating a Simple, Multithreaded Chat System with Java

Web Services in.net (1)

Java Remote Method Invocation Specification

Building and Using Web Services With JDeveloper 11g

Transcription:

Programmation RMI Sécurisée 5 janvier 2012 D après http ://blogs.oracle.com/lmalventosa/entry/using_the_ssl_tls_based. A Code RMI de Base A.1 Les fichiers Hello.java public i n t e r f a c e Hello extends Remote { public S t r i n g sayhello ( ) throws RemoteException ; super ( ) ; Registry = LocateRegistry. g e t R e g i s t r y ( null, 3000) ;. bind ( " HelloServer ", obj ) ; System. out. p r i n t l n ( " " ) ; HelloClient.java public c l a s s HelloClient { Registry = LocateRegistry. g e t R e g i s t r y ( null, 3000) ; / / Lookup t h e r e m o t e r e f e r e n c e bound t o t h e name " H e l l o S e r v e r " Hello obj = ( Hello ). lookup ( " HelloServer " ) ; S t r i n g message = obj. sayhello ( ) ; System. out. p r i n t l n ( message ) ;

RmiRegistry.java public c l a s s RmiRegistry { public s t a t i c void main ( S t r i n g [ ] args ) throws Exception { / / S t a r t RMI on p o r t 3000 LocateRegistry. c r e a t e R e g i s t r y ( 3 0 0 0 ) ; System. out. p r i n t l n ( "RMI running on port 3000 " ) ; / / S l e e p f o r e v e r Thread. sleep ( Long.MAX\_VALUE) ; A.2 Les commandes $ java RmiRegistry & RMI running on port 3000 $ java HelloImpl & $ java HelloClient B Utilisation de SSLRMI*SocketFactory B.3 Nouveau code pour HelloImpl super(0, new SslRMIClientSocketFactory(), new SslRMIServerSocketFactory()) ; Registry = LocateRegistry. g e t R e g i s t r y ( null, 3000) ;. bind ( " HelloServer ", obj ) ; System. out. p r i n t l n ( " " ) ; B.4 Commandes $ j a v a -Djavax.net.ssl.trustStore=truststore -Djavax.net.ssl.trustStorePassword=trustword RmiRegistry &

RMI running on port 3000 $ j a v a -Djavax.net.ssl.keyStore=keystore -Djavax.net.ssl.keyStorePassword=password HelloImpl & $ j a v a -Djavax.net.ssl.trustStore=truststore -Djavax.net.ssl.trustStorePassword=trustword HelloClient C Avec Authentification du Client C.5 Nouveau code super ( 0, new SslRMIClientSocketFactory ( ), new SslRMIServerSocketFactory(null, null, true) ) ; Registry = LocateRegistry. g e t R e g i s t r y ( null, 3000) ;. bind ( " HelloServer ", obj ) ; System. out. p r i n t l n ( " " ) ; C.6 commandes $ j a v a -Djavax.net.ssl.keyStore=keystore -Djavax.net.ssl.keyStorePassword=password Djavax. net. s s l. t r u s t S t o r e = t r u s t s t o r e Djavax. net. s s l. truststorepassword=trustword RmiRegistry & RMI running on port 3000 keystorepassword=password -Djavax.net.ssl.trustStore=truststore -Djavax.net.ssl.trustStorePassword=trustword HelloImpl &

$ j a v a -Djavax.net.ssl.keyStore=keystore -Djavax.net.ssl.keyStorePassword=password Djavax. net. s s l. t r u s t S t o r e = t r u s t s t o r e Djavax. net. s s l. truststorepassword=trustword HelloClient D Avec une Suite Cryptographique Précise D.7 Nouveau code super ( 0, new SslRMIClientSocketFactory ( ), new SslRMIServerSocketFactory(new String[] "SSL_RSA_WITH_RC4_128_MD5", new String[] "TLSv1",true) ) ; Registry = LocateRegistry. g e t R e g i s t r y ( null, 3000) ;. bind ( " HelloServer ", obj ) ; System. out. p r i n t l n ( " " ) ; D.8 Commandes Associées Djavax. net. s s l. truststorepassword=trustword -Djavax.rmi.ssl.client.enabledCipherSuites=SSL_RSA_WITH_RC4_128_MD5 -Djavax.rmi.ssl.client.enabledProtocols=TLSv1 RMI running on port 3000 RmiRegistry & Djavax. net. s s l. truststorepassword=trustword HelloImpl &

Djavax. net. s s l. truststorepassword=trustword -Djavax.rmi.ssl.client.enabledCipherSuites=SSL_RSA_WITH_RC4_128_MD5 -Djavax.rmi.ssl.client.enabledProtocols=TLSv1 HelloClient E Protection du Registry E.9 Nouveau code super ( 0, new SslRMIClientSocketFactory ( ), new SslRMIServerSocketFactory ( null, null, true ) ) ; Registry registry = LocateRegistry.getRegistry(null, 3000, new SslRMIClientSocketFactory()) ;. bind ( " HelloServer ", obj ) ; System. out. p r i n t l n ( " " ) ; HelloClient.java public c l a s s HelloClient { Registry registry = LocateRegistry.getRegistry(null, 3000, new SslRMIClientSocketFactory()) ; / / Lookup t h e r e m o t e r e f e r e n c e bound t o t h e name " H e l l o S e r v e r " Hello obj = ( Hello ). lookup ( " HelloServer " ) ; S t r i n g message = obj. sayhello ( ) ; System. out. p r i n t l n ( message ) ;

RmiRegistry.java public c l a s s RmiRegistry { public s t a t i c void main ( S t r i n g [ ] args ) throws Exception { / / S t a r t RMI on p o r t 3000 LocateRegistry.createRegistry(3000, new SslRMIClientSocketFactory(),new SslRMIServerSocketFactory(null, null, true)) ; System. out. p r i n t l n ( "RMI running on port 3000 " ) ; / / S l e e p f o r e v e r Thread. sleep ( Long.MAX_VALUE) ; E.10 Commandes Associées Djavax. net. s s l. truststorepassword=trustword RmiRegistry & RMI running on port 3000 Djavax. net. s s l. truststorepassword=trustword HelloImpl & Djavax. net. s s l. truststorepassword=trustword HelloClient