Java Doc for GeneralName.java in  » Apache-Harmony-Java-SE » org-package » org » apache » harmony » security » x509 » 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 » Apache Harmony Java SE » org package » org.apache.harmony.security.x509 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.harmony.security.x509.GeneralName

GeneralName
public class GeneralName (Code)
The class encapsulates the ASN.1 DER encoding/decoding work with the GeneralName structure which is a part of X.509 certificate (as specified in RFC 3280 - Internet X.509 Public Key Infrastructure. Certificate and Certificate Revocation List (CRL) Profile. http://www.ietf.org/rfc/rfc3280.txt):
 GeneralName::= CHOICE {
 otherName                       [0]     OtherName,
 rfc822Name                      [1]     IA5String,
 dNSName                         [2]     IA5String,
 x400Address                     [3]     ORAddress,
 directoryName                   [4]     Name,
 ediPartyName                    [5]     EDIPartyName,
 uniformResourceIdentifier       [6]     IA5String,
 iPAddress                       [7]     OCTET STRING,
 registeredID                    [8]     OBJECT IDENTIFIER
 }
 OtherName::= SEQUENCE {
 type-id    OBJECT IDENTIFIER,
 value      [0] EXPLICIT ANY DEFINED BY type-id 
 }
 EDIPartyName::= SEQUENCE {
 nameAssigner            [0]     DirectoryString OPTIONAL,
 partyName               [1]     DirectoryString 
 }
 DirectoryString::= CHOICE {
 teletexString             TeletexString   (SIZE (1..MAX)),
 printableString           PrintableString (SIZE (1..MAX)),
 universalString           UniversalString (SIZE (1..MAX)),
 utf8String              UTF8String      (SIZE (1..MAX)),
 bmpString               BMPString       (SIZE (1..MAX)) 
 }
 

See Also:   org.apache.harmony.security.x509.NameConstraints
See Also:   org.apache.harmony.security.x509.GeneralSubtree


Field Summary
final public static  ASN1ChoiceASN1
    
final public static  intDIR_NAME
    
final public static  intDNS_NAME
    
final public static  intEDIP_NAME
    
final public static  intIP_ADDR
    
final public static  intOTHER_NAME
    
final public static  intREG_ID
    
final public static  intRFC822_NAME
    
final public static  intUR_ID
    
final public static  intX400_ADDR
    

Constructor Summary
public  GeneralName(int tag, String name)
     Makes the GeneralName object from the tag type and corresponding well established string representation of the name value. The String representation of [7] iPAddress is such as: For IP v4, as specified in RFC 791, the address must contain exactly 4 byte component.
public  GeneralName(OtherName name)
    
public  GeneralName(ORAddress name)
    
public  GeneralName(Name name)
    
public  GeneralName(EDIPartyName name)
    
public  GeneralName(byte[] name)
     Constructor for type [7] iPAddress.
public  GeneralName(int tag, byte[] name)
     Constructs an object representing the value of GeneralName.

Method Summary
public static  voidcheckDNS(String dns)
     Checks the correctness of the string representation of DNS name. The correctness is checked as specified in RFC 1034 p.
public static  voidcheckURI(String uri)
     Checks the correctness of the string representation of URI name. The correctness is checked as pointed out in RFC 3280 p.
public  booleanequals(Object _gname)
    
public  ListgetAsList()
     Gets a list representation of this GeneralName object. The first entry of the list is an Integer object representing the type of mane (0-8), and the second entry is a value of the name: string or ASN.1 DER encoded form depending on the type as follows: rfc822Name, dNSName, uniformResourceIdentifier names are returned as Strings, using the string formats for those types (rfc 3280) IP v4 address names are returned using dotted quad notation.
public  byte[]getEncoded()
     Returns ASN.1 encoded form of this X.509 GeneralName value.
public  byte[]getEncodedName()
    
public  ObjectgetName()
     the value of the name.
public  intgetTag()
    
public  inthashCode()
    
public static  StringipBytesToStr(byte[] ip)
     Helper method.
public static  byte[]ipStrToBytes(String ip)
     Helper method.
public  booleanisAcceptable(GeneralName gname)
     Checks if the other general name is acceptable by this object. The name is acceptable if it has the same type name and its name value is equal to name value of this object.
public static  int[]oidStrToInts(String oid)
     Converts OID into array of bytes.
public  StringtoString()
    

Field Detail
ASN1
final public static ASN1Choice ASN1(Code)



DIR_NAME
final public static int DIR_NAME(Code)



DNS_NAME
final public static int DNS_NAME(Code)



EDIP_NAME
final public static int EDIP_NAME(Code)



IP_ADDR
final public static int IP_ADDR(Code)



OTHER_NAME
final public static int OTHER_NAME(Code)
The values of the tags of fields



REG_ID
final public static int REG_ID(Code)



RFC822_NAME
final public static int RFC822_NAME(Code)



UR_ID
final public static int UR_ID(Code)



X400_ADDR
final public static int X400_ADDR(Code)




Constructor Detail
GeneralName
public GeneralName(int tag, String name) throws IOException(Code)
Makes the GeneralName object from the tag type and corresponding well established string representation of the name value. The String representation of [7] iPAddress is such as: For IP v4, as specified in RFC 791, the address must contain exactly 4 byte component. For IP v6, as specified in RFC 1883, the address must contain exactly 16 byte component. If GeneralName structure is used as a part of Name Constraints extension, to represent an address range the number of address component is doubled (to 8 and 32 bytes respectively). Note that the names: [0] otherName, [3] x400Address, [5] ediPartyName have no the string representation, so exception will be thrown. To make the GeneralName object with such names use another constructor.
Parameters:
  tag - is an integer which value corresponds to the name type.
Parameters:
  name - is a name value corresponding to the tag.



GeneralName
public GeneralName(OtherName name)(Code)
TODO name: OtherName



GeneralName
public GeneralName(ORAddress name)(Code)
TODO name: ORAddress



GeneralName
public GeneralName(Name name)(Code)
TODO name: Name



GeneralName
public GeneralName(EDIPartyName name)(Code)
TODO name: EDIPartyName



GeneralName
public GeneralName(byte[] name) throws IllegalArgumentException(Code)
Constructor for type [7] iPAddress. name is an array of bytes such as: For IP v4, as specified in RFC 791, the address must contain exactly 4 byte component. For IP v6, as specified in RFC 1883, the address must contain exactly 16 byte component. If GeneralName structure is used as a part of Name Constraints extension, to represent an address range the number of address component is doubled (to 8 and 32 bytes respectively).



GeneralName
public GeneralName(int tag, byte[] name) throws IOException(Code)
Constructs an object representing the value of GeneralName.
Parameters:
  tag - is an integer which value correspondsto the name type (0-8),
Parameters:
  name - is a DER encoded for of the name value




Method Detail
checkDNS
public static void checkDNS(String dns) throws IOException(Code)
Checks the correctness of the string representation of DNS name. The correctness is checked as specified in RFC 1034 p. 10.



checkURI
public static void checkURI(String uri) throws IOException(Code)
Checks the correctness of the string representation of URI name. The correctness is checked as pointed out in RFC 3280 p. 34.



equals
public boolean equals(Object _gname)(Code)
TODO _gname: Object



getAsList
public List getAsList()(Code)
Gets a list representation of this GeneralName object. The first entry of the list is an Integer object representing the type of mane (0-8), and the second entry is a value of the name: string or ASN.1 DER encoded form depending on the type as follows: rfc822Name, dNSName, uniformResourceIdentifier names are returned as Strings, using the string formats for those types (rfc 3280) IP v4 address names are returned using dotted quad notation. IP v6 address names are returned in the form "p1:p2:...:p8", where p1-p8 are hexadecimal values representing the eight 16-bit pieces of the address. registeredID name are returned as Strings represented as a series of nonnegative integers separated by periods. And directory names (distinguished names) are returned in RFC 2253 string format. otherName, X400Address, ediPartyName returned as byte arrays containing the ASN.1 DER encoded form of the name.



getEncoded
public byte[] getEncoded()(Code)
Returns ASN.1 encoded form of this X.509 GeneralName value. a byte array containing ASN.1 encode form.



getEncodedName
public byte[] getEncodedName()(Code)
the encoded value of the name without the tag associated with the name in the GeneralName structure
throws:
  IOException -



getName
public Object getName()(Code)
the value of the name. The class of name object depends on the tag as follows:[0] otherName - OtherName object,[1] rfc822Name - String object,[2] dNSName - String object,[3] x400Address - ORAddress object,[4] directoryName - instance of Name object,[5] ediPartyName - EDIPartyName object,[6] uniformResourceIdentifier - String object,[7] iPAddress - array of bytes such as:For IP v4, as specified in RFC 791, the address mustcontain exactly 4 byte component. For IP v6, as specified inRFC 1883, the address must contain exactly 16 byte component.If GeneralName structure is used as a part of Name Constraintsextension, to represent an address range the number of addresscomponent is doubled (to 8 and 32 bytes respectively).[8] registeredID - String.



getTag
public int getTag()(Code)
Returns the tag of the name in the structure the tag of the name



hashCode
public int hashCode()(Code)



ipBytesToStr
public static String ipBytesToStr(byte[] ip)(Code)
Helper method. Converts the byte array representation of ip address to the String.
Parameters:
  ip - : byte array representation of ip addressIf the length of byte array 4 then it represents an IP v4 and the output String will be in the dotted quad form. If the length is 16 then it represents an IP v6 and the output String will be returned in format "p1:p2:...:p8", where p1-p8 are hexadecimal values representing the eight 16-bit pieces of the address.If the length is 8 or 32 then it represents an address range (RFC 1519)and the output String will contain 2 IP address divided by "/" String representation of ip address



ipStrToBytes
public static byte[] ipStrToBytes(String ip) throws IOException(Code)
Helper method. Converts the String representation of IP address to the array of bytes. IP addresses are expected in two versions:
IPv4 - in dot-decimal notation
IPv6 - in colon hexadecimal notation
Also method works with the ranges of the addresses represented as 2 addresses separated by '/' character.
Parameters:
  address - : String representation of IP address byte representation of IP address



isAcceptable
public boolean isAcceptable(GeneralName gname)(Code)
Checks if the other general name is acceptable by this object. The name is acceptable if it has the same type name and its name value is equal to name value of this object. Also the name is acceptable if this general name object is a part of name constraints and the specified name is satisfied the restriction provided by this object (for more detail see section 4.2.1.11 of rfc 3280). Note that for X400Address [3] check procedure is unclear so method just checks the equality of encoded forms. For otherName [0], ediPartyName [5], and registeredID [8] the check procedure if not defined by rfc 3280 and for names of these types this method also checks only for equality of encoded forms.



oidStrToInts
public static int[] oidStrToInts(String oid) throws IOException(Code)
Converts OID into array of bytes.



toString
public String toString()(Code)
TODO



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(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.