Java Security: Writing and Deploying Secure Applications

One of Java's most striking claims is that it provides a secure programming environment. Yet despite endless discussion, few people understand precisely what Java's claims mean and how it backs up those claims. If you're a developer, network administrator or anyone else who must understand or work with Java's security mechanisms, Java Security is the in-depth exploration you need.Java Security, 2nd Edition, focuses on the basic platform features of Java that provide security--the class loader, the bytecode verifier, and the security manager--and recent additions to Java that enhance this security model: digital signatures, security providers, and the access controller. The book covers the security model of Java 2, Version 1.3, which is significantly different from that of Java 1.1. It has extensive coverage of the two new important security APIs: JAAS (Java Authentication and Authorization Service) and JSSE (Java Secure Sockets Extension). Java Security, 2nd Edition, will give you a clear understanding of the architecture of Java's security model and how to use that model in both programming and administration.The book is intended primarily for programmers who want to write secure Java applications. However, it is also an excellent resource for system and network administrators who are interested in Java security, particularly those who are interested in assessing the risk of using Java and need to understand how the security model works in order to assess whether or not Java meets their security needs.

1140203722
Java Security: Writing and Deploying Secure Applications

One of Java's most striking claims is that it provides a secure programming environment. Yet despite endless discussion, few people understand precisely what Java's claims mean and how it backs up those claims. If you're a developer, network administrator or anyone else who must understand or work with Java's security mechanisms, Java Security is the in-depth exploration you need.Java Security, 2nd Edition, focuses on the basic platform features of Java that provide security--the class loader, the bytecode verifier, and the security manager--and recent additions to Java that enhance this security model: digital signatures, security providers, and the access controller. The book covers the security model of Java 2, Version 1.3, which is significantly different from that of Java 1.1. It has extensive coverage of the two new important security APIs: JAAS (Java Authentication and Authorization Service) and JSSE (Java Secure Sockets Extension). Java Security, 2nd Edition, will give you a clear understanding of the architecture of Java's security model and how to use that model in both programming and administration.The book is intended primarily for programmers who want to write secure Java applications. However, it is also an excellent resource for system and network administrators who are interested in Java security, particularly those who are interested in assessing the risk of using Java and need to understand how the security model works in order to assess whether or not Java meets their security needs.

43.99 In Stock
Java Security: Writing and Deploying Secure Applications

Java Security: Writing and Deploying Secure Applications

by Scott Oaks
Java Security: Writing and Deploying Secure Applications

Java Security: Writing and Deploying Secure Applications

by Scott Oaks

eBook

$43.99 

Available on Compatible NOOK devices, the free NOOK App and in My Digital Library.
WANT A NOOK?  Explore Now

Related collections and offers


Overview

One of Java's most striking claims is that it provides a secure programming environment. Yet despite endless discussion, few people understand precisely what Java's claims mean and how it backs up those claims. If you're a developer, network administrator or anyone else who must understand or work with Java's security mechanisms, Java Security is the in-depth exploration you need.Java Security, 2nd Edition, focuses on the basic platform features of Java that provide security--the class loader, the bytecode verifier, and the security manager--and recent additions to Java that enhance this security model: digital signatures, security providers, and the access controller. The book covers the security model of Java 2, Version 1.3, which is significantly different from that of Java 1.1. It has extensive coverage of the two new important security APIs: JAAS (Java Authentication and Authorization Service) and JSSE (Java Secure Sockets Extension). Java Security, 2nd Edition, will give you a clear understanding of the architecture of Java's security model and how to use that model in both programming and administration.The book is intended primarily for programmers who want to write secure Java applications. However, it is also an excellent resource for system and network administrators who are interested in Java security, particularly those who are interested in assessing the risk of using Java and need to understand how the security model works in order to assess whether or not Java meets their security needs.


Product Details

ISBN-13: 9781449372118
Publisher: O'Reilly Media, Incorporated
Publication date: 05/17/2001
Series: Java Series
Sold by: Barnes & Noble
Format: eBook
Pages: 620
File size: 2 MB

About the Author

