- java.lang.Object
-
- java.security.Identity
-
- All Implemented Interfaces:
- Serializable, Principal
- Direct Known Subclasses:
- IdentityScope, Signer
Deprecated.This class is no longer used. Its functionality has been replaced byjava.security.KeyStore
, thejava.security.cert
package, andjava.security.Principal
.
@Deprecated public abstract class Identity extends Object implements Principal, Serializable
This class represents identities: real-world objects such as people, companies or organizations whose identities can be authenticated using their public keys. Identities may also be more abstract (or concrete) constructs, such as daemon threads or smart cards.
All Identity objects have a name and a public key. Names are immutable. Identities may also be scoped. That is, if an Identity is specified to have a particular scope, then the name and public key of the Identity are unique within that scope.
An Identity also has a set of certificates (all certifying its own public key). The Principal names specified in these certificates need not be the same, only the key.
An Identity can be subclassed, to include postal and email addresses, telephone numbers, images of faces and logos, and so on.
- See Also:
IdentityScope
,Signer
,Principal
, Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor and Description protected
Identity()
Deprecated.Constructor for serialization only.Identity(String name)
Deprecated.Constructs an identity with the specified name and no scope.Identity(String name, IdentityScope scope)
Deprecated.Constructs an identity with the specified name and scope.
-
Method Summary
Methods Modifier and Type Method and Description void
addCertificate(Certificate certificate)
Deprecated.Adds a certificate for this identity.Certificate[]
certificates()
Deprecated.Returns a copy of all the certificates for this identity.boolean
equals(Object identity)
Deprecated.Tests for equality between the specified object and this identity.String
getInfo()
Deprecated.Returns general information previously specified for this identity.String
getName()
Deprecated.Returns this identity's name.PublicKey
getPublicKey()
Deprecated.Returns this identity's public key.IdentityScope
getScope()
Deprecated.Returns this identity's scope.int
hashCode()
Deprecated.Returns a hashcode for this identity.protected boolean
identityEquals(Identity identity)
Deprecated.Tests for equality between the specified identity and this identity.void
removeCertificate(Certificate certificate)
Deprecated.Removes a certificate from this identity.void
setInfo(String info)
Deprecated.Specifies a general information string for this identity.void
setPublicKey(PublicKey key)
Deprecated.Sets this identity's public key.String
toString()
Deprecated.Returns a short string describing this identity, telling its name and its scope (if any).String
toString(boolean detailed)
Deprecated.Returns a string representation of this identity, with optionally more details than that provided by thetoString
method without any arguments.
-
-
-
Constructor Detail
-
Identity
protected Identity()
Deprecated.Constructor for serialization only.
-
Identity
public Identity(String name, IdentityScope scope) throws KeyManagementException
Deprecated.Constructs an identity with the specified name and scope.- Parameters:
name
- the identity name.scope
- the scope of the identity.- Throws:
KeyManagementException
- if there is already an identity with the same name in the scope.
-
Identity
public Identity(String name)
Deprecated.Constructs an identity with the specified name and no scope.- Parameters:
name
- the identity name.
-
-
Method Detail
-
getName
public final String getName()
Deprecated.Returns this identity's name.
-
getScope
public final IdentityScope getScope()
Deprecated.Returns this identity's scope.- Returns:
- the scope of this identity.
-
getPublicKey
public PublicKey getPublicKey()
Deprecated.Returns this identity's public key.- Returns:
- the public key for this identity.
- See Also:
setPublicKey(java.security.PublicKey)
-
setPublicKey
public void setPublicKey(PublicKey key) throws KeyManagementException
Deprecated.Sets this identity's public key. The old key and all of this identity's certificates are removed by this operation.First, if there is a security manager, its
checkSecurityAccess
method is called with"setIdentityPublicKey"
as its argument to see if it's ok to set the public key.- Parameters:
key
- the public key for this identity.- Throws:
KeyManagementException
- if another identity in the identity's scope has the same public key, or if another exception occurs.SecurityException
- if a security manager exists and itscheckSecurityAccess
method doesn't allow setting the public key.- See Also:
getPublicKey()
,SecurityManager.checkSecurityAccess(java.lang.String)
-
setInfo
public void setInfo(String info)
Deprecated.Specifies a general information string for this identity.First, if there is a security manager, its
checkSecurityAccess
method is called with"setIdentityInfo"
as its argument to see if it's ok to specify the information string.- Parameters:
info
- the information string.- Throws:
SecurityException
- if a security manager exists and itscheckSecurityAccess
method doesn't allow setting the information string.- See Also:
getInfo()
,SecurityManager.checkSecurityAccess(java.lang.String)
-
getInfo
public String getInfo()
Deprecated.Returns general information previously specified for this identity.- Returns:
- general information about this identity.
- See Also:
setInfo(java.lang.String)
-
addCertificate
public void addCertificate(Certificate certificate) throws KeyManagementException
Deprecated.Adds a certificate for this identity. If the identity has a public key, the public key in the certificate must be the same, and if the identity does not have a public key, the identity's public key is set to be that specified in the certificate.First, if there is a security manager, its
checkSecurityAccess
method is called with"addIdentityCertificate"
as its argument to see if it's ok to add a certificate.- Parameters:
certificate
- the certificate to be added.- Throws:
KeyManagementException
- if the certificate is not valid, if the public key in the certificate being added conflicts with this identity's public key, or if another exception occurs.SecurityException
- if a security manager exists and itscheckSecurityAccess
method doesn't allow adding a certificate.- See Also:
SecurityManager.checkSecurityAccess(java.lang.String)
-
removeCertificate
public void removeCertificate(Certificate certificate) throws KeyManagementException
Deprecated.Removes a certificate from this identity.First, if there is a security manager, its
checkSecurityAccess
method is called with"removeIdentityCertificate"
as its argument to see if it's ok to remove a certificate.- Parameters:
certificate
- the certificate to be removed.- Throws:
KeyManagementException
- if the certificate is missing, or if another exception occurs.SecurityException
- if a security manager exists and itscheckSecurityAccess
method doesn't allow removing a certificate.- See Also:
SecurityManager.checkSecurityAccess(java.lang.String)
-
certificates
public Certificate[] certificates()
Deprecated.Returns a copy of all the certificates for this identity.- Returns:
- a copy of all the certificates for this identity.
-
equals
public final boolean equals(Object identity)
Deprecated.Tests for equality between the specified object and this identity. This first tests to see if the entities actually refer to the same object, in which case it returns true. Next, it checks to see if the entities have the same name and the same scope. If they do, the method returns true. Otherwise, it callsidentityEquals
, which subclasses should override.- Specified by:
equals
in interfacePrincipal
- Overrides:
equals
in classObject
- Parameters:
identity
- the object to test for equality with this identity.- Returns:
- true if the objects are considered equal, false otherwise.
- See Also:
identityEquals(java.security.Identity)
-
identityEquals
protected boolean identityEquals(Identity identity)
Deprecated.Tests for equality between the specified identity and this identity. This method should be overriden by subclasses to test for equality. The default behavior is to return true if the names and public keys are equal.- Parameters:
identity
- the identity to test for equality with this identity.- Returns:
- true if the identities are considered equal, false otherwise.
- See Also:
equals(java.lang.Object)
-
toString
public String toString()
Deprecated.Returns a short string describing this identity, telling its name and its scope (if any).First, if there is a security manager, its
checkSecurityAccess
method is called with"printIdentity"
as its argument to see if it's ok to return the string.- Specified by:
toString
in interfacePrincipal
- Overrides:
toString
in classObject
- Returns:
- information about this identity, such as its name and the name of its scope (if any).
- Throws:
SecurityException
- if a security manager exists and itscheckSecurityAccess
method doesn't allow returning a string describing this identity.- See Also:
SecurityManager.checkSecurityAccess(java.lang.String)
-
toString
public String toString(boolean detailed)
Deprecated.Returns a string representation of this identity, with optionally more details than that provided by thetoString
method without any arguments.First, if there is a security manager, its
checkSecurityAccess
method is called with"printIdentity"
as its argument to see if it's ok to return the string.- Parameters:
detailed
- whether or not to provide detailed information.- Returns:
- information about this identity. If
detailed
is true, then this method returns more information than that provided by thetoString
method without any arguments. - Throws:
SecurityException
- if a security manager exists and itscheckSecurityAccess
method doesn't allow returning a string describing this identity.- See Also:
toString()
,SecurityManager.checkSecurityAccess(java.lang.String)
-
hashCode
public int hashCode()
Deprecated.Returns a hashcode for this identity.- Specified by:
hashCode
in interfacePrincipal
- Overrides:
hashCode
in classObject
- Returns:
- a hashcode for this identity.
- See Also:
Object.equals(java.lang.Object)
,System.identityHashCode(java.lang.Object)
-
-
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 11/06/2005, zuletzt geändert 04/03/2020
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-rf-java/security/identity.html/.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor Diese Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.