Java Doc for DerInputStream.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.DerInputStream

DerInputStream
public class DerInputStream (Code)
A DER input stream, used for parsing ASN.1 DER-encoded data such as that found in X.509 certificates. DER is a subset of BER/1, which has the advantage that it allows only a single encoding of primitive data. (High level data such as dates still support many encodings.) That is, it uses the "Definite" Encoding Rules (DER) not the "Basic" ones (BER).

Note that, like BER/1, DER streams are streams of explicitly tagged data values. Accordingly, this programming interface does not expose any variant of the java.io.InputStream interface, since that kind of input stream holds untagged data values and using that I/O model could prevent correct parsing of the DER 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.
version:
   1.47
author:
   David Brownell
author:
   Amit Kapoor
author:
   Hemma Prafullchandra



Field Summary
 DerInputBufferbuffer
    
public  bytetag
     The DER tag of the value; one of the tag_ constants.

Constructor Summary
public  DerInputStream(byte[] data)
     Create a DER input stream from a data buffer.
public  DerInputStream(byte[] data, int offset, int len)
     Create a DER input stream from part of a data buffer. The buffer is not copied, it is shared.
 DerInputStream(DerInputBuffer buf)
    

Method Summary
public  intavailable()
     Returns the number of bytes available for reading.
public  StringgetBMPString()
     Read a string that was encoded as a BMPString DER value.
public  BigIntegergetBigInteger()
     Get a integer from the input stream as a BigInteger object.
public  byte[]getBitString()
     Get a bit string from the input stream.
 intgetByte()
    
public  voidgetBytes(byte[] val)
     Returns the asked number of bytes from the input stream.
public  DerValuegetDerValue()
     Get a single DER-encoded value from the input stream. It can often be useful to pull a value from the stream and defer parsing it.
public  intgetEnumerated()
     Get an enumerated from the input stream.
public  StringgetGeneralString()
     Read a string that was encoded as a GeneralString DER value.
public  DategetGeneralizedTime()
     Get a Generalized encoded time value from the input stream.
public  StringgetIA5String()
     Read a string that was encoded as a IA5tring DER value.
public  intgetInteger()
     Get an integer from the input stream as an integer.
 intgetLength()
    
static  intgetLength(InputStream in)
    
static  intgetLength(int lenByte, InputStream in)
    
public  voidgetNull()
     Reads an encoded null value from the input stream.
public  ObjectIdentifiergetOID()
     Reads an X.200 style Object Identifier from the stream.
public  byte[]getOctetString()
     Returns an ASN.1 OCTET STRING from the input stream.
public  StringgetPrintableString()
     Read a string that was encoded as a PrintableString DER value.
public  DerValue[]getSequence(int startLen)
     Return a sequence of encoded entities.
public  DerValue[]getSet(int startLen)
     Return a set of encoded entities.
public  DerValue[]getSet(int startLen, boolean implicit)
     Return a set of encoded entities.
public  StringgetT61String()
     Read a string that was encoded as a T61String DER value.
public  DategetUTCTime()
     Get a UTC encoded time value from the input stream.
public  StringgetUTF8String()
     Read a string that was encoded as a UTF8String DER value.
public  BitArraygetUnalignedBitString()
     Get a bit string from the input stream.
public  voidmark(int value)
     Mark the current position in the buffer, so that a later call to reset will return here.
public  intpeekByte()
    
protected  DerValue[]readVector(int startLen)
    
public  voidreset()
     Return to the position of the last mark call.
public  DerInputStreamsubStream(int len, boolean do_skip)
     Creates a new DER input stream from part of this input stream.
Parameters:
  len - how long a chunk of the current input stream to use,starting at the current position.
Parameters:
  do_skip - true if the existing data in the input stream shouldbe skipped.
public  byte[]toByteArray()
     Return what has been written to this DerInputStream as a byte array.

Field Detail
buffer
DerInputBuffer buffer(Code)



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




Constructor Detail
DerInputStream
public DerInputStream(byte[] data) throws IOException(Code)
Create a DER input stream from a data buffer. The buffer is not copied, it is shared. Accordingly, the buffer should be treated as read-only.
Parameters:
  data - the buffer from which to create the string (CONSUMED)



DerInputStream
public DerInputStream(byte[] data, int offset, int len) throws IOException(Code)
Create a DER input stream from part of a data buffer. The buffer is not copied, it is shared. Accordingly, the buffer should be treated as read-only.
Parameters:
  data - the buffer from which to create the string (CONSUMED)
Parameters:
  offset - the first index of data which willbe read as DER input in the new stream
Parameters:
  len - how long a chunk of the buffer to use,starting at "offset"



DerInputStream
DerInputStream(DerInputBuffer buf)(Code)




