SlideShare a Scribd company logo
ADVANCE JAVA
ADVANCE JAVA
Classified e-Material 2
Code and Document Security
Code
Document
ADVANCE JAVA
Author Profile
 Ankit Desai
 Ph.D. Scholar, IET, Ahmedabad University
 Education: M. Tech. (C.E.), B. E. (I. T.)
 Experience: 8 years (Academic and Research)
 Research Interest: IoT, Big Data Analytics, Machine
Learning, Data Mining, Algorithms.
Classified e-Material 3
ADVANCE JAVA
Classified e-Material 4
DIGITAL SIGNATURE
 Sign document using
private key keytool
 Generate digital
signature jarsigner
 Send document with
your public key
 Receiver use the public
key to verify that your
document
ADVANCE JAVA
Classified e-Material 5
CERTIFICATE
 A public key.
 The "distinguished-name" information for entity
 A digital signature.
 The distinguished-name information for the signer
(issuer).
ADVANCE JAVA
Classified e-Material 6
SIGNING CODE AND GRANTING ITS PERMISSION
Count.java
javac
Count.class
jar
jarsigner
Count.jar
Keytool - genkey
susanstore
Priveate key
Public key certificate
Keytool -export
Susanjones.cer
sCount.jar
1
2
3
4
5
ADVANCE JAVA
Classified e-Material 7
GENERATE KEYS
 Use keytool
keytool -genkey -alias signFiles -keypass kpi135
-keystore susanstore -storepass ab987c
ADVANCE JAVA
Classified e-Material 8
SIGN THE JAR FILES
 jarsigner -keystore susanstore -signedjar
sCount.jar Count.jar signFiles
ADVANCE JAVA
Classified e-Material 9
EXPORT THE PUBLIC KEY CERTIFICATE
 keytool -export -keystore susanstore -alias
signFiles -file SusanJones.cer
ADVANCE JAVA
Classified e-Material 10
STEPS FOR THE CODE RECIVER
sCount.jar from Susan
java
1
Security manager
Data file
Exception:
Count program doesn’t have
Permission to read the data file
Susan.cer from Susan
2
Keytool -import
raystore
Alias susan
Susan’s public key certificate
Java
Policy tool
Policy file ray policy
Granting code signed
By “susan” permission to
Read the data file
sCount.jar from susan
Security manager
Data file
3
4
ADVANCE JAVA
Classified e-Material 11
OBSERV THE RESTRICTED APPLICATION
java -cp sCount.jar Count C:TestDatadata
Exception in thread "main"
java.security.AccessControlException:
access denied (java.io.FilePermission C:TestDatadata
read)
at java.security.AccessControlContext.checkPermission(Compiled Code)
at java.security.AccessController.checkPermission(Compiled Code)
at java.lang.SecurityManager.checkPermission(Compiled Code) at
java.lang.SecurityManager.checkRead(Compiled Code)
at java.io.FileInputStream.(Compiled Code)
at Count.main(Compiled Code)
ADVANCE JAVA
Classified e-Material 12
IMPORT THE CERTIFICATE AS A TRUSTED CERTIFICATE
keytool -import -alias susan -file SusanJones.cer -
keystore raystore
ADVANCE JAVA
Classified e-Material 13
SET UP A POLICY FILE TO GRANT THE REQUIRED PERMISSION
 Start Policy Tool
 Specify the Keystore
 Add a Policy Entry with a SignedBy Alias
 Save the Policy File

More Related Content

PPTX
java drag and drop and data transfer
PPTX
Introduction to jQuery
PPT
Introduction to Hibernate
PPTX
Introduction to JPA Framework
PDF
Hibernate An Introduction
PDF
Data access
PPTX
Introduction to Hibernate Framework
PPTX
JPA For Beginner's
java drag and drop and data transfer
Introduction to jQuery
Introduction to Hibernate
Introduction to JPA Framework
Hibernate An Introduction
Data access
Introduction to Hibernate Framework
JPA For Beginner's

What's hot (19)

