com.isti.util.test
Class IstiEncryptionUtilsTest

java.lang.Object
  extended by com.isti.util.test.IstiEncryptionUtilsTest

public class IstiEncryptionUtilsTest
extends java.lang.Object


Constructor Summary
IstiEncryptionUtilsTest()
           
 
Method Summary
static java.security.cert.X509Certificate generateX509Certificate(java.io.File certificateFile)
          Generates a X.509 certificate object and initializes it with the data read from the file.
static boolean isDirectory(java.io.File fileObj)
          Test if the specified file is a directory.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IstiEncryptionUtilsTest

public IstiEncryptionUtilsTest()
Method Detail

main

public static void main(java.lang.String[] args)

generateX509Certificate

public static java.security.cert.X509Certificate generateX509Certificate(java.io.File certificateFile)
Generates a X.509 certificate object and initializes it with the data read from the file.

The given file must contain a single certificate.

The X.509 certificate provided in the file must be DER-encoded and may be supplied in binary or printable (Base64) encoding. If the certificate is provided in Base64 encoding, it must be bounded at the beginning by -----BEGIN CERTIFICATE-----, and must be bounded at the end by -----END CERTIFICATE-----.

Note that if the given input stream does not support mark and reset, this method will consume the entire input stream.

Parameters:
certificateFile - the certificate file.
Returns:
a certificate object initialized with the data from the file.
Throws:
java.security.cert.CertificateException - on parsing errors.

isDirectory

public static boolean isDirectory(java.io.File fileObj)
Test if the specified file is a directory.

Parameters:
fileObj - the file.
Returns:
true if the specified file is a directorym false otherwise.