Java Doc for DerValue.java in  » 6.0-JDK-Modules » j2me » sun » security » util » 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 » sun.security.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   sun.security.util.DerValue

DerValue
public class DerValue (Code)
Represents a single DER-encoded value. DER encoding rules are a subset of the "Basic" Encoding Rules (BER), but they only support a single way ("Definite" encoding) to encode any given value.

All DER-encoded data are triples {type, length, data}. This class represents such tagged values as they have been read (or constructed), and provides structured access to the encoded data.

At this time, this class supports only a subset of the types of DER data encodings which are defined. That subset is sufficient for parsing most X.509 certificates, and working with selected additional formats (such as PKCS #10 certificate requests, and some kinds of PKCS #7 data). A note with respect to T61/Teletex strings: From RFC 1617, section 4.1.3 and RFC 2459, section 4.1.2.4., we assume that this kind of string will contain ISO-8859-1 characters only.
version:
   1.60, 10/10/06
author:
   David Brownell
author:
   Amit Kapoor
author:
   Hemma Prafullchandra



Field Summary
final public static  byteTAG_APPLICATION
    
final public static  byteTAG_CONTEXT
    
final public static  byteTAG_PRIVATE
    
final public static  byteTAG_UNIVERSAL
    
protected  DerInputBufferbuffer
    
public  DerInputStreamdata
     The DER-encoded data of the value.
public  bytetag
     The DER tag of the value; one of the tag_ constants.
final public static  bytetag_BMPString
     Tag value indicating an ASN.1 "BMPString" value.
final public static  bytetag_BitString
     Tag value indicating an ASN.1 "BIT STRING" value.
final public static  bytetag_Boolean
     Tag value indicating an ASN.1 "BOOLEAN" value.
final public static  bytetag_Enumerated
    
final public static  bytetag_GeneralString
     Tag value indicating an ASN.1 "GenerallString" value.
final public static  bytetag_GeneralizedTime
     Tag value indicating an ASN.1 "GeneralizedTime" value.
final public static  bytetag_IA5String
    
final public static  bytetag_Integer
     Tag value indicating an ASN.1 "INTEGER" value.
final public static  bytetag_Null
     Tag value indicating an ASN.1 "NULL" value.
final public static  bytetag_ObjectId
     Tag value indicating an ASN.1 "OBJECT IDENTIFIER" value.
final public static  bytetag_OctetString
     Tag value indicating an ASN.1 "OCTET STRING" value.
final public static  bytetag_PrintableString
    
final public static  bytetag_Sequence
     Tag value indicating an ASN.1 "SEQUENCE" (zero to N elements, order is significant).
final public static  bytetag_SequenceOf
     Tag value indicating an ASN.1 "SEQUENCE OF" (one to N elements, order is significant).
final public static  bytetag_Set
     Tag value indicating an ASN.1 "SET" (zero to N members, order does not matter).
final public static  bytetag_SetOf
     Tag value indicating an ASN.1 "SET OF" (one to N members, order does not matter).
final public static  bytetag_T61String
    
final public static  bytetag_UTF8String
     Tag value indicating an ASN.1 "UTF8String" value.
final public static  bytetag_UniversalString
     Tag value indicating an ASN.1 "UniversalString" value.
final public static  bytetag_UtcTime
     Tag value indicating an ASN.1 "UTCTime" value.

Constructor Summary
public  DerValue(String value)
    
public  DerValue(byte stringTag, String value)
    
public  DerValue(byte tag, byte[] data)
     Creates a DerValue from a tag and some DER-encoded data.
 DerValue(DerInputBuffer in)
    
public  DerValue(byte[] buf)
     Get an ASN.1/DER encoded datum from a buffer.
public  DerValue(byte[] buf, int offset, int len)
     Get an ASN.1/DER encoded datum from part of a buffer.
public  DerValue(InputStream in)
     Get an ASN1/DER encoded datum from an input stream.

Method Summary
public static  bytecreateTag(byte tagClass, boolean form, byte val)
     Create the tag of the attribute.
public  voidencode(DerOutputStream out)
     Encode an ASN1/DER encoded datum onto a DER output stream.
public  booleanequals(Object other)
     Returns true iff the other object is a DER value which is bitwise equal to this one.
public  booleanequals(DerValue other)
     Bitwise equality comparison.
public  StringgetAsString()
     Returns the name component as a Java string, regardless of its encoding restrictions (ASCII, T61, Printable, IA5, BMP, UTF8).
public  StringgetBMPString()
     Returns the ASN.1 BMP (Unicode) STRING value as a Java string.
public  BigIntegergetBigInteger()
     Returns an ASN.1 INTEGER value as a BigInteger.
public  byte[]getBitString()
     Returns an ASN.1 BIT STRING value.
public  byte[]getBitString(boolean tagImplicit)
     Returns an ASN.1 BIT STRING value, with the tag assumed implicit based on the parameter.
public  booleangetBoolean()
    
final public  DerInputStreamgetData()
    
public  byte[]getDataBytes()
     Helper routine to return all the bytes contained in the DerInputStream associated with this object.
public  intgetEnumerated()
     Returns an ASN.1 ENUMERATED value.
public  StringgetGeneralString()
     Returns the ASN.1 GENERAL STRING value as a Java String.
public  DategetGeneralizedTime()
     Returns a Date if the DerValue is GeneralizedTime.
public  StringgetIA5String()
    
public  intgetInteger()
     Returns an ASN.1 INTEGER value as an integer.
public  ObjectIdentifiergetOID()
     Returns an ASN.1 OBJECT IDENTIFIER.
public  byte[]getOctetString()
    
public  StringgetPrintableString()
    
public  StringgetT61String()
    
final public  bytegetTag()
    
public  DategetUTCTime()
     Returns a Date if the DerValue is UtcTime.
public  StringgetUTF8String()
     Returns the ASN.1 UTF-8 STRING value as a Java String.
public  BitArraygetUnalignedBitString()
     Returns an ASN.1 BIT STRING value that need not be byte-aligned.
public  BitArraygetUnalignedBitString(boolean tagImplicit)
     Returns an ASN.1 BIT STRING value, with the tag assumed implicit based on the parameter.
public  inthashCode()
     Returns a hashcode for this DerValue.
public  booleanisApplication()
     Returns true if the tag class is APPLICATION.
public  booleanisConstructed()
     Returns true iff the CONSTRUCTED bit is set in the type tag.
public  booleanisConstructed(byte constructedTag)
     Returns true iff the CONSTRUCTED TAG matches the passed tag.
public  booleanisContextSpecific()
     Returns true iff the CONTEXT SPECIFIC bit is set in the type tag.
public  booleanisContextSpecific(byte cntxtTag)
     Returns true iff the CONTEXT SPECIFIC TAG matches the passed tag.
public static  booleanisPrintableStringChar(char ch)
     Determine if a character is one of the permissible characters for PrintableString: A-Z, a-z, 0-9, space, apostrophe (39), left and right parentheses, plus sign, comma, hyphen, period, slash, colon, equals sign, and question mark.
 booleanisPrivate()
    
public  booleanisUniversal()
     Returns true if the tag class is UNIVERSAL.
public  intlength()
     Get the length of the encoded value.
public  voidresetTag(byte tag)
     Set the tag of the attribute.
public  byte[]toByteArray()
     Returns a DER-encoded value, such that if it's passed to the DerValue constructor, a value equivalent to "this" is returned.
public  DerInputStreamtoDerInputStream()
     For "set" and "sequence" types, this function may be used to return a DER stream of the members of the set or sequence.
public  StringtoString()
     Returns a printable representation of the value.

Field Detail
TAG_APPLICATION
final public static byte TAG_APPLICATION(Code)



TAG_CONTEXT
final public static byte TAG_CONTEXT(Code)



TAG_PRIVATE
final public static byte TAG_PRIVATE(Code)



TAG_UNIVERSAL
final public static byte TAG_UNIVERSAL(Code)
The tag class types



buffer
protected DerInputBuffer buffer(Code)



data
public DerInputStream data(Code)
The DER-encoded data of the value.



tag
public byte tag(Code)
The DER tag of the value; one of the tag_ constants.



tag_BMPString
final public static byte tag_BMPString(Code)
Tag value indicating an ASN.1 "BMPString" value.



tag_BitString
final public static byte tag_BitString(Code)
Tag value indicating an ASN.1 "BIT STRING" value.



tag_Boolean
final public static byte tag_Boolean(Code)
Tag value indicating an ASN.1 "BOOLEAN" value.



tag_Enumerated
final public static byte tag_Enumerated(Code)
Tag value including an ASN.1 "ENUMERATED" value



tag_GeneralString
final public static byte tag_GeneralString(Code)
Tag value indicating an ASN.1 "GenerallString" value.



tag_GeneralizedTime
final public static byte tag_GeneralizedTime(Code)
Tag value indicating an ASN.1 "GeneralizedTime" value.



tag_IA5String
final public static byte tag_IA5String(Code)
Tag value including an ASCII string



tag_Integer
final public static byte tag_Integer(Code)
Tag value indicating an ASN.1 "INTEGER" value.



tag_Null
final public static byte tag_Null(Code)
Tag value indicating an ASN.1 "NULL" value.



tag_ObjectId
final public static byte tag_ObjectId(Code)
Tag value indicating an ASN.1 "OBJECT IDENTIFIER" value.



tag_OctetString
final public static byte tag_OctetString(Code)
Tag value indicating an ASN.1 "OCTET STRING" value.



tag_PrintableString
final public static byte tag_PrintableString(Code)
Tag value including a "printable" string



tag_Sequence
final public static byte tag_Sequence(Code)
Tag value indicating an ASN.1 "SEQUENCE" (zero to N elements, order is significant).



tag_SequenceOf
final public static byte tag_SequenceOf(Code)
Tag value indicating an ASN.1 "SEQUENCE OF" (one to N elements, order is significant).



tag_Set
final public static byte tag_Set(Code)
Tag value indicating an ASN.1 "SET" (zero to N members, order does not matter).



tag_SetOf
final public static byte tag_SetOf(Code)
Tag value indicating an ASN.1 "SET OF" (one to N members, order does not matter).



tag_T61String
final public static byte tag_T61String(Code)
Tag value including a "teletype" string



tag_UTF8String
final public static byte tag_UTF8String(Code)
Tag value indicating an ASN.1 "UTF8String" value.



tag_UniversalString
final public static byte tag_UniversalString(Code)
Tag value indicating an ASN.1 "UniversalString" value.



tag_UtcTime
final public static byte tag_UtcTime(Code)
Tag value indicating an ASN.1 "UTCTime" value.




Constructor Detail
DerValue
public DerValue(String value) throws IOException(Code)
Creates a PrintableString or UTF8string DER value from a string



DerValue
public DerValue(byte stringTag, String value) throws IOException(Code)
Creates a string type DER value from a String object
Parameters:
  stringTag - the tag for the DER value to create
Parameters:
  value - the String object to use for the DER value



DerValue
public DerValue(byte tag, byte[] data)(Code)
Creates a DerValue from a tag and some DER-encoded data.
Parameters:
  tag - the DER type tag
Parameters:
  data - the DER-encoded data



DerValue
DerValue(DerInputBuffer in) throws IOException(Code)



DerValue
public DerValue(byte[] buf) throws IOException(Code)
Get an ASN.1/DER encoded datum from a buffer. The entire buffer must hold exactly one datum, including its tag and length.
Parameters:
  buf - buffer holding a single DER-encoded datum.



DerValue
public DerValue(byte[] buf, int offset, int len) throws IOException(Code)
Get an ASN.1/DER encoded datum from part of a buffer. That part of the buffer must hold exactly one datum, including its tag and length.
Parameters:
  buf - the buffer
Parameters:
  offset - start point of the single DER-encoded dataum
Parameters:
  length - how many bytes are in the encoded datum



DerValue
public DerValue(InputStream in) throws IOException(Code)
Get an ASN1/DER encoded datum from an input stream. The stream may have additional data following the encoded datum. In case of indefinite length encoded datum, the input stream must hold only one datum.
Parameters:
  in - the input stream holding a single DER datum,which may be followed by additional data




Method Detail
createTag
public static byte createTag(byte tagClass, boolean form, byte val)(Code)
Create the tag of the attribute.



encode
public void encode(DerOutputStream out) throws IOException(Code)
Encode an ASN1/DER encoded datum onto a DER output stream.



equals
public boolean equals(Object other)(Code)
Returns true iff the other object is a DER value which is bitwise equal to this one.
Parameters:
  other - the object being compared with this one



equals
public boolean equals(DerValue other)(Code)
Bitwise equality comparison. DER encoded values have a single encoding, so that bitwise equality of the encoded values is an efficient way to establish equivalence of the unencoded values.
Parameters:
  other - the object being compared with this one



getAsString
public String getAsString() throws IOException(Code)
Returns the name component as a Java string, regardless of its encoding restrictions (ASCII, T61, Printable, IA5, BMP, UTF8).



getBMPString
public String getBMPString() throws IOException(Code)
Returns the ASN.1 BMP (Unicode) STRING value as a Java string. a string corresponding to the encoded BMPString held in this value



getBigInteger
public BigInteger getBigInteger() throws IOException(Code)
Returns an ASN.1 INTEGER value as a BigInteger. the integer held in this DER value as a BigInteger.



getBitString
public byte[] getBitString() throws IOException(Code)
Returns an ASN.1 BIT STRING value. The bit string must be byte-aligned. the bit string held in this value



getBitString
public byte[] getBitString(boolean tagImplicit) throws IOException(Code)
Returns an ASN.1 BIT STRING value, with the tag assumed implicit based on the parameter. The bit string must be byte-aligned. the bit string held in this value



getBoolean
public boolean getBoolean() throws IOException(Code)
Returns an ASN.1 BOOLEAN the boolean held in this DER value



getData
final public DerInputStream getData()(Code)



getDataBytes
public byte[] getDataBytes() throws IOException(Code)
Helper routine to return all the bytes contained in the DerInputStream associated with this object.



getEnumerated
public int getEnumerated() throws IOException(Code)
Returns an ASN.1 ENUMERATED value. the integer held in this DER value.



getGeneralString
public String getGeneralString() throws IOException(Code)
Returns the ASN.1 GENERAL STRING value as a Java String. a string corresponding to the encoded GeneralString held in this value



getGeneralizedTime
public Date getGeneralizedTime() throws IOException(Code)
Returns a Date if the DerValue is GeneralizedTime. the Date held in this DER value



getIA5String
public String getIA5String() throws IOException(Code)
Returns an ASN.1 IA5 (ASCII) STRING value the ASCII string held in this value



getInteger
public int getInteger() throws IOException(Code)
Returns an ASN.1 INTEGER value as an integer. the integer held in this DER value.



getOID
public ObjectIdentifier getOID() throws IOException(Code)
Returns an ASN.1 OBJECT IDENTIFIER. the OID held in this DER value



getOctetString
public byte[] getOctetString() throws IOException(Code)
Returns an ASN.1 OCTET STRING the octet string held in this DER value



getPrintableString
public String getPrintableString() throws IOException(Code)
Returns an ASN.1 STRING value the printable string held in this value



getT61String
public String getT61String() throws IOException(Code)
Returns an ASN.1 T61 (Teletype) STRING value the teletype string held in this value



getTag
final public byte getTag()(Code)



getUTCTime
public Date getUTCTime() throws IOException(Code)
Returns a Date if the DerValue is UtcTime. the Date held in this DER value



getUTF8String
public String getUTF8String() throws IOException(Code)
Returns the ASN.1 UTF-8 STRING value as a Java String. a string corresponding to the encoded UTF8String held in this value



getUnalignedBitString
public BitArray getUnalignedBitString() throws IOException(Code)
Returns an ASN.1 BIT STRING value that need not be byte-aligned. a BitArray representing the bit string held in this value



getUnalignedBitString
public BitArray getUnalignedBitString(boolean tagImplicit) throws IOException(Code)
Returns an ASN.1 BIT STRING value, with the tag assumed implicit based on the parameter. The bit string need not be byte-aligned. the bit string held in this value



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



isApplication
public boolean isApplication()(Code)
Returns true if the tag class is APPLICATION.



isConstructed
public boolean isConstructed()(Code)
Returns true iff the CONSTRUCTED bit is set in the type tag.



isConstructed
public boolean isConstructed(byte constructedTag)(Code)
Returns true iff the CONSTRUCTED TAG matches the passed tag.



isContextSpecific
public boolean isContextSpecific()(Code)
Returns true iff the CONTEXT SPECIFIC bit is set in the type tag. This is associated with the ASN.1 "DEFINED BY" syntax.



isContextSpecific
public boolean isContextSpecific(byte cntxtTag)(Code)
Returns true iff the CONTEXT SPECIFIC TAG matches the passed tag.



isPrintableStringChar
public static boolean isPrintableStringChar(char ch)(Code)
Determine if a character is one of the permissible characters for PrintableString: A-Z, a-z, 0-9, space, apostrophe (39), left and right parentheses, plus sign, comma, hyphen, period, slash, colon, equals sign, and question mark. Characters that are *not* allowed in PrintableString include exclamation point, quotation mark, number sign, dollar sign, percent sign, ampersand, asterisk, semicolon, less than sign, greater than sign, at sign, left and right square brackets, backslash, circumflex (94), underscore, back quote (96), left and right curly brackets, vertical line, tilde, and the control codes (0-31 and 127). This list is based on X.680 (the ASN.1 spec).



isPrivate
boolean isPrivate()(Code)



isUniversal
public boolean isUniversal()(Code)
Returns true if the tag class is UNIVERSAL.



length
public int length()(Code)
Get the length of the encoded value.



resetTag
public void resetTag(byte tag)(Code)
Set the tag of the attribute. Commonly used to reset the tag value used for IMPLICIT encodings.



toByteArray
public byte[] toByteArray() throws IOException(Code)
Returns a DER-encoded value, such that if it's passed to the DerValue constructor, a value equivalent to "this" is returned. DER-encoded value, including tag and length.



toDerInputStream
public DerInputStream toDerInputStream() throws IOException(Code)
For "set" and "sequence" types, this function may be used to return a DER stream of the members of the set or sequence. This operation is not supported for primitive types such as integers or bit strings.



toString
public String toString()(Code)
Returns a printable representation of the value. printable representation of the value



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.