Class cryptiX.asn1.ASN1
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cryptiX.asn1.ASN1

java.lang.Object
   |
   +----cryptiX.asn1.ASN1

public class ASN1
extends Object

Variable Index

 o DER
 o PEM

Constructor Index

 o ASN1()
default constructor To ensure, that classes are loaded in static {}.
 o ASN1(ASN1Object)
creates the ASN1Object from an other ASN1Object.
 o ASN1(byte[])
creates the ASN1Object from a byte array.
 o ASN1(String)
creates the ASN1Object from a file.

Method Index

 o components()
returns the number of components for this ASN1Object.
 o fingerprint()
returns a fingerprint (MD5 Hash of the whole cert) from this ASN1 object.
 o getComponentAt(int)
Returns the ASN1Object at index if asn1Obj is a SEQUENCE.
 o getFirstObject()
returns the first object within the first sequence is used for checking the signature from the original data
 o Oid2Name(String)
returns the name of an object id
 o print(ASN1Object)
recurive method for toString();
 o readKeyFile(String)
 o registerOID(String, String)
registers a OID <-> name pair
 o saveFormat()
returns the file format (ASN1.DER, ASN1.PEM)
 o saveToFile(String)
saves this ASN1Object to a DER file.
 o saveToFile(String, String, String)
saves this ASN1Object to a PEM file.
 o setSaveFormat(int)
sets the file format (ASN1.DER, ASN1.PEM)
 o toASN1Object()
returns the source ASN1Object
 o toByteArrayDER()
returns the ASN1Object in DER format
 o toByteArrayPEM()
returns the ASN1Object in PEM format
 o toString()
converts the ASN1Object to String result is similar asn1parse

Variables

 o DER
  public final static int DER
 o PEM
  public final static int PEM

Constructors

 o ASN1
  public ASN1()
default constructor To ensure, that classes are loaded in static {}.
 o ASN1
  public ASN1(ASN1Object o)
creates the ASN1Object from an other ASN1Object.
 o ASN1
  public ASN1(String fileName) throws IOException, CodingException
creates the ASN1Object from a file. The format of the file could be PEM or DER.
 o ASN1
  public ASN1(byte arr[]) throws CodingException
creates the ASN1Object from a byte array. The format of the array could be PEM or DER.

Methods

 o readKeyFile
  public byte[] readKeyFile(String fileName) throws IOException
 o getComponentAt
  public ASN1Object getComponentAt(int index) throws CodingException
Returns the ASN1Object at index if asn1Obj is a SEQUENCE.
Parameters:
index - position in the sequence
Returns:
the ASN1Object at this position
 o components
  public int components()
returns the number of components for this ASN1Object. Only useful with a SEQUENCE.
 o getFirstObject
  public byte[] getFirstObject() throws CodingException
returns the first object within the first sequence is used for checking the signature from the original data
 o toByteArrayDER
  public byte[] toByteArrayDER()
returns the ASN1Object in DER format
Returns:
the ASN1Object in DER format
 o toByteArrayPEM
  public byte[] toByteArrayPEM()
returns the ASN1Object in PEM format
Returns:
the ASN1Object in PEM format
 o saveToFile
  public void saveToFile(String fileName) throws IOException
saves this ASN1Object to a DER file.
Parameters:
fileName - the name of the file
 o saveToFile
  public void saveToFile(String fileName,
                         String begin,
                         String end) throws IOException
saves this ASN1Object to a PEM file.
Parameters:
fileName - the name of the file
begin - the first line of the file
end - the last line of the file
 o setSaveFormat
  public void setSaveFormat(int format)
sets the file format (ASN1.DER, ASN1.PEM)
 o saveFormat
  public int saveFormat()
returns the file format (ASN1.DER, ASN1.PEM)
 o toString
  public String toString()
converts the ASN1Object to String result is similar asn1parse
Overrides:
toString in class Object
 o print
  public static String print(ASN1Object o)
recurive method for toString();
 o toASN1Object
  public ASN1Object toASN1Object()
returns the source ASN1Object
 o fingerprint
  public byte[] fingerprint()
returns a fingerprint (MD5 Hash of the whole cert) from this ASN1 object. If possible, the original array is used.
 o registerOID
  public static void registerOID(String OID,
                                 String Name)
registers a OID <-> name pair
 o Oid2Name
  public static String Oid2Name(String oid)
returns the name of an object id
Parameters:
oid - the object ID (e.g. "2.5.4.3")

All Packages  Class Hierarchy  This Package  Previous  Next  Index