Class CardPermission
- All Implemented Interfaces:
-
Serializable
,Guard
public class CardPermission extends Permission
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
Constructor | Description |
---|---|
CardPermission |
Constructs a new CardPermission with the specified actions. |
Method Summary
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals |
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 |
Checks if this CardPermission object implies the specified permission. |
Methods declared in class java.security.Permission
checkGuard, getName, newPermissionCollection, toString
Constructor Details
CardPermission
public CardPermission(String terminalName, String 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 null -
IllegalArgumentException
- if actions is an invalid actions specification
Method Details
getActions
public String getActions()
*
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
public boolean implies(Permission permission)
-
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 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
public boolean equals(Object obj)
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()
.
- 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()
- Specified by:
-
hashCode
in classPermission
- Returns:
- the hash code value for this CardPermission object.
- See Also:
© 1993, 2021, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/17/docs/api/java.smartcardio/javax/smartcardio/CardPermission.html