public class KeyStoreAdmin extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
SERVER_TRUSTSTORE_FILE |
static String |
SERVER_TRUSTSTORE_PASSWORD |
static String |
SERVER_TRUSTSTORE_TYPE |
| Constructor and Description |
|---|
KeyStoreAdmin(int tenantId,
org.wso2.carbon.registry.core.Registry registry) |
| Modifier and Type | Method and Description |
|---|---|
void |
addKeyStore(byte[] content,
String filename,
String password,
String provider,
String type,
String pvtkeyPass) |
void |
addKeyStore(String fileData,
String filename,
String password,
String provider,
String type,
String pvtkeyPass) |
void |
addKeyStoreWithFilePath(String filePath,
String filename,
String password,
String provider,
String type,
String pvtkeyPass) |
void |
addTrustStore(byte[] content,
String filename,
String password,
String provider,
String type) |
void |
addTrustStore(String fileData,
String filename,
String password,
String provider,
String type) |
void |
deleteStore(String keyStoreName) |
X509Certificate |
extractCertificate(String certData)
Extract the encoded certificate into
X509Certificate. |
KeyStore |
getKeyStore(String keyStoreName)
Retrieves the
KeyStore object of the given keystore name. |
KeyStoreData |
getKeystoreInfo(String keyStoreName)
This method will list 1.
|
KeyStoreData[] |
getKeyStores(boolean isSuperTenant)
Method to retrive keystore data.
|
PaginatedKeyStoreData |
getPaginatedKeystoreInfo(String keyStoreName,
int pageNumber)
This method will list 1.
|
Key |
getPrivateKey(String alias,
boolean isSuperTenant) |
String[] |
getStoreEntries(String keyStoreName) |
KeyStore |
getTrustStore()
Load the default trust store (allowed only for super tenant).
|
String |
importCertToStore(String certData,
String keyStoreName) |
void |
importCertToStore(String fileName,
String certData,
String keyStoreName) |
boolean |
isIncludeCert() |
void |
removeCertFromStore(String alias,
String keyStoreName) |
void |
setIncludeCert(boolean includeCert) |
public static final String SERVER_TRUSTSTORE_FILE
public static final String SERVER_TRUSTSTORE_PASSWORD
public static final String SERVER_TRUSTSTORE_TYPE
public KeyStoreAdmin(int tenantId,
org.wso2.carbon.registry.core.Registry registry)
public boolean isIncludeCert()
public void setIncludeCert(boolean includeCert)
public KeyStoreData[] getKeyStores(boolean isSuperTenant) throws SecurityConfigException
isSuperTenant - - Indication whether the querying super tennat dataSecurityConfigExceptionpublic void addKeyStoreWithFilePath(String filePath, String filename, String password, String provider, String type, String pvtkeyPass) throws SecurityConfigException
SecurityConfigExceptionpublic void addKeyStore(String fileData, String filename, String password, String provider, String type, String pvtkeyPass) throws SecurityConfigException
SecurityConfigExceptionpublic void addKeyStore(byte[] content,
String filename,
String password,
String provider,
String type,
String pvtkeyPass)
throws SecurityConfigException
SecurityConfigExceptionpublic void addTrustStore(String fileData, String filename, String password, String provider, String type) throws SecurityConfigException
SecurityConfigExceptionpublic void addTrustStore(byte[] content,
String filename,
String password,
String provider,
String type)
throws SecurityConfigException
SecurityConfigExceptionpublic void deleteStore(String keyStoreName) throws SecurityConfigException
SecurityConfigExceptionpublic void importCertToStore(String fileName, String certData, String keyStoreName) throws SecurityConfigException
SecurityConfigExceptionpublic String importCertToStore(String certData, String keyStoreName) throws SecurityConfigException
SecurityConfigExceptionpublic void removeCertFromStore(String alias, String keyStoreName) throws SecurityConfigException
SecurityConfigExceptionpublic String[] getStoreEntries(String keyStoreName) throws SecurityConfigException
SecurityConfigExceptionpublic KeyStoreData getKeystoreInfo(String keyStoreName) throws SecurityConfigException
keyStoreName - The name of the keystoreSecurityConfigException - will be thrownpublic Key getPrivateKey(String alias, boolean isSuperTenant) throws SecurityConfigException
SecurityConfigExceptionpublic PaginatedKeyStoreData getPaginatedKeystoreInfo(String keyStoreName, int pageNumber) throws SecurityConfigException
keyStoreName - The name of the keystorepageNumber - page numberSecurityConfigException - will be thrownpublic KeyStore getTrustStore() throws SecurityConfigException
SecurityConfigException - if retrieving the truststore fails.public KeyStore getKeyStore(String keyStoreName) throws Exception
KeyStore object of the given keystore name.public X509Certificate extractCertificate(String certData) throws SecurityConfigException
X509Certificate.certData - encoded certificate.X509Certificate object.SecurityConfigException - if extracting the certificate fails.Copyright © 2020 WSO2. All rights reserved.