Package java.security
Class Identity
- java.lang.Object
-
- java.security.Identity
-
- All Implemented Interfaces:
Serializable,Principal
- Direct Known Subclasses:
IdentityScope,Signer
@Deprecated public abstract class Identity extends Object implements Principal, Serializable
Identityrepresents an identity like a person or a company.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedIdentity()Deprecated.Constructs a new instance ofIdentity.Identity(String name)Deprecated.Creates a new instance ofIdentitywith the specified name.Identity(String name, IdentityScope scope)Deprecated.Creates a new instance ofIdentitywith the specified name and the scope of thisIdentity.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddCertificate(Certificate certificate)Deprecated.Adds aCertificateto thisIdentity.Certificate[]certificates()Deprecated.Returns the certificates for thisIdentity.booleanequals(Object obj)Deprecated.Compares the specified object with thisIdentityfor equality and returnstrueif the specified object is equal,falseotherwise.StringgetInfo()Deprecated.Returns the information string of thisIdentity.StringgetName()Deprecated.Returns the name of thisIdentity.PublicKeygetPublicKey()Deprecated.Returns thePublicKeyassociated with thisIdentity.IdentityScopegetScope()Deprecated.Returns theIdentityScopeof thisIdentity.inthashCode()Deprecated.Returns the hash code value for thisIdentity.protected booleanidentityEquals(Identity identity)Deprecated.Compares the specifiedIdentitywith thisIdentityfor equality and returnstrueif the specified object is equal,falseotherwise.voidremoveCertificate(Certificate certificate)Deprecated.Removes the specifiedCertificatefrom thisIdentity.voidsetInfo(String info)Deprecated.Sets an information string for thisIdentity.voidsetPublicKey(PublicKey key)Deprecated.Sets the specifiedPublicKeyto thisIdentity.StringtoString()Deprecated.Returns a string containing a concise, human-readable description of the thisIdentityincluding its name and its scope.StringtoString(boolean detailed)Deprecated.Returns a string containing a concise, human-readable description of the thisIdentity.
-
-
-
Constructor Detail
-
Identity
protected Identity()
Deprecated.Constructs a new instance ofIdentity.
-
Identity
public Identity(String name)
Deprecated.Creates a new instance ofIdentitywith the specified name.- Parameters:
name- the name of thisIdentity.
-
Identity
public Identity(String name, IdentityScope scope) throws KeyManagementException
Deprecated.Creates a new instance ofIdentitywith the specified name and the scope of thisIdentity.- Parameters:
name- the name of thisIdentity.scope- theIdentityScopeof thisIdentity.- Throws:
KeyManagementException- if anIdentitywith the same name is already present in the specified scope.
-
-
Method Detail
-
addCertificate
public void addCertificate(Certificate certificate) throws KeyManagementException
Deprecated.Adds aCertificateto thisIdentity.- Parameters:
certificate- theCertificateto be added to thisIdentity.- Throws:
KeyManagementException- if the certificate is not valid.
-
removeCertificate
public void removeCertificate(Certificate certificate) throws KeyManagementException
Deprecated.Removes the specifiedCertificatefrom thisIdentity.- Parameters:
certificate- theCertificateto be removed.- Throws:
KeyManagementException- if the certificate is not found.
-
certificates
public Certificate[] certificates()
Deprecated.Returns the certificates for thisIdentity. External modifications of the returned array has no impact on thisIdentity.- Returns:
- the
Certificatesfor thisIdentity
-
identityEquals
protected boolean identityEquals(Identity identity)
Deprecated.Compares the specifiedIdentitywith thisIdentityfor equality and returnstrueif the specified object is equal,falseotherwise.To be equal, two
Identityobjects need to have the same name and the same public keys.- Parameters:
identity- the identity to check for equality.- Returns:
trueif theIdentityobjects are equal,falseotherwise.
-
toString
public String toString(boolean detailed)
Deprecated.Returns a string containing a concise, human-readable description of the thisIdentity.- Parameters:
detailed- whether or not this method should return detailed information.- Returns:
- a printable representation for this
Permission.
-
getScope
public final IdentityScope getScope()
Deprecated.Returns theIdentityScopeof thisIdentity.- Returns:
- the
IdentityScopeof thisIdentity.
-
setPublicKey
public void setPublicKey(PublicKey key) throws KeyManagementException
Deprecated.Sets the specifiedPublicKeyto thisIdentity.- Parameters:
key- thePublicKeyto be set.- Throws:
KeyManagementException- if anotherIdentityin the same scope as thisIdentityalready has the samePublicKey.
-
getPublicKey
public PublicKey getPublicKey()
Deprecated.Returns thePublicKeyassociated with thisIdentity.- Returns:
- the
PublicKeyassociated with thisIdentity.
-
setInfo
public void setInfo(String info)
Deprecated.Sets an information string for thisIdentity.- Parameters:
info- the information to be set.
-
getInfo
public String getInfo()
Deprecated.Returns the information string of thisIdentity.- Returns:
- the information string of this
Identity.
-
equals
public final boolean equals(Object obj)
Deprecated.Compares the specified object with thisIdentityfor equality and returnstrueif the specified object is equal,falseotherwise.Identityobjects are considered equal, if they have the same name and are in the same scope.- Specified by:
equalsin interfacePrincipal- Overrides:
equalsin classObject- Parameters:
obj- object to be compared for equality with thisIdentity.- Returns:
trueif the specified object is equal to thisIdentity, otherwisefalse.- See Also:
Object.hashCode()
-
getName
public final String getName()
Deprecated.Returns the name of thisIdentity.
-
hashCode
public int hashCode()
Deprecated.Returns the hash code value for thisIdentity. Returns the same hash code forIdentitys that are equal to each other as required by the general contract ofObject.hashCode().- Specified by:
hashCodein interfacePrincipal- Overrides:
hashCodein classObject- Returns:
- the hash code value for this
Identity. - See Also:
Object.equals(Object),equals(Object)
-
toString
public String toString()
Deprecated.Returns a string containing a concise, human-readable description of the thisIdentityincluding its name and its scope.
-
-