Scott Oaks is a Java Technologist at Sun Microsystems, where he has worked since 1987. While at Sun, he has specialized in many disparate technologies, from the SunOS kernel to network programming and RPCs. Since 1995, hes focused primarily on Java and bringing Java technology to end-users. Scott also authored OReillys Java Security, Java Threads and Jini in a Nutshell titles.

Read an Excerpt

Chapter 1: Java Application Security

In this chapter:
  • What Is Security?
  • Software Used in this Book
  • The Java Sandbox
  • Security Debugging
When Java was first released by Sun Microsystems, it attracted the attention of programmers throughout the world. These developers were attracted to Java for different reasons: some were drawn to Java because of its cross-platform capabilities, some because of its ease of programming (especially compared to object-oriented languages like C++), some because of its robustness and memory management, some because of Java's security, and some for still other reasons.

Just as different developers came to Java with different expectations, so too did they bring different expectations as to what was meant by the ubiquitous phrase "Java is secure." Security means different things to different people, and many developers who had certain expectations about the word "security" were surprised to find that their expectations were not necessarily shared by the designers of Java.

This book discusses the features of Java that make it secure. In this book, we'll discuss why Java is said to be secure, what that security means (and doesn't mean), and--most importantly--how to use the security features of the Java platform within your own programs. This last point is actually the focus of this book: while some of Java's security features are automatically a part of all Java programs, many of them are not. In this book, we'll learn about all those features and how to utilize them in our own Java applications.

What Is Security?

The first thing that we must do to facilitate our discussion of Java security is to discuss just what Java's security goals are. The term "security" is vague unless it is discussed in some context; different expectations of the term "security" might lead us to expect that Java programs would be:

Safe from malevolent programs

Programs should not be allowed to harm a user's computing environment. This includes Trojan horses as well as harmful programs that can replicate themselves--computer viruses.

Non-intrusive

Programs should be prevented from discovering private information on the host computer or the host computer's network.

Authenticated

The identity of parties involved in the program--both the author and the user of the program--should be verified.

Encrypted

Data that the program sends and receives--over the network or through a persistent store such as a filesystem or database--should be encrypted.

Audited

Potentially sensitive operations should always be logged.

Well-defined

A well-defined security specification should be followed.

Verified

Rules of operation should be set and verified.

Well-behaved

Programs should be prevented from consuming too many system resources: too much CPU time, too much memory, and so on.

C2 or B1 certified

Programs should have certification from the U.S. government that certain security procedures are followed.

In fact, while all of these features could be part of a secure system, only the first two were within the province of Java's 1.0 default security model. Other items in the list have been introduced in later versions of Java: authentication was added in 1.1, encryption is available as an extension to the Java 2 platform, and auditing can be added to any Java program by providing an auditing security manager. Still others of these items will be added in the future. But the basic premise remains that Java security was originally and fundamentally designed to protect the information on a computer from being accessed or modified (including a modification that would introduce a virus) while still allowing the Java program to run on that computer.

The point driving this notion of security is the new distribution model for Java programs. One of the driving forces behind Java, of course, is its ability to download programs over a network and run those programs on another machine. This is something most computer users do today within the context of a Java-enabled browser, although the idea behind portable code like this is beginning to seep into other applications, such as those based on Jini technology. Coupled with the widespread growth of Internet use--and the public-access nature of the Internet--Java's ability to bring programs to a user on an as-needed, just-in-time basis has been a strong reason for its rapid deployment and acceptance.

The nature of the Internet created a new and largely unprecedented requirement for programs to be free of viruses and Trojan horses. Computer users had always been used to purchasing shrink-wrapped software. Many soon began downloading software via ftp or other means and then running that software on their machines. But widespread downloading also led to a pervasive problem of malevolent attributes both in free and (ironically) in commercial software, a problem which continues unabated. The introduction of Java into this equation had the potential to multiply this problem by orders of magnitude, as computer users now download programs automatically and frequently.

