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 SummaryConstructorsConstructorDescriptionCardPermission(String terminalName, String actions) Constructs a new CardPermission with the specified actions.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanCompares the specified object with this CardPermission for equality.Returns the canonical string representation of the actions.inthashCode()Returns the hash code value for this CardPermission object.booleanimplies(Permission permission) Checks if this CardPermission object implies the specified permission.Methods declared in class java.security.PermissioncheckGuard, getName, newPermissionCollection, toString
- 
Constructor Details- 
CardPermissionConstructs a new CardPermission with the specified actions.terminalNameis the name of a CardTerminal or*if this permission applies to all terminals.actionscontains 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 null
- IllegalArgumentException- if actions is an invalid actions specification
 
 
- 
- 
Method Details- 
getActionsReturns 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:
- getActionsin class- Permission
- Returns:
- the canonical string representation of the actions.
 
- 
impliesChecks if this CardPermission object implies the specified permission. That is the case, if and only if- permissionis 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.
 - Specified by:
- impliesin class- Permission
- Parameters:
- permission- the permission to check against
- Returns:
- true if and only if this CardPermission object implies the specified permission.
 
- 
equalsCompares the specified object with this CardPermission for equality. This CardPermission is equal to another Objectobject, if and only if- objectis an instance of CardPermission,
- this.getName()is equal to- ((CardPermission)object).getName(), and
- this.getActions()is equal to- ((CardPermission)object).getActions().
 - Specified by:
- equalsin class- Permission
- 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:
 
- 
hashCodepublic int hashCode()Returns the hash code value for this CardPermission object.- Specified by:
- hashCodein class- Permission
- Returns:
- the hash code value for this CardPermission object.
- See Also:
 
 
-