org.wso2.carbon.identity.application.authentication.endpoint.util
Class TenantMgtAdminServiceClient

java.lang.Object
  extended by org.wso2.carbon.identity.application.authentication.endpoint.util.TenantMgtAdminServiceClient

public class TenantMgtAdminServiceClient
extends Object

Client for calling Admin Services with mutual ssl authentication


Constructor Summary
TenantMgtAdminServiceClient()
           
 
Method Summary
static HttpsURLConnection getHttpsURLConnection()
           
static String getKeyManagerType()
           
static String getKeyStoreType()
           
static String getTrustManagerType()
           
static void getTrustManagerType(String trustManagerType)
           
static String getTrustStoreType()
           
static void initMutualSSLConnection()
          Create basic SSL connection factory
static void loadKeyStore(String keyStorePath, String keyStorePassoword)
          Load key store with given keystore.jks
static void loadTrustStore(String trustStorePath, String trustStorePassoword)
          Load trust store with given .jks file
static String sendPostRequest(String backendURL, String message, Map<String,String> requestProps)
          Send mutual ssl https post request and return data
static void setKeyStoreType(String keyStoreType)
           
static void setProtocol(String protocol)
           
static void settKeyManagerType(String keyManagerType)
           
static void setTrustStoreType(String trustStoreType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TenantMgtAdminServiceClient

public TenantMgtAdminServiceClient()
Method Detail

loadKeyStore

public static void loadKeyStore(String keyStorePath,
                                String keyStorePassoword)
                         throws KeyStoreException,
                                IOException,
                                CertificateException,
                                NoSuchAlgorithmException
Load key store with given keystore.jks

Parameters:
keyStorePath - Path to keystore
keyStorePassoword - Password of keystore
Throws:
KeyStoreException
IOException
CertificateException
NoSuchAlgorithmException

loadTrustStore

public static void loadTrustStore(String trustStorePath,
                                  String trustStorePassoword)
                           throws KeyStoreException,
                                  IOException,
                                  CertificateException,
                                  NoSuchAlgorithmException
Load trust store with given .jks file

Parameters:
trustStorePath - Path to truststore
trustStorePassoword - Password of truststore
Throws:
KeyStoreException
IOException
CertificateException
NoSuchAlgorithmException

initMutualSSLConnection

public static void initMutualSSLConnection()
                                    throws NoSuchAlgorithmException,
                                           KeyStoreException,
                                           KeyManagementException,
                                           IOException,
                                           UnrecoverableKeyException
Create basic SSL connection factory

Throws:
NoSuchAlgorithmException
KeyStoreException
KeyManagementException
IOException
UnrecoverableKeyException

sendPostRequest

public static String sendPostRequest(String backendURL,
                                     String message,
                                     Map<String,String> requestProps)
Send mutual ssl https post request and return data

Parameters:
backendURL - URL of the service
message - Message sent to the URL
requestProps - Requeset properties
Returns:
Received data
Throws:
IOException

getKeyStoreType

public static String getKeyStoreType()

setKeyStoreType

public static void setKeyStoreType(String keyStoreType)

getTrustStoreType

public static String getTrustStoreType()

setTrustStoreType

public static void setTrustStoreType(String trustStoreType)

getKeyManagerType

public static String getKeyManagerType()

settKeyManagerType

public static void settKeyManagerType(String keyManagerType)

getTrustManagerType

public static String getTrustManagerType()

getTrustManagerType

public static void getTrustManagerType(String trustManagerType)

getHttpsURLConnection

public static HttpsURLConnection getHttpsURLConnection()

setProtocol

public static void setProtocol(String protocol)


Copyright © 2015 WSO2. All rights reserved.