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
-
DER
-
-
PEM
-
-
ASN1()
- default constructor
To ensure, that classes are loaded in static {}.
-
ASN1(ASN1Object)
- creates the ASN1Object from an other ASN1Object.
-
ASN1(byte[])
- creates the ASN1Object from a byte array.
-
ASN1(String)
- creates the ASN1Object from a file.
-
components()
- returns the number of components for this ASN1Object.
-
fingerprint()
- returns a fingerprint (MD5 Hash of the whole cert) from this ASN1 object.
-
getComponentAt(int)
- Returns the ASN1Object at index if asn1Obj is a SEQUENCE.
-
getFirstObject()
- returns the first object within the first sequence
is used for checking the signature from the original data
-
Oid2Name(String)
- returns the name of an object id
-
print(ASN1Object)
- recurive method for toString();
-
readKeyFile(String)
-
-
registerOID(String, String)
- registers a OID <-> name pair
-
saveFormat()
- returns the file format (ASN1.DER, ASN1.PEM)
-
saveToFile(String)
- saves this ASN1Object to a DER file.
-
saveToFile(String, String, String)
- saves this ASN1Object to a PEM file.
-
setSaveFormat(int)
- sets the file format (ASN1.DER, ASN1.PEM)
-
toASN1Object()
- returns the source ASN1Object
-
toByteArrayDER()
- returns the ASN1Object in DER format
-
toByteArrayPEM()
- returns the ASN1Object in PEM format
-
toString()
- converts the ASN1Object to String
result is similar asn1parse
DER
public final static int DER
PEM
public final static int PEM
ASN1
public ASN1()
- default constructor
To ensure, that classes are loaded in static {}.
ASN1
public ASN1(ASN1Object o)
- creates the ASN1Object from an other ASN1Object.
ASN1
public ASN1(String fileName) throws IOException, CodingException
- creates the ASN1Object from a file.
The format of the file could be PEM or DER.
ASN1
public ASN1(byte arr[]) throws CodingException
- creates the ASN1Object from a byte array.
The format of the array could be PEM or DER.
readKeyFile
public byte[] readKeyFile(String fileName) throws IOException
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
components
public int components()
- returns the number of components for this ASN1Object.
Only useful with a SEQUENCE.
getFirstObject
public byte[] getFirstObject() throws CodingException
- returns the first object within the first sequence
is used for checking the signature from the original data
toByteArrayDER
public byte[] toByteArrayDER()
- returns the ASN1Object in DER format
- Returns:
- the ASN1Object in DER format
toByteArrayPEM
public byte[] toByteArrayPEM()
- returns the ASN1Object in PEM format
- Returns:
- the ASN1Object in PEM format
saveToFile
public void saveToFile(String fileName) throws IOException
- saves this ASN1Object to a DER file.
- Parameters:
- fileName - the name of the file
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
setSaveFormat
public void setSaveFormat(int format)
- sets the file format (ASN1.DER, ASN1.PEM)
saveFormat
public int saveFormat()
- returns the file format (ASN1.DER, ASN1.PEM)
toString
public String toString()
- converts the ASN1Object to String
result is similar asn1parse
- Overrides:
- toString in class Object
print
public static String print(ASN1Object o)
- recurive method for toString();
toASN1Object
public ASN1Object toASN1Object()
- returns the source ASN1Object
fingerprint
public byte[] fingerprint()
- returns a fingerprint (MD5 Hash of the whole cert) from this ASN1 object.
If possible, the original array is used.
registerOID
public static void registerOID(String OID,
String Name)
- registers a OID <-> name pair
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