Security Developer s Guide - Oracle

Java Platform, Standard Edition

Security Developer's Guide

Release 10

E91076-01 March 2018

Java Platform, Standard Edition Security Developer's Guide, Release 10

E91076-01

Copyright ? 1993, 2018, Oracle and/or its affiliates. All rights reserved.

This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.

The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.

If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable:

U.S. GOVERNMENT END USERS: Oracle programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, delivered to U.S. Government end users are "commercial computer software" pursuant to the applicable Federal Acquisition Regulation and agencyspecific supplemental regulations. As such, use, duplication, disclosure, modification, and adaptation of the programs, including any operating system, integrated software, any programs installed on the hardware, and/or documentation, shall be subject to license terms and license restrictions applicable to the programs. No other rights are granted to the U.S. Government.

This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.

Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

Intel and Intel Xeon are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Opteron, the AMD logo, and the AMD Opteron logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.

This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle.

Contents

Preface

Audience Documentation Accessibility Related Documents Conventions

1 General Security

Java Security Overview Introduction to Java Security Java Language Security and Bytecode Verification Basic Security Architecture Security Providers File Locations Java Cryptography Public Key Infrastructure Key and Certificate Storage Public Key Infrastructure Tools Authentication Secure Communication SSL, TLS, and DTLS Protocols Simple Authentication and Security Layer (SASL) Generic Security Service API and Kerberos Access Control Permissions Security Policy Access Control Enforcement XML Signature Additional Information about Java Security Java Security Classes Summary Deprecated Security APIs Marked for Removal Security Tools Summary Built-In Providers

xx xx xx xx

1-1 1-1 1-2 1-3 1-3 1-5 1-6 1-7 1-7 1-8 1-9 1-10 1-11 1-11 1-12 1-12 1-12 1-13 1-14 1-15 1-16 1-16 1-18 1-19 1-20

iii

Java SE Platform Security Architecture Introduction The Original Sandbox Model Evolving the Sandbox Model Protection Mechanisms ? Overview of Basic Concepts Permissions and Security Policy The Permission Classes java.security.CodeSource java.security.Policy java.security.GeneralSecurityException Access Control Mechanisms and Algorithms java.security.ProtectionDomain java.security.AccessController Inheritance of Access Control Context java.security.AccessControlContext Secure Class Loading Class Loader Class Hierarchies The Primordial Class Loader Class Loader Delegation Class Resolution Algorithm Security Management Managing Applets and Applications SecurityManager versus AccessController Auxiliary Tools GuardedObject and SignedObject java.security.GuardedObject and java.security.Guard java.security.SignedObject Discussion and Future Directions Resource Consumption Management Arbitrary Grouping of Permissions Object-Level Protection Subdividing Protection Domains Running Applets with Signed Content Appendix A: API for Privileged Blocks Using the doPrivileged API What It Means to Have Privileged Code Reflection Appendix B: Acknowledgments Appendix C: References

Standard Algorithm Names Permissions in the JDK

1-20 1-20 1-20 1-22 1-23 1-25 1-25 1-34 1-34 1-45 1-46 1-46 1-46 1-50 1-51 1-53 1-53 1-53 1-54 1-54 1-55 1-55 1-56 1-57 1-58 1-58 1-59 1-60 1-60 1-60 1-61 1-61 1-61 1-62 1-62 1-67 1-68 1-69 1-69 1-70 1-70

iv

Permission Descriptions and Risks Methods and the Permissions They Require java.lang.SecurityManager Method Permission Checks

Default Policy Implementation and Policy File Syntax Default Policy Implementation Default Policy File Locations Modifying the Policy Implementation Policy File Syntax Policy File Examples Property Expansion in Policy Files Windows Systems, File Paths, and Property Expansion General Expansion in Policy Files

Appendix A: FilePermission Path Name Canonicalization Disabled By Default Troubleshooting Security

2 Java Cryptography Architecture (JCA) Reference Guide

Introduction to Java Cryptography Architecture JCA Design Principles Provider Architecture Cryptographic Service Providers How Providers Are Actually Implemented Keystores Engine Classes and Algorithms

Core Classes and Interfaces The Provider Class How Provider Implementations Are Requested and Supplied Installing Providers Provider Class Methods The Security Class Managing Providers Security Properties The SecureRandom Class Creating a SecureRandom Object Seeding or Re-Seeding the SecureRandom Object Using a SecureRandom Object Generating Seed Bytes The MessageDigest Class Creating a MessageDigest Object Updating a Message Digest Object Computing the Digest

1-71 1-72 1-91 1-94 1-95 1-95 1-97 1-97 1-102 1-104 1-105 1-106 1-108 1-109

2-1 2-2 2-3 2-3 2-5 2-7 2-7 2-8 2-9 2-10 2-12 2-12 2-13 2-14 2-15 2-15 2-16 2-16 2-17 2-17 2-17 2-17 2-18 2-18

v

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download