PDF
Hibernate Presentation
PPT
Java Persistence API (JPA) Step By Step
PPTX
Entity Framework Database and Code First
PPTX
JPA lifecycle events practice
PPT
Java persistence api
PPTX
Getting started with entity framework
PPTX
Entity Framework: Nakov @ BFU Hackhaton 2015
PPS
Java Hibernate Programming with Architecture Diagram and Example
ODP
Hibernate complete Training
PPTX
Hibernate ppt
PPTX
Ef code first
ODP
Hibernate Developer Reference
PPT
Entity Persistence with JPA
PDF
Introduction to java
PPTX
SQL Injection in JAVA
PPT
Hibernate presentation
PPTX
Entity Framework: Code First and Magic Unicorns
PDF
Java persistence api 2.1
DOC
Hibernate tutorial for beginners
Hibernate Presentation
Java Persistence API (JPA) Step By Step
Entity Framework Database and Code First
JPA lifecycle events practice
Java persistence api
Getting started with entity framework
Entity Framework: Nakov @ BFU Hackhaton 2015
Java Hibernate Programming with Architecture Diagram and Example
Hibernate complete Training
Hibernate ppt
Ef code first
Hibernate Developer Reference
Entity Persistence with JPA
Introduction to java
SQL Injection in JAVA
Hibernate presentation
Entity Framework: Code First and Magic Unicorns
Java persistence api 2.1
Hibernate tutorial for beginners
Ad

Viewers also liked (10)

PPT
Java Networking
PPTX
Java Beans
PPTX
Presentation11 sq lite
PPTX
Presentation4 date picker
PPTX
Presentation15 parse xml
PPTX
Presentation8 silder switch_progress
PPTX
Presentation14 audio play
PPTX
Hadoop installation
PPTX
java Jdbc
PPT
java swing programming
Java Networking
Java Beans
Presentation11 sq lite
Presentation4 date picker
Presentation15 parse xml
Presentation8 silder switch_progress
Presentation14 audio play
Hadoop installation
java Jdbc
java swing programming
Ad

Similar to java code and document security (20)

PDF
Security in iOS
PPTX
Java & The Android Stack: A Security Analysis
PPT
Java Cert Pki
PDF
INTERFACE by apidays 2023 - Security Exposure Management in API First World, ...
PDF
Abhilash Owk - Resume
PPTX
Networking and Security in Java
PDF
Magento Security from Developer's and Tester's Points of View
PPT
Implementing application security using the .net framework
PPT
PDF
Mobile Application Pentest [Fast-Track]
PPT
Sandboxing (Distributed computing)
PPTX
Android app security
PPTX
Reverse engineering android apps
PDF
SE2016 Android Denis Zhuchinski "Ways of enhancing application security"
PDF
Denis Zhuchinski Ways of enhancing application security
PDF
Advanced Java
PDF
Spring Framework - Spring Security
PPTX
It's a Dangerous World
PPS
Security In .Net Framework
PDF
How to Make a Unicorn: Finding Cybersecurity Talent in the Real World (Boston)
Security in iOS
Java & The Android Stack: A Security Analysis
Java Cert Pki
INTERFACE by apidays 2023 - Security Exposure Management in API First World, ...
Abhilash Owk - Resume
Networking and Security in Java
Magento Security from Developer's and Tester's Points of View
Implementing application security using the .net framework
Mobile Application Pentest [Fast-Track]
Sandboxing (Distributed computing)
Android app security
Reverse engineering android apps
SE2016 Android Denis Zhuchinski "Ways of enhancing application security"
Denis Zhuchinski Ways of enhancing application security
Advanced Java
Spring Framework - Spring Security
It's a Dangerous World
Security In .Net Framework
How to Make a Unicorn: Finding Cybersecurity Talent in the Real World (Boston)

More from Ankit Desai (8)

PPTX
Java RMI
PPTX
Presentation10 view navigation
PPTX
Presentation7 segment control
PPTX
Presentation6 ui image_view
PPTX
Presentation5 picker view
PPTX
Presentation3 actionsheet alertview
PPTX
Presentation1 password
PPTX
Presentation2 gesture control
Java RMI
Presentation10 view navigation
Presentation7 segment control
Presentation6 ui image_view
Presentation5 picker view
Presentation3 actionsheet alertview
Presentation1 password
Presentation2 gesture control

Recently uploaded (20)

