eu.xtreemos.xosd.utilities.security
Class Utils

java.lang.Object
  extended by eu.xtreemos.xosd.utilities.security.Utils

public class Utils
extends java.lang.Object

Chapter 6 Utils


Nested Class Summary
static class Utils.MyPassword
           
 
Field Summary
protected static java.lang.String COMMA
           
protected static java.lang.String CREDENTIAL_SEPERATOR
           
 
Constructor Summary
Utils()
           
 
Method Summary
static java.lang.String findSubjectAltName(java.util.Collection subjectAltNames, int nameType)
           
static java.security.KeyPair generateKeyPair(java.lang.String algorithm, int keylen)
           
static java.security.cert.X509Certificate readCertificate(java.io.InputStreamReader isr)
           
static java.security.KeyPair readKeyPair(java.lang.String keyFilename, char[] password)
           
static java.lang.Object readPEM(java.io.InputStreamReader isr)
           
static java.lang.Object readPEM(java.lang.String keyFilename, char[] password, java.lang.String type)
           
static java.util.ArrayList<java.lang.Object> readPEMList(java.io.InputStreamReader isr)
           
static java.util.ArrayList<java.lang.Object> readPEMList(java.lang.String keyFilename, char[] password, java.lang.String type)
           
static org.bouncycastle.x509.X509V2AttributeCertificate readX509Certificate(java.lang.String keyFilename)
           
static java.security.cert.X509Certificate readX509Certificate(java.lang.String keyFilename, char[] password)
           
static java.util.ArrayList<java.lang.Object> readX509CertificateList(java.lang.String keyFilename, char[] password)
           
static void writeCertificate(java.io.OutputStreamWriter osw, org.bouncycastle.x509.X509AttributeCertificate cert)
           
static void writeCertificate(java.io.OutputStreamWriter osw, java.security.cert.X509Certificate cert)
           
static void writeKey(java.io.OutputStream os, java.security.PrivateKey key)
           
static void writeKey(java.io.OutputStream os, java.security.PrivateKey key, java.lang.String alg, char[] password)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMA

protected static final java.lang.String COMMA
See Also:
Constant Field Values

CREDENTIAL_SEPERATOR

protected static java.lang.String CREDENTIAL_SEPERATOR
Constructor Detail

Utils

public Utils()
Method Detail

generateKeyPair

public static java.security.KeyPair generateKeyPair(java.lang.String algorithm,
                                                    int keylen)
                                             throws java.security.NoSuchAlgorithmException
Throws:
java.security.NoSuchAlgorithmException

findSubjectAltName

public static java.lang.String findSubjectAltName(java.util.Collection subjectAltNames,
                                                  int nameType)

readX509Certificate

public static java.security.cert.X509Certificate readX509Certificate(java.lang.String keyFilename,
                                                                     char[] password)
                                                              throws java.io.FileNotFoundException,
                                                                     java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException

readX509CertificateList

public static java.util.ArrayList<java.lang.Object> readX509CertificateList(java.lang.String keyFilename,
                                                                            char[] password)
                                                                     throws java.io.FileNotFoundException,
                                                                            java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException

readX509Certificate

public static org.bouncycastle.x509.X509V2AttributeCertificate readX509Certificate(java.lang.String keyFilename)
                                                                            throws java.io.FileNotFoundException,
                                                                                   java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException

readKeyPair

public static java.security.KeyPair readKeyPair(java.lang.String keyFilename,
                                                char[] password)
                                         throws java.io.FileNotFoundException,
                                                java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException

readPEM

public static java.lang.Object readPEM(java.lang.String keyFilename,
                                       char[] password,
                                       java.lang.String type)
                                throws java.io.FileNotFoundException,
                                       java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException

readPEMList

public static java.util.ArrayList<java.lang.Object> readPEMList(java.lang.String keyFilename,
                                                                char[] password,
                                                                java.lang.String type)
                                                         throws java.io.FileNotFoundException,
                                                                java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException

readCertificate

public static java.security.cert.X509Certificate readCertificate(java.io.InputStreamReader isr)
                                                          throws java.io.IOException
Throws:
java.io.IOException

readPEM

public static java.lang.Object readPEM(java.io.InputStreamReader isr)
                                throws java.io.IOException
Throws:
java.io.IOException

readPEMList

public static java.util.ArrayList<java.lang.Object> readPEMList(java.io.InputStreamReader isr)
                                                         throws java.io.IOException
Throws:
java.io.IOException

writeKey

public static void writeKey(java.io.OutputStream os,
                            java.security.PrivateKey key,
                            java.lang.String alg,
                            char[] password)

writeKey

public static void writeKey(java.io.OutputStream os,
                            java.security.PrivateKey key)

writeCertificate

public static void writeCertificate(java.io.OutputStreamWriter osw,
                                    java.security.cert.X509Certificate cert)
                             throws java.io.IOException
Throws:
java.io.IOException

writeCertificate

public static void writeCertificate(java.io.OutputStreamWriter osw,
                                    org.bouncycastle.x509.X509AttributeCertificate cert)
                             throws java.io.IOException
Throws:
java.io.IOException