public class KeyStoreManager extends Object
Modifier and Type | Method and Description |
---|---|
X509Certificate |
getDefaultPrimaryCertificate()
This method is used to load the default public certificate of the primary key store
|
PrivateKey |
getDefaultPrivateKey()
Get the default private key, only allowed for tenant 0
|
PublicKey |
getDefaultPublicKey()
Get default pub.
|
static KeyStoreManager |
getInstance(int tenantId)
Get a KeyStoreManager instance for that tenant.
|
static KeyStoreManager |
getInstance(int tenantId,
org.wso2.carbon.base.api.ServerConfigurationService serverConfigService,
org.wso2.carbon.registry.core.service.RegistryService registryService) |
KeyStore |
getKeyStore(String keyStoreName)
Get the key store object for the given key store name
|
String |
getKeyStorePassword(String keyStoreName)
Get the key store password for the given key store name.
|
String |
getPassword(org.wso2.carbon.registry.core.Resource resource)
Get the key store password of the given key store resource
|
KeyStore |
getPrimaryKeyStore()
Load the primary key store, this is allowed only for the super tenant
|
String |
getPrimaryPrivateKeyPasssword()
Get the private key password
|
Key |
getPrivateKey(String keyStoreName,
String alias)
This method loads the private key of a given key store
|
KeyStore |
getRegistryKeyStore()
Deprecated.
use
getPrimaryKeyStore() instead. |
org.wso2.carbon.registry.core.service.RegistryService |
getRegistryService() |
org.wso2.carbon.base.api.ServerConfigurationService |
getServerConfigService() |
KeyStore |
loadKeyStoreFromFileSystem(String keyStorePath,
String password,
String type) |
void |
updateKeyStore(String name,
KeyStore keyStore)
Update the key store with the given name using the modified key store object provided.
|
public org.wso2.carbon.base.api.ServerConfigurationService getServerConfigService()
public org.wso2.carbon.registry.core.service.RegistryService getRegistryService()
public static KeyStoreManager getInstance(int tenantId)
tenantId
- id of the corresponding tenantpublic static KeyStoreManager getInstance(int tenantId, org.wso2.carbon.base.api.ServerConfigurationService serverConfigService, org.wso2.carbon.registry.core.service.RegistryService registryService)
public KeyStore getKeyStore(String keyStoreName) throws Exception
keyStoreName
- key store nameException
- If there is not a key store with the given namepublic Key getPrivateKey(String keyStoreName, String alias)
keyStoreName
- name of the key storealias
- alias of the private keypublic String getPassword(org.wso2.carbon.registry.core.Resource resource) throws Exception
resource
- key store resourceException
- Error when reading the registry resource of decrypting the passwordpublic String getKeyStorePassword(String keyStoreName) throws Exception
keyStoreName
- key store nameException
- If there is not a key store with the given namepublic void updateKeyStore(String name, KeyStore keyStore) throws Exception
name
- key store namekeyStore
- modified key store objectException
- Registry exception or Security Exceptionpublic KeyStore getPrimaryKeyStore() throws Exception
Exception
- Carbon Exception when trying to call this method from a tenant other
than tenant 0@Deprecated public KeyStore getRegistryKeyStore() throws Exception
getPrimaryKeyStore()
instead.Exception
- Carbon Exception when trying to call this method from a tenant other
than tenant 0public PrivateKey getDefaultPrivateKey() throws Exception
Exception
- Carbon Exception for tenants other than tenant 0public PublicKey getDefaultPublicKey() throws Exception
Exception
- Exception Carbon Exception for tenants other than tenant 0public String getPrimaryPrivateKeyPasssword() throws org.wso2.carbon.CarbonException
org.wso2.carbon.CarbonException
- Exception Carbon Exception for tenants other than tenant 0public X509Certificate getDefaultPrimaryCertificate() throws Exception
Exception
- Permission denied for accessing primary key storeCopyright © 2016 WSO2 Inc. All rights reserved.