org.apache.cxf.rs.security.jose.jaxrs
Class KeyManagementUtils

java.lang.Object
  extended by org.apache.cxf.rs.security.jose.jaxrs.KeyManagementUtils

public final class KeyManagementUtils
extends Object

Encryption helpers


Field Summary
static String RSSEC_DECRYPT_KEY_PSWD_PROVIDER
           
static String RSSEC_DEFAULT_ALGORITHMS
           
static String RSSEC_KEY_PSWD
           
static String RSSEC_KEY_PSWD_PROVIDER
           
static String RSSEC_KEY_STORE_ALIAS
           
static String RSSEC_KEY_STORE_ALIASES
           
static String RSSEC_KEY_STORE_FILE
           
static String RSSEC_KEY_STORE_PSWD
           
static String RSSEC_KEY_STORE_TYPE
           
static String RSSEC_PRINCIPAL_NAME
           
static String RSSEC_REPORT_KEY_PROP
           
static String RSSEC_SIG_KEY_PSWD_PROVIDER
           
 
Method Summary
static List<String> encodeX509CertificateChain(List<X509Certificate> chain)
           
static List<String> encodeX509CertificateChain(X509Certificate[] chain)
           
static String getKeyAlgorithm(org.apache.cxf.message.Message m, Properties props, String propName, String defaultAlg)
           
static String getKeyId(org.apache.cxf.message.Message m, Properties props, String preferredPropertyName, String keyOper)
           
static List<String> loadAndEncodeX509CertificateOrChain(org.apache.cxf.message.Message m, Properties props)
           
static KeyStore loadKeyStore(Properties props, org.apache.cxf.Bus bus)
           
static PrivateKeyPasswordProvider loadPasswordProvider(org.apache.cxf.message.Message m, Properties props, String keyOper)
           
static KeyStore loadPersistKeyStore(org.apache.cxf.message.Message m, Properties props)
           
static PrivateKey loadPrivateKey(org.apache.cxf.message.Message m, Properties props, List<X509Certificate> inCerts, String keyOper)
           
static PrivateKey loadPrivateKey(org.apache.cxf.message.Message m, Properties props, String keyOper)
           
static PrivateKey loadPrivateKey(org.apache.cxf.message.Message m, String keyStoreLocProp, String keyOper)
           
static PrivateKey loadPrivateKey(org.apache.cxf.message.Message m, String keyStoreLocPropPreferred, String keyStoreLocPropDefault, String keyOper)
           
static PublicKey loadPublicKey(org.apache.cxf.message.Message m, Properties props)
           
static PublicKey loadPublicKey(org.apache.cxf.message.Message m, String keyStoreLocProp)
           
static PublicKey loadPublicKey(org.apache.cxf.message.Message m, String keyStoreLocPropPreferred, String keyStoreLocPropDefault)
           
static Properties loadStoreProperties(org.apache.cxf.message.Message m, boolean required, String storeProp1, String storeProp2)
           
static X509Certificate[] loadX509CertificateOrChain(org.apache.cxf.message.Message m, Properties props)
           
static List<X509Certificate> toX509CertificateChain(List<String> base64EncodedChain)
           
static X509Certificate[] toX509CertificateChainArray(List<String> base64EncodedChain)
           
static void validateCertificateChain(KeyStore ks, List<X509Certificate> inCerts)
           
static void validateCertificateChain(Properties storeProperties, List<X509Certificate> inCerts)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RSSEC_KEY_STORE_TYPE

public static final String RSSEC_KEY_STORE_TYPE
See Also:
Constant Field Values

RSSEC_KEY_STORE_PSWD

public static final String RSSEC_KEY_STORE_PSWD
See Also:
Constant Field Values

RSSEC_KEY_PSWD

public static final String RSSEC_KEY_PSWD
See Also:
Constant Field Values

RSSEC_KEY_STORE_ALIAS

public static final String RSSEC_KEY_STORE_ALIAS
See Also:
Constant Field Values

RSSEC_KEY_STORE_ALIASES

public static final String RSSEC_KEY_STORE_ALIASES
See Also:
Constant Field Values

RSSEC_KEY_STORE_FILE

