Java Doc for Identity.java in  » 6.0-JDK-Modules » j2me » java » security » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » java.security 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.security.Identity

All known Subclasses:   java.security.Signer,  java.security.IdentityScope,  sun.security.provider.SystemIdentity,
Identity
abstract public class Identity implements Principal,Serializable(Code)

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
See Also:   Signer
See Also:   Principal
version:
   1.56
author:
   Benjamin Renaud



Field Summary
 Vectorcertificates
     The certificates for this identity.
 Stringinfo
     Generic, descriptive information about the identity.
 IdentityScopescope
     The scope of the identity.

Constructor Summary
protected  Identity()
     Constructor for serialization only.
public  Identity(String name, IdentityScope scope)
     Constructs an identity with the specified name and scope.
Parameters:
  name - the identity name.
public  Identity(String name)
     Constructs an identity with the specified name and no scope.

Method Summary
public  voidaddCertificate(Certificate certificate)
     Adds a certificate for this identity.
public  Certificate[]certificates()
     Returns a copy of all the certificates for this identity.
final public  booleanequals(Object identity)
     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.
 StringfullName()
    
public  StringgetInfo()
     Returns general information previously specified for this identity.
final public  StringgetName()
     Returns this identity's name.
public  PublicKeygetPublicKey()
     Returns this identity's public key.
final public  IdentityScopegetScope()
     Returns this identity's scope.
public  inthashCode()
     Returns a hashcode for this identity.
protected  booleanidentityEquals(Identity identity)
     Tests for equality between the specified identity and this identity. This method should be overriden by subclasses to test for equality.
 StringprintCertificates()
    
 StringprintKeys()
    
public  voidremoveCertificate(Certificate certificate)
     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.

public  voidsetInfo(String info)
     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.

public  voidsetPublicKey(PublicKey key)
     Sets this identity's public key.
public  StringtoString()
     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.

public  StringtoString(boolean detailed)
     Returns a string representation of this identity, with optionally more details than that provided by the toString 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.


Field Detail
certificates
Vector certificates(Code)
The certificates for this identity.



info
String info(Code)
Generic, descriptive information about the identity.



scope
IdentityScope scope(Code)
The scope of the identity.




Constructor Detail
Identity
protected Identity()(Code)
Constructor for serialization only.



Identity
public Identity(String name, IdentityScope scope) throws KeyManagementException(Code)
Constructs an identity with the specified name and scope.
Parameters:
  name - the identity name.
Parameters:
  scope - the scope of the identity.
exception:
  KeyManagementException - if there is already an identity with the same name in the scope.



Identity
public Identity(String name)(Code)
Constructs an identity with the specified name and no scope.
Parameters:
  name - the identity name.




Method Detail
addCertificate
public void addCertificate(Certificate certificate) throws KeyManagementException(Code)
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.
exception:
  KeyManagementException - if the certificate is not valid,if the public key in the certificate being added conflicts withthis identity's public key, or if another exception occurs.
exception:
  SecurityException - if a security manager exists and its checkSecurityAccess method doesn't allow adding a certificate.
See Also:   SecurityManager.checkSecurityAccess




certificates
public Certificate[] certificates()(Code)
Returns a copy of all the certificates for this identity. a copy of all the certificates for this identity.



equals
final public boolean equals(Object identity)(Code)
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 calls Identity.identityEquals(Identity) identityEquals , which subclasses should override.
Parameters:
  identity - the object to test for equality with this identity. true if the objects are considered equal, false otherwise.
See Also:   Identity.identityEquals
See Also:   



fullName
String fullName()(Code)
Returns a parsable name for identity: identityName.scopeName



getInfo
public String getInfo()(Code)
Returns general information previously specified for this identity. general information about this identity.
See Also:   Identity.setInfo



getName
final public String getName()(Code)
Returns this identity's name. the name of this identity.



getPublicKey
public PublicKey getPublicKey()(Code)
Returns this identity's public key. the public key for this identity.
See Also:   Identity.setPublicKey



getScope
final public IdentityScope getScope()(Code)
Returns this identity's scope. the scope of this identity.



hashCode
public int hashCode()(Code)
Returns a hashcode for this identity. a hashcode for this identity.



identityEquals
protected boolean identityEquals(Identity identity)(Code)
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. true if the identities are considered equal, falseotherwise.
See Also:   Identity.equals
See Also:   



printCertificates
String printCertificates()(Code)



printKeys
String printKeys()(Code)



removeCertificate
public void removeCertificate(Certificate certificate) throws KeyManagementException(Code)
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.
exception:
  KeyManagementException - if the certificate ismissing, or if another exception occurs.
exception:
  SecurityException - if a security manager exists and its checkSecurityAccess method doesn't allow removing a certificate.
See Also:   SecurityManager.checkSecurityAccess




setInfo
public void setInfo(String info)(Code)
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.
exception:
  SecurityException - if a security manager exists and its checkSecurityAccess method doesn't allow setting the information string.
See Also:   Identity.getInfo
See Also:   SecurityManager.checkSecurityAccess




setPublicKey
public void setPublicKey(PublicKey key) throws KeyManagementException(Code)
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.
exception:
  KeyManagementException - if another identity in the identity's scope has the same public key, or if another exception occurs.
exception:
  SecurityException - if a security manager exists and its checkSecurityAccess method doesn't allow setting the public key.
See Also:   Identity.getPublicKey
See Also:   SecurityManager.checkSecurityAccess




toString
public String toString()(Code)
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. information about this identity, such as its name and the name of its scope (if any).
exception:
  SecurityException - if a security manager exists and its checkSecurityAccess method doesn't allow returning a string describing this identity.
See Also:   SecurityManager.checkSecurityAccess




toString
public String toString(boolean detailed)(Code)
Returns a string representation of this identity, with optionally more details than that provided by the toString 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. information about this identity. If detailedis true, then this method returns more information than that provided by the toString method without any arguments.
exception:
  SecurityException - if a security manager exists and its checkSecurityAccess method doesn't allow returning a string describing this identity.
See Also:   Identity.toString
See Also:   SecurityManager.checkSecurityAccess




Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.