Java Doc for DerOutputStream.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
   java.io.OutputStream
      java.io.ByteArrayOutputStream
         sun.security.util.DerOutputStream

DerOutputStream
public class DerOutputStream extends ByteArrayOutputStream implements DerEncoder(Code)
Output stream marshaling DER-encoded data. This is eventually provided in the form of a byte array; there is no advance limit on the size of that byte array.

At this time, this class supports only a subset of the types of DER data encodings which are defined. That subset is sufficient for generating most X.509 certificates.
version:
   1.39
author:
   David Brownell
author:
   Amit Kapoor
author:
   Hemma Prafullchandra




Constructor Summary
public  DerOutputStream(int size)
     Construct an DER output stream.
public  DerOutputStream()
     Construct an DER output stream.

Method Summary
public  voidderEncode(OutputStream out)
     Write the current contents of this DerOutputStream to an OutputStream.
public  voidputBMPString(String s)
     Marshals a string as a DER encoded BMPString.
public  voidputBitString(byte[] bits)
     Marshals a DER bit string on the output stream.
public  voidputBoolean(boolean val)
     Marshals a DER boolean on the output stream.
public  voidputDerValue(DerValue val)
     Marshals pre-encoded DER value onto the output stream.
public  voidputEnumerated(int i)
     Marshals a DER enumerated on the output stream.
public  voidputGeneralString(String s)
     Marshals a string as a DER encoded GeneralString.
public  voidputGeneralizedTime(Date d)
     Marshals a DER Generalized Time/date value.

YYYYMMDDhhmmss{Z|+hhmm|-hhmm} ...

public  voidputIA5String(String s)
     Marshals a string as a DER encoded IA5String.
public  voidputInteger(BigInteger i)
     Marshals a DER integer on the output stream.
public  voidputInteger(Integer i)
     Marshals a DER integer on the output stream.
public  voidputInteger(int i)
     Marshals a DER integer on the output stream.
public  voidputLength(int len)
     Put the encoding of the length in the stream.
public  voidputNull()
     Marshals a DER "null" value on the output stream.
public  voidputOID(ObjectIdentifier oid)
     Marshals an object identifier (OID) on the output stream.
public  voidputOctetString(byte[] octets)
     DER-encodes an ASN.1 OCTET STRING value on the output stream.
public  voidputOrderedSet(byte tag, DerEncoder[] set)
     Marshals the contents of a set on the output stream.
public  voidputOrderedSetOf(byte tag, DerEncoder[] set)
     Marshals the contents of a set on the output stream.
public  voidputPrintableString(String s)
     Marshals a string as a DER encoded PrintableString.
public  voidputSequence(DerValue[] seq)
     Marshals a sequence on the output stream.
public  voidputSet(DerValue[] set)
     Marshals the contents of a set on the output stream without ordering the elements.
public  voidputT61String(String s)
     Marshals a string as a DER encoded T61String.
public  voidputTag(byte tagClass, boolean form, byte val)
     Put the tag of the attribute in the stream.
public  voidputUTCTime(Date d)
     Marshals a DER UTC time/date value.

YYMMDDhhmmss{Z|+hhmm|-hhmm} ...

public  voidputUTF8String(String s)
     Marshals a string as a DER encoded UTF8String.
public  voidputUnalignedBitString(BitArray ba)
     Marshals a DER bit string on the output stream.
public  voidwrite(byte tag, byte[] buf)
     Writes tagged, pre-marshaled data.
public  voidwrite(byte tag, DerOutputStream out)
     Writes tagged data using buffer-to-buffer copy.
public  voidwriteImplicit(byte tag, DerOutputStream value)
     Writes implicitly tagged data using buffer-to-buffer copy.


Constructor Detail
DerOutputStream
public DerOutputStream(int size)(Code)
Construct an DER output stream.
Parameters:
  size - how large a buffer to preallocate.



DerOutputStream
public DerOutputStream()(Code)
Construct an DER output stream.




Method Detail
derEncode
public void derEncode(OutputStream out) throws IOException(Code)
Write the current contents of this DerOutputStream to an OutputStream.
exception:
  IOException - on output error.



putBMPString
public void putBMPString(String s) throws IOException(Code)
Marshals a string as a DER encoded BMPString.



putBitString
public void putBitString(byte[] bits) throws IOException(Code)
Marshals a DER bit string on the output stream. The bit string must be byte-aligned.
Parameters:
  bits - the bit string, MSB first



putBoolean
public void putBoolean(boolean val) throws IOException(Code)
Marshals a DER boolean on the output stream.



putDerValue
public void putDerValue(DerValue val) throws IOException(Code)
Marshals pre-encoded DER value onto the output stream.



putEnumerated
public void putEnumerated(int i) throws IOException(Code)
Marshals a DER enumerated on the output stream.
Parameters:
  i - the enumerated value.



putGeneralString
public void putGeneralString(String s) throws IOException(Code)
Marshals a string as a DER encoded GeneralString.



putGeneralizedTime
public void putGeneralizedTime(Date d) throws IOException(Code)
Marshals a DER Generalized Time/date value.

YYYYMMDDhhmmss{Z|+hhmm|-hhmm} ... emits only using Zulu time and with seconds (even if seconds=0) as per RFC 2459.




putIA5String
public void putIA5String(String s) throws IOException(Code)
Marshals a string as a DER encoded IA5String.



putInteger
public void putInteger(BigInteger i) throws IOException(Code)
Marshals a DER integer on the output stream.
Parameters:
  i - the integer in the form of a BigInteger.



