JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Trusted Extensions Developer's Guide     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

1.  Trusted Extensions APIs and Security Policy

2.  Labels and Clearances

3.  Label Code Examples

4.  Interprocess Communications

5.  Trusted X Window System

6.  Label Builder GUI

7.  Trusted Web Guard Prototype

8.  Experimental Java Bindings for the Solaris Trusted Extensions Label APIs

Java Bindings Overview

Structure of the Experimental Java Label Interfaces

SolarisLabel Abstract Class

ClearanceLabel Subclass

SensitivityLabel Subclass

Range Class

Java Bindings

Detecting a Trusted Extensions System

Accessing the Process Sensitivity Label

Allocating and Freeing Memory for Label Objects

Obtaining and Setting the Label of a File

Obtaining Label Range Objects

Accessing Labels in Zones

Obtaining the Remote Host Type

Translating Between Labels and Strings

Comparing Label Objects

A.  Programmer's Reference

B.  Trusted Extensions API Reference

Index

Structure of the Experimental Java Label Interfaces

The JNI implementation of the Trusted Extensions label APIs introduces several label-related classes that relate to each other in this way:

SolarisLabel Abstract Class

The SolarisLabel abstract class provides the foundation for common and native methods related to Trusted Extensions labels. The SensitivityLabel and ClearanceLabel subclasses inherit members from this abstract class. Static factories for creating sensitivity labels and clearance labels are also provided by the abstract class.

Static factories and methods throw exceptions when errors are encountered to ensure that no mandatory access control-related errors occur silently.

This abstract class defines the following general-purpose methods that are used to compare labels and to translate labels to strings:

The equals, dominates, and strictlyDominates methods are analogous to the blequal(), bldominates(), and blstrictdom() label APIs currently available with Trusted Extensions. The setFileLabel method is analogous to the setflabel() routine currently available with Trusted Extensions.

The rest of the methods (such as toText, toInternal, and toColor) are related in function to the label_to_str() routine that is currently available with Trusted Extensions. These methods enable you to translate a label to a particular type of string. Depending on the label relationship of the process and the object, you might need privileges in your effective set to translate a label to a human-readable form. For instance, the Java Virtual Machine (JVM) process must be running with the sys_trans_label privilege to translate labels that it does not dominate.

The SolarisLabel abstract class also includes the following static factories:

The string that you pass as a label to getSensitivityLabel or getClearanceLabel can be in one of the following forms:

Only the internal form of the label is suitable for storage and for transmission over a network connection, as the internal form does not reveal the actual label. For more information, see Readable Versions of Labels.

The ClearanceLabel and SensitivityLabel subclasses extend the SolarisLabel abstract class. These subclasses each inherit the common methods provided by the SolarisLabel abstract class.

ClearanceLabel Subclass

The ClearanceLabel subclass extends the SolarisLabel abstract class and defines the getMaximum and getMinimum methods, which return the ClearanceLabel object that represents the least upper bound and the greatest lower bound, respectively.

SensitivityLabel Subclass

The SensitivityLabel subclass extends the SolarisLabel abstract class and defines the getMaximum and getMinimum methods, which return the SensitivityLabel object that represents the least upper bound and the greatest lower bound, respectively.

Range Class

The Range class represents a Java version of a Trusted Extensions label range.

This class defines the following general-purpose methods that are used to obtain the upper and lower labels in a label range and to determine whether a label is within a specified label range:

The Range class also includes the following static factories that create range objects:

The getDeviceRange and getUserRange static factories create range objects based on the range for the specified device and the specified user, respectively. The getLabelRange static factory enables you to create a label range where you specify the upper and lower bounds for the range.