PDF
Modernizing your data center with Dell and AMD
PDF
cuic standard and advanced reporting.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Empathic Computing: Creating Shared Understanding
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Encapsulation theory and applications.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
KodekX | Application Modernization Development
PPTX
A Presentation on Artificial Intelligence
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPT
Teaching material agriculture food technology
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Network Security Unit 5.pdf for BCA BBA.
Modernizing your data center with Dell and AMD
cuic standard and advanced reporting.pdf
Unlocking AI with Model Context Protocol (MCP)
Empathic Computing: Creating Shared Understanding
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Encapsulation theory and applications.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
KodekX | Application Modernization Development
A Presentation on Artificial Intelligence
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Big Data Technologies - Introduction.pptx
Spectral efficient network and resource selection model in 5G networks
20250228 LYD VKU AI Blended-Learning.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Dropbox Q2 2025 Financial Results & Investor Presentation
Teaching material agriculture food technology
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Network Security Unit 5.pdf for BCA BBA.

java code and document security

  • 2. ADVANCE JAVA Classified e-Material 2 Code and Document Security Code Document
  • 3. ADVANCE JAVA Author Profile  Ankit Desai  Ph.D. Scholar, IET, Ahmedabad University  Education: M. Tech. (C.E.), B. E. (I. T.)  Experience: 8 years (Academic and Research)  Research Interest: IoT, Big Data Analytics, Machine Learning, Data Mining, Algorithms. Classified e-Material 3
  • 4. ADVANCE JAVA Classified e-Material 4 DIGITAL SIGNATURE  Sign document using private key keytool  Generate digital signature jarsigner  Send document with your public key  Receiver use the public key to verify that your document
  • 5. ADVANCE JAVA Classified e-Material 5 CERTIFICATE  A public key.  The "distinguished-name" information for entity  A digital signature.  The distinguished-name information for the signer (issuer).
  • 6. ADVANCE JAVA Classified e-Material 6 SIGNING CODE AND GRANTING ITS PERMISSION Count.java javac Count.class jar jarsigner Count.jar Keytool - genkey susanstore Priveate key Public key certificate Keytool -export Susanjones.cer sCount.jar 1 2 3 4 5
  • 7. ADVANCE JAVA Classified e-Material 7 GENERATE KEYS  Use keytool keytool -genkey -alias signFiles -keypass kpi135 -keystore susanstore -storepass ab987c
  • 8. ADVANCE JAVA Classified e-Material 8 SIGN THE JAR FILES  jarsigner -keystore susanstore -signedjar sCount.jar Count.jar signFiles
  • 9. ADVANCE JAVA Classified e-Material 9 EXPORT THE PUBLIC KEY CERTIFICATE  keytool -export -keystore susanstore -alias signFiles -file SusanJones.cer
  • 10. ADVANCE JAVA Classified e-Material 10 STEPS FOR THE CODE RECIVER sCount.jar from Susan java 1 Security manager Data file Exception: Count program doesn’t have Permission to read the data file Susan.cer from Susan 2 Keytool -import raystore Alias susan Susan’s public key certificate Java Policy tool Policy file ray policy Granting code signed By “susan” permission to Read the data file sCount.jar from susan Security manager Data file 3 4
  • 11. ADVANCE JAVA Classified e-Material 11 OBSERV THE RESTRICTED APPLICATION java -cp sCount.jar Count C:TestDatadata Exception in thread "main" java.security.AccessControlException: access denied (java.io.FilePermission C:TestDatadata read) at java.security.AccessControlContext.checkPermission(Compiled Code) at java.security.AccessController.checkPermission(Compiled Code) at java.lang.SecurityManager.checkPermission(Compiled Code) at java.lang.SecurityManager.checkRead(Compiled Code) at java.io.FileInputStream.(Compiled Code) at Count.main(Compiled Code)
  • 12. ADVANCE JAVA Classified e-Material 12 IMPORT THE CERTIFICATE AS A TRUSTED CERTIFICATE keytool -import -alias susan -file SusanJones.cer - keystore raystore
  • 13. ADVANCE JAVA Classified e-Material 13 SET UP A POLICY FILE TO GRANT THE REQUIRED PERMISSION  Start Policy Tool  Specify the Keystore  Add a Policy Entry with a SignedBy Alias  Save the Policy File