Class Overview
A permission for Smart Card operations. A CardPermission consists of the
name of the card terminal the permission applies to and a set of actions
that are valid for that terminal.
A CardPermission with a name of *
applies to all
card terminals. The actions string is a comma separated list of the actions
listed below, or *
to signify "all actions."
Individual actions are:
- connect
- connect to a card using
CardTerminal.connect()
- reset
- reset the card using
Card.disconnect(true)
- exclusive
- establish exclusive access to a card using
beginExclusive()
and endExclusive()
- transmitControl
- transmit a control command using
Card.transmitControlCommand()
- getBasicChannel
- obtain the basic logical channel using
getBasicChannel()
- openLogicalChannel
- open a new logical channel using
openLogicalChannel()
Summary
Public Constructors |
|
CardPermission(String terminalName, String actions)
Constructs a new CardPermission with the specified actions.
|
Public Methods |
boolean
|
equals(Object obj)
Compares the specified object with this CardPermission for equality.
|
String
|
getActions()
Returns the canonical string representation of the actions.
|
int
|
hashCode()
Returns the hash code value for this CardPermission object.
|
boolean
|
implies(Permission permission)
Checks if this CardPermission object implies the specified permission.
|
[Expand]
Inherited Methods |
From class
java.security.Permission
void
|
checkGuard(Object object)
Implements the guard interface for a permission.
|
abstract
boolean
|
equals(Object obj)
Checks two Permission objects for equality.
|
abstract
String
|
getActions()
Returns the actions as a String.
|
final
String
|
getName()
Returns the name of this Permission.
|
abstract
int
|
hashCode()
Returns the hash code value for this Permission object.
|
abstract
boolean
|
implies(Permission permission)
Checks if the specified permission's actions are "implied by"
this object's actions.
|
PermissionCollection
|
newPermissionCollection()
Returns an empty PermissionCollection for a given Permission object, or null if
one is not defined.
|
String
|
toString()
Returns a string describing this Permission.
|
|
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
From interface
java.security.Guard
abstract
void
|
checkGuard(Object object)
Determines whether or not to allow access to the guarded object
object .
|
|
Public Constructors
public
CardPermission
(String terminalName, String actions)
Constructs a new CardPermission with the specified actions.
terminalName
is the name of a CardTerminal or *
if this permission applies to all terminals. actions
contains a comma-separated list of the individual actions
or *
to signify all actions. For more information,
see the documentation at the top of this class
.
Parameters
terminalName
| the name of the card terminal, or * |
actions
| the action string (or null if the set of permitted
actions is empty) |
Public Methods
public
boolean
equals
(Object obj)
Compares the specified object with this CardPermission for equality.
This CardPermission is equal to another Object object
, if
and only if
object
is an instance of CardPermission,
this.getName()
is equal to
((CardPermission)object).getName()
, and
this.getActions()
is equal to
((CardPermission)object).getActions()
.
Parameters
obj
| the object to be compared for equality with this CardPermission |
Returns
- true if and only if the specified object is equal to this
CardPermission
public
String
getActions
()
Returns the canonical string representation of the actions.
It is *
to signify all actions defined by this class or
the string concatenation of the comma-separated,
lexicographically sorted list of individual actions.
Returns
- the canonical string representation of the actions.
public
int
hashCode
()
Returns the hash code value for this CardPermission object.
Returns
- the hash code value for this CardPermission object.
public
boolean
implies
(Permission permission)
Checks if this CardPermission object implies the specified permission.
That is the case, if and only if
permission
is an instance of CardPermission,
permission
's actions are a proper subset of this
object's actions, and
this object's getName()
method is either
*
or equal to permission
's name
.
Parameters
permission
| the permission to check against |
Returns
- true if and only if this CardPermission object implies the
specified permission.