@MinDoc(copyright="Copyright 2000 - 2003, 2009 A. Weinert", author="Albrecht Weinert", version="V.11", lastModified="5.02.2019", lastModifiedBy="A. Weinert", usage="use for actions and their execution", purpose="identifiable unit, capable of acting") public class Identity extends ACLentry implements Principal, Serializable
IdGroup
). But it may be also be a system or a
client or server computer.application
. It calculates the keyed version for a clear
password or PIN. Identity
objects having the same
name
. Often, additionally, uniqueness in both name and
password is required. This is the case in an Identity
shall be
identified by a PIN entered a numeric keyboard in the field. It is the
task of the used factory methods to guard the required uniqueness.clone()
returns this.java.security
.Principal
as well
as an AclEntry
object. By this it is
possible to hold all the Identity's permissions in the same object.
The AclEntry
's implementation by this class
does not allow for negative permission or prohibitions lists;
AclEntry.setNegativePermissions()
just has
no effect here.Modifier and Type | Field and Description |
---|---|
String |
asString
Identity as String.
|
int |
hashC
The hash code.
|
String |
name
The name.
|
ANY_ID, ILLEGAL_USER, negative, REFUSED
Modifier and Type | Method and Description |
---|---|
Object |
clone()
(No) Copy.
|
boolean |
equals(Object other)
Equality of two identities.
|
String |
getName()
The name.
|
int |
hashCode()
The hash code.
|
static void |
main(String[] args)
Application: Making the coded PIN for an identity.
|
static Identity |
make(CharSequence namePins)
Make an Identity .
|
static Identity |
make(CharSequence name,
byte[] pin)
Make an Identity (Name, PIN/Password).
|
static Identity |
makeWoPassw(CharSequence name)
Make an Identity without password protection.
|
boolean |
sameName(CharSequence name)
Check, if name is the same.
|
boolean |
sameNamePIN(CharSequence name,
byte[] pin)
Check, if name and PIN / password are fitting.
|
boolean |
samePIN(byte[] pin)
Check, if PIN / password is fitting.
|
String |
toString()
Identity as String.
|
add, checkPermission, checkPermission, elements, getPrincipal, implies, invokeAll, removePermission, setPrincipal
isReadOnly, setReadOnly
public final int hashC
public final String asString
toString()
public final String getName()
public int hashCode()
public final boolean equals(Object other)
IdGroup
) don't have to.public String toString()
toString
in interface Principal
toString
in class PermissionCollection
public static void main(String[] args)
make(String)
respectively
(XML controlled) factory applications can be fed with this applications
output. So Identities (with password) can be generated without giving
the clear text even to the factories.make(String)
to generate an
Identity named "Weinert" with the encoded password
"Albrecht", which in this combination, of course,
Albrecht Weinert will never ever use.args
- name cleartextPasswordpublic static Identity make(CharSequence name, byte[] pin)
name
- the new Identity's name; not null or emptypin
- password or PIN; not null and length in the range 4 .. 20NullPointerException
- if the secure hash algorithm to be used
does not exist (should not happen in any decent Java
installation)IllegalArgumentException
- if parameter restrictions are violatedpublic static Identity makeWoPassw(CharSequence name)
name
- the new Identity's name; not null or emptyNullPointerException
- if the secure hash algorithm to be used
does not exist (should not happen in any decent Java
installation)IllegalArgumentException
- if parameter restrictions are violatedpublic static Identity make(CharSequence namePins)
namePins
18.)namePins
comments enclosed in braces are
removed. An example of an accepted character sequence is:main(String[]
).namePins
- Name and 16 hex digits (may be 8 pairs) coded passwordIllegalArgumentException
- if parameter restrictions are violatedpublic boolean sameName(CharSequence name)
public boolean samePIN(byte[] pin)
makeWoPassw(CharSequence)
).public final boolean sameNamePIN(CharSequence name, byte[] pin)
sameName(name)
and
samePIN(pin)
.public Object clone()
IdGroup
).clone
in class ACLentry
equals(Object)