Method Detail
available
public int available()(Code)
Returns the number of bytes available for reading. This is most useful for testing whether the stream is empty.



getBMPString
public String getBMPString() throws IOException(Code)
Read a string that was encoded as a BMPString DER value.



getBigInteger
public BigInteger getBigInteger() throws IOException(Code)
Get a integer from the input stream as a BigInteger object. the integer held in this DER input stream.



getBitString
public byte[] getBitString() throws IOException(Code)
Get a bit string from the input stream. Padded bits (if any) will be stripped off before the bit string is returned.



getByte
int getByte() throws IOException(Code)



getBytes
public void getBytes(byte[] val) throws IOException(Code)
Returns the asked number of bytes from the input stream.



getDerValue
public DerValue getDerValue() throws IOException(Code)
Get a single DER-encoded value from the input stream. It can often be useful to pull a value from the stream and defer parsing it. For example, you can pull a nested sequence out with one call, and only examine its elements later when you really need to.



getEnumerated
public int getEnumerated() throws IOException(Code)
Get an enumerated from the input stream. the integer held in this DER input stream.



getGeneralString
public String getGeneralString() throws IOException(Code)
Read a string that was encoded as a GeneralString DER value.



getGeneralizedTime
public Date getGeneralizedTime() throws IOException(Code)
Get a Generalized encoded time value from the input stream.



getIA5String
public String getIA5String() throws IOException(Code)
Read a string that was encoded as a IA5tring DER value.



getInteger
public int getInteger() throws IOException(Code)
Get an integer from the input stream as an integer. the integer held in this DER input stream.



getLength
int getLength() throws IOException(Code)



getLength
static int getLength(InputStream in) throws IOException(Code)



getLength
static int getLength(int lenByte, InputStream in) throws IOException(Code)



getNull
public void getNull() throws IOException(Code)
Reads an encoded null value from the input stream.



getOID
public ObjectIdentifier getOID() throws IOException(Code)
Reads an X.200 style Object Identifier from the stream.



getOctetString
public byte[] getOctetString() throws IOException(Code)
Returns an ASN.1 OCTET STRING from the input stream.



getPrintableString
public String getPrintableString() throws IOException(Code)
Read a string that was encoded as a PrintableString DER value.



getSequence
public DerValue[] getSequence(int startLen) throws IOException(Code)
Return a sequence of encoded entities. ASN.1 sequences are ordered, and they are often used, like a "struct" in C or C++, to group data values. They may have optional or context specific values.
Parameters:
  startLen - guess about how long the sequence will be(used to initialize an auto-growing data structure) array of the values in the sequence



getSet
public DerValue[] getSet(int startLen) throws IOException(Code)
Return a set of encoded entities. ASN.1 sets are unordered, though DER may specify an order for some kinds of sets (such as the attributes in an X.500 relative distinguished name) to facilitate binary comparisons of encoded values.
Parameters:
  startLen - guess about how large the set will be(used to initialize an auto-growing data structure) array of the values in the sequence



getSet
public DerValue[] getSet(int startLen, boolean implicit) throws IOException(Code)
Return a set of encoded entities. ASN.1 sets are unordered, though DER may specify an order for some kinds of sets (such as the attributes in an X.500 relative distinguished name) to facilitate binary comparisons of encoded values.
Parameters:
  startLen - guess about how large the set will be(used to initialize an auto-growing data structure)
Parameters:
  implicit - if true tag is assumed implicit. array of the values in the sequence



getT61String
public String getT61String() throws IOException(Code)
Read a string that was encoded as a T61String DER value.



getUTCTime
public Date getUTCTime() throws IOException(Code)
Get a UTC encoded time value from the input stream.



getUTF8String
public String getUTF8String() throws IOException(Code)
Read a string that was encoded as a UTF8String DER value.



getUnalignedBitString
public BitArray getUnalignedBitString() throws IOException(Code)
Get a bit string from the input stream. The bit string need not be byte-aligned.



mark
public void mark(int value)(Code)
Mark the current position in the buffer, so that a later call to reset will return here.



peekByte
public int peekByte() throws IOException(Code)



readVector
protected DerValue[] readVector(int startLen) throws IOException(Code)



reset
public void reset()(Code)
Return to the position of the last mark call. A mark is implicitly set at the beginning of the stream when it is created.



subStream
public DerInputStream subStream(int len, boolean do_skip) throws IOException(Code)
Creates a new DER input stream from part of this input stream.
Parameters:
  len - how long a chunk of the current input stream to use,starting at the current position.
Parameters:
  do_skip - true if the existing data in the input stream shouldbe skipped. If this value is false, the next data readon this stream and the newly created stream will be thesame.



toByteArray
public byte[] toByteArray()(Code)
Return what has been written to this DerInputStream as a byte array. Useful for debugging.



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.