public static final String RSSEC_KEY_STORE_FILE
See Also:
Constant Field Values

RSSEC_PRINCIPAL_NAME

public static final String RSSEC_PRINCIPAL_NAME
See Also:
Constant Field Values

RSSEC_KEY_PSWD_PROVIDER

public static final String RSSEC_KEY_PSWD_PROVIDER
See Also:
Constant Field Values

RSSEC_SIG_KEY_PSWD_PROVIDER

public static final String RSSEC_SIG_KEY_PSWD_PROVIDER
See Also:
Constant Field Values

RSSEC_DECRYPT_KEY_PSWD_PROVIDER

public static final String RSSEC_DECRYPT_KEY_PSWD_PROVIDER
See Also:
Constant Field Values

RSSEC_DEFAULT_ALGORITHMS

public static final String RSSEC_DEFAULT_ALGORITHMS
See Also:
Constant Field Values

RSSEC_REPORT_KEY_PROP

public static final String RSSEC_REPORT_KEY_PROP
See Also:
Constant Field Values
Method Detail

loadAndEncodeX509CertificateOrChain

public static List<String> loadAndEncodeX509CertificateOrChain(org.apache.cxf.message.Message m,
                                                               Properties props)

loadX509CertificateOrChain

public static X509Certificate[] loadX509CertificateOrChain(org.apache.cxf.message.Message m,
                                                           Properties props)

loadPublicKey

public static PublicKey loadPublicKey(org.apache.cxf.message.Message m,
                                      Properties props)

loadPublicKey

public static PublicKey loadPublicKey(org.apache.cxf.message.Message m,
                                      String keyStoreLocProp)

loadPublicKey

public static PublicKey loadPublicKey(org.apache.cxf.message.Message m,
                                      String keyStoreLocPropPreferred,
                                      String keyStoreLocPropDefault)

loadPrivateKey

public static PrivateKey loadPrivateKey(org.apache.cxf.message.Message m,
                                        String keyStoreLocProp,
                                        String keyOper)

loadPrivateKey

public static PrivateKey loadPrivateKey(org.apache.cxf.message.Message m,
                                        String keyStoreLocPropPreferred,
                                        String keyStoreLocPropDefault,
                                        String keyOper)

getKeyId

public static String getKeyId(org.apache.cxf.message.Message m,
                              Properties props,
                              String preferredPropertyName,
                              String keyOper)

loadPasswordProvider

public static PrivateKeyPasswordProvider loadPasswordProvider(org.apache.cxf.message.Message m,
                                                              Properties props,
                                                              String keyOper)

loadPrivateKey

public static PrivateKey loadPrivateKey(org.apache.cxf.message.Message m,
                                        Properties props,
                                        String keyOper)

loadPersistKeyStore

public static KeyStore loadPersistKeyStore(org.apache.cxf.message.Message m,
                                           Properties props)

loadKeyStore

public static KeyStore loadKeyStore(Properties props,
                                    org.apache.cxf.Bus bus)

encodeX509CertificateChain

public static List<String> encodeX509CertificateChain(X509Certificate[] chain)

encodeX509CertificateChain

public static List<String> encodeX509CertificateChain(List<X509Certificate> chain)

toX509CertificateChain

public static List<X509Certificate> toX509CertificateChain(List<String> base64EncodedChain)

validateCertificateChain

public static void validateCertificateChain(Properties storeProperties,
                                            List<X509Certificate> inCerts)

validateCertificateChain

public static void validateCertificateChain(KeyStore ks,
                                            List<X509Certificate> inCerts)

toX509CertificateChainArray

public static X509Certificate[] toX509CertificateChainArray(List<String> base64EncodedChain)

getKeyAlgorithm

public static String getKeyAlgorithm(org.apache.cxf.message.Message m,
                                     Properties props,
                                     String propName,
                                     String defaultAlg)

loadStoreProperties

public static Properties loadStoreProperties(org.apache.cxf.message.Message m,
                                             boolean required,
                                             String storeProp1,
                                             String storeProp2)

loadPrivateKey

public static PrivateKey loadPrivateKey(org.apache.cxf.message.Message m,
                                        Properties props,
                                        List<X509Certificate> inCerts,
                                        String keyOper)


Apache CXF