Class CardPermission
java.lang.Object
java.security.Permission
javax.smartcardio.CardPermission
- All Implemented Interfaces:
Serializable, Guard
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 Card.beginExclusive() and endExclusive()
- transmitControl
- transmit a control command using Card.transmitControlCommand()
- getBasicChannel
- obtain the basic logical channel using Card.getBasicChannel()
- openLogicalChannel
- open a new logical channel using Card.openLogicalChannel()
- Since:
- 1.6
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCardPermission
(String terminalName, String actions) Constructs a new CardPermission with the specified actions. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares the specified object with this CardPermission for equality.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.Methods declared in class Permission
checkGuard, getName, newPermissionCollection, toString
Modifier and TypeMethodDescriptionvoid
checkGuard
(Object object) Implements the guard interface for a permission.final String
getName()
Returns the name of thisPermission
.Returns an emptyPermissionCollection
for a givenPermission
object, ornull
if one is not defined.toString()
Returns a string describing thisPermission
.Methods declared in class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Modifier and TypeMethodDescriptionprotected Object
clone()
Creates and returns a copy of this object.protected void
finalize()
Deprecated, for removal: This API element is subject to removal in a future version.Finalization is deprecated and subject to removal in a future release.final Class
<?> getClass()
Returns the runtime class of thisObject
.final void
notify()
Wakes up a single thread that is waiting on this object's monitor.final void
Wakes up all threads that are waiting on this object's monitor.final void
wait()
Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final void
wait
(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final void
wait
(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Constructor Details
-
CardPermission
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)- Throws:
NullPointerException
- if terminalName is nullIllegalArgumentException
- if actions is an invalid actions specification
-
-
Method Details
-
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.- Specified by:
getActions
in classPermission
- Returns:
- the canonical string representation of the actions.
-
implies
Checks if this CardPermission object implies the specified permission. That is the case, if and only ifpermission
is an instance of CardPermission,permission
's actions are a proper subset of this object's actions, andthis object's
getName()
method is either*
or equal topermission
'sname
.
- Specified by:
implies
in classPermission
- Parameters:
permission
- the permission to check against- Returns:
- true if and only if this CardPermission object implies the specified permission.
-
equals
Compares the specified object with this CardPermission for equality. This CardPermission is equal to another Objectobject
, if and only ifobject
is an instance of CardPermission,this.getName()
is equal to((CardPermission)object).getName()
, andthis.getActions()
is equal to((CardPermission)object).getActions()
.
- Specified by:
equals
in classPermission
- 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
- See Also:
-
hashCode
public int hashCode()Returns the hash code value for this CardPermission object.- Specified by:
hashCode
in classPermission
- Returns:
- the hash code value for this CardPermission object.
- See Also:
-