org.apache.abdera.security.util
Class KeyHelper

java.lang.Object
  extended by org.apache.abdera.security.util.KeyHelper

public class KeyHelper
extends Object


Constructor Summary
KeyHelper()
           
 
Method Summary
static Key generateKey(String type)
           
static KeyPair generateKeyPair(String type, int size)
           
static KeyPair generateKeyPair(String type, int size, String provider)
           
static PublicKey generatePublicKey(String hex)
           
static SecretKey generateSecretKey(String type, int size)
           
static SecretKey generateSecretKey(String type, int size, String provider)
           
static
<T extends Certificate>
T
getCertificate(KeyStore ks, String alias)
           
static
<T extends Key>
T
getKey(KeyStore ks, String alias, String pass)
           
static KeyStore loadKeystore(String file, String pass)
           
static KeyStore loadKeystore(String type, String file, String pass)
           
static void saveKeystore(KeyStore ks, String file, String password)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyHelper

public KeyHelper()
Method Detail

saveKeystore

public static void saveKeystore(KeyStore ks,
                                String file,
                                String password)
                         throws KeyStoreException,
                                NoSuchAlgorithmException,
                                CertificateException,
                                FileNotFoundException,
                                IOException
Throws:
KeyStoreException
NoSuchAlgorithmException
CertificateException
FileNotFoundException
IOException

loadKeystore

public static KeyStore loadKeystore(String file,
                                    String pass)
                             throws KeyStoreException,
                                    NoSuchAlgorithmException,
                                    CertificateException,
                                    IOException
Throws:
KeyStoreException
NoSuchAlgorithmException
CertificateException
IOException

loadKeystore

public static KeyStore loadKeystore(String type,
                                    String file,
                                    String pass)
                             throws KeyStoreException,
                                    NoSuchAlgorithmException,
                                    CertificateException,
                                    IOException
Throws:
KeyStoreException
NoSuchAlgorithmException
CertificateException
IOException

getKey

public static <T extends Key> T getKey(KeyStore ks,
                                       String alias,
                                       String pass)
                            throws KeyStoreException,
                                   NoSuchAlgorithmException,
                                   UnrecoverableKeyException
Throws:
KeyStoreException
NoSuchAlgorithmException
UnrecoverableKeyException

getCertificate

public static <T extends Certificate> T getCertificate(KeyStore ks,
                                                       String alias)
                                            throws KeyStoreException
Throws:
KeyStoreException

generateKeyPair

public static KeyPair generateKeyPair(String type,
                                      int size)
                               throws NoSuchAlgorithmException,
                                      NoSuchProviderException
Throws:
NoSuchAlgorithmException
NoSuchProviderException

generateKeyPair

public static KeyPair generateKeyPair(String type,
                                      int size,
                                      String provider)
                               throws NoSuchAlgorithmException,
                                      NoSuchProviderException
Throws:
NoSuchAlgorithmException
NoSuchProviderException

generateSecretKey

public static SecretKey generateSecretKey(String type,
                                          int size)
                                   throws NoSuchAlgorithmException,
                                          NoSuchProviderException
Throws:
NoSuchAlgorithmException
NoSuchProviderException

generateKey

public static Key generateKey(String type)
                       throws NoSuchAlgorithmException
Throws:
NoSuchAlgorithmException

generateSecretKey

public static SecretKey generateSecretKey(String type,
                                          int size,
                                          String provider)
                                   throws NoSuchAlgorithmException,
                                          NoSuchProviderException
Throws:
NoSuchAlgorithmException
NoSuchProviderException

generatePublicKey

public static PublicKey generatePublicKey(String hex)


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.