For Java to succeed, it needed to circumvent the virus/trojan horse problems that plagued other models of software distribution. Hence, the early work on Java focused on just that issue: Java programs are considered safe because they cannot install, run, or propagate viruses and because the program itself cannot perform any action that is harmful to the user's computing environment. And in this context, safety means security. This is not to say that the other issues in the above list are not important--each has its place and its importance (in fact, we'll spend a great deal of time in this book on the third and fourth topics in that list). But the issues of protecting information and preventing viruses were considered most important; hence, features to provide that level of security were the first to be adopted. Like all parts of Java, its security model is evolving (and has evolved through its various releases); many of the notions about security in our list will eventually make their way into Java.

One of the primary goals of this book, then, is to explain Java's security model and its evolution with each subsequent release. In the final analysis, whether or not Java is secure is a subjective judgment that individual users will have to make based on their own requirements. If all you want from Java is freedom from viruses, any release of Java should meet your needs. If you need to introduce authentication or encryption into your program, you'll need to use a 1.1 or later release of Java. If you have a requirement that all operations be audited, you'll need to build that auditing into your applications. If you really need conformance with a U.S. government-approved definition of security, Java is not the platform for you. We take a very pragmatic view of security in this book: the issue is not whether a system that lacks a particular feature qualifies as "secure" according to someone's definition of security. The issue is whether Java possesses the features that meet your needs....

Table of Contents

Prefacexi
1.Java Application Security1
What Is Security?1
Software Used in This Book4
The Java Sandbox10
Security Debugging15
Summary17
2.The Default Sandbox18
Elements of the Java Sandbox18
Permissions20
Keystores32
Code Sources32
Policy Files33
The Default Sandbox38
The java.security File41
Comparison with Previous Releases41
Summary42
3.Java Language Security43
Java Language Security Constructs44
Enforcement of the Java Language Rules50
Comparisons with Previous Releases56
Summary57
4.The Security Manager58
Overview of the Security Manager59
Operating on the Security Manager64
Methods of the Security Manager65
Comparison with Previous Releases80
Summary82
5.The Access Controller84
The CodeSource Class85
Permissions86
The Policy Class98
Protection Domains101
The AccessController Class102
Guarded Objects109
Comparison with Previous Releases110
Summary111
6.Java Class Loaders112
The Class Loader and Namespaces112
Class Loading Architecture115
Implementing a Class Loader117
Miscellaneous Class Loading Topics127
Comparison with Previous Releases129
Summary130
7.Introduction to Cryptography131
The Need for Authentication132
The Role of Authentication137
Cryptographic Engines138
Summary144
8.Security Providers146
The Architecture of Security Providers146
The Provider Class152
The Security Class158
The Architecture of Engine Classes163
Comparison with Previous Releases164
Summary164
9.Keys and Certificates166
Keys167
Generating Keys172
Key Factories181
Certificates189
Keys, Certificates, and Object Serialization202
Comparison with Previous Releases203
Summary204
10.Key Management205
Key Management Terms206
The keytool209
The Key Management API221
A Key Management Example228
Secret Key Management234
Comparison with Previous Releases241
Summary243
11.Message Digests244
Using the Message Digest Class244
Secure Message Digests248
Message Digest Streams251
Implementing a MessageDigest Class255
Comparison with Previous Releases260
Summary260
12.Digital Signatures261
The Signature Class261
Signed Classes272
Implementing a Signature Class281
Comparison with Previous Releases286
Summary287
13.Cipher-Based Encryption288
The Cipher Engine288
Cipher Streams305
Sealed Objects309
Comparison with Previous Releases310
Summary310
14.SSL and HTTPS311
An Overview of SSL and JSSE311
SSL Client and Server Sockets321
SSL Sessions324
SSL Contexts and Key Managers327
Miscellaneous SSL Issues337
The HTTPS Protocol Handler341
Debugging JSSE344
Summary345
15.Authentication and Authorization346
JAAS Overview347
Simple JAAS programming349
Simple JAAS Administration352
Advanced JAAS Topics362
Summary378
A.The Java.security File379
B.Security Resources382
C.Identity-Based Key Management392
D.The Secure Java Container420
E.Implementing a JCE Security Provider450
F.Quick Reference458
Index567
From the B&N Reads Blog

Customer Reviews