putInteger
public void putInteger(Integer i) throws IOException(Code)
Marshals a DER integer on the output stream.
Parameters:
  i - the integer in the form of an Integer.



putInteger
public void putInteger(int i) throws IOException(Code)
Marshals a DER integer on the output stream.
Parameters:
  i - the integer.



putLength
public void putLength(int len) throws IOException(Code)
Put the encoding of the length in the stream.
exception:
  IOException - on writing errors.



putNull
public void putNull() throws IOException(Code)
Marshals a DER "null" value on the output stream. These are often used to indicate optional values which have been omitted.



putOID
public void putOID(ObjectIdentifier oid) throws IOException(Code)
Marshals an object identifier (OID) on the output stream. Corresponds to the ASN.1 "OBJECT IDENTIFIER" construct.



putOctetString
public void putOctetString(byte[] octets) throws IOException(Code)
DER-encodes an ASN.1 OCTET STRING value on the output stream.
Parameters:
  octets - the octet string



putOrderedSet
public void putOrderedSet(byte tag, DerEncoder[] set) throws IOException(Code)
Marshals the contents of a set on the output stream. Sets are semantically unordered, but DER requires that encodings of set elements be sorted into ascending tag order before being output. Hence sets with the same tags and elements have the same DER encoding. This method supports the ASN.1 "SET" construct, but not "SET OF", which uses a different order.



putOrderedSetOf
public void putOrderedSetOf(byte tag, DerEncoder[] set) throws IOException(Code)
Marshals the contents of a set on the output stream. Sets are semantically unordered, but DER requires that encodings of set elements be sorted into ascending lexicographical order before being output. Hence sets with the same tags and elements have the same DER encoding. This method supports the ASN.1 "SET OF" construct, but not "SET", which uses a different order.



putPrintableString
public void putPrintableString(String s) throws IOException(Code)
Marshals a string as a DER encoded PrintableString.



putSequence
public void putSequence(DerValue[] seq) throws IOException(Code)
Marshals a sequence on the output stream. This supports both the ASN.1 "SEQUENCE" (zero to N values) and "SEQUENCE OF" (one to N values) constructs.



putSet
public void putSet(DerValue[] set) throws IOException(Code)
Marshals the contents of a set on the output stream without ordering the elements. Ok for BER encoding, but not for DER encoding. For DER encoding, use orderedPutSet() or orderedPutSetOf().



putT61String
public void putT61String(String s) throws IOException(Code)
Marshals a string as a DER encoded T61String.



putTag
public void putTag(byte tagClass, boolean form, byte val)(Code)
Put the tag of the attribute in the stream.



putUTCTime
public void putUTCTime(Date d) throws IOException(Code)
Marshals a DER UTC time/date value.

YYMMDDhhmmss{Z|+hhmm|-hhmm} ... emits only using Zulu time and with seconds (even if seconds=0) as per RFC 2459.




putUTF8String
public void putUTF8String(String s) throws IOException(Code)
Marshals a string as a DER encoded UTF8String.



putUnalignedBitString
public void putUnalignedBitString(BitArray ba) throws IOException(Code)
Marshals a DER bit string on the output stream. The bit strings need not be byte-aligned.
Parameters:
  bits - the bit string, MSB first



write
public void write(byte tag, byte[] buf) throws IOException(Code)
Writes tagged, pre-marshaled data. This calcuates and encodes the length, so that the output data is the standard triple of { tag, length, data } used by all DER values.
Parameters:
  tag - the DER value tag for the data, such asDerValue.tag_Sequence
Parameters:
  buf - buffered data, which must be DER-encoded



write
public void write(byte tag, DerOutputStream out) throws IOException(Code)
Writes tagged data using buffer-to-buffer copy. As above, this writes a standard DER record. This is often used when efficiently encapsulating values in sequences.
Parameters:
  tag - the DER value tag for the data, such asDerValue.tag_Sequence
Parameters:
  out - buffered data



writeImplicit
public void writeImplicit(byte tag, DerOutputStream value) throws IOException(Code)
Writes implicitly tagged data using buffer-to-buffer copy. As above, this writes a standard DER record. This is often used when efficiently encapsulating implicitly tagged values.
Parameters:
  tag - the DER value of the context-specific tag that replacesoriginal tag of the value in the output, such as in
  [N] IMPLICIT 
For example, FooLength [1] IMPLICIT INTEGER, with value=4;would be encoded as "81 01 04" whereas in explicittagging it would be encoded as "A1 03 02 01 04".Notice that the tag is A1 and not 81, this is because withexplicit tagging the form is always constructed.
Parameters:
  value - original value being implicitly tagged



Fields inherited from java.io.ByteArrayOutputStream
protected byte buf(Code)(Java Doc)
protected int count(Code)(Java Doc)

Methods inherited from java.io.ByteArrayOutputStream
public synchronized void close() throws IOException(Code)(Java Doc)
public synchronized void reset()(Code)(Java Doc)
public int size()(Code)(Java Doc)
public synchronized byte toByteArray()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public synchronized void write(int b)(Code)(Java Doc)
public synchronized void write(byte b, int off, int len)(Code)(Java Doc)

Methods inherited from java.io.OutputStream
public void close() throws IOException(Code)(Java Doc)
public void flush() throws IOException(Code)(Java Doc)
abstract public void write(int b) throws IOException(Code)(Java Doc)
public void write(byte b) throws IOException(Code)(Java Doc)
public void write(byte b, int off, int len) throws IOException(Code)(Java Doc)

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.