Skip to content

Commit

Permalink
Merge pull request #53 from Thisara-Welmilla/change-keystore-extensions
Browse files Browse the repository at this point in the history
Update keystore extension to PKCS12.
  • Loading branch information
Thisara-Welmilla authored Jan 31, 2024
2 parents ddbb29e + 27dc90d commit 39b6970
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
org.wso2.carbon.core.util; version="${carbon.kernel.imp.pkg.version}",
org.wso2.carbon.user.core.*; version="${carbon.kernel.imp.pkg.version}",
org.wso2.carbon.utils.multitenancy; version="${carbon.kernel.imp.pkg.version}",
org.wso2.carbon.utils.*; version="${carbon.kernel.imp.pkg.version}",

org.wso2.carbon.idp.mgt; version="${carbon.identity.framework.imp.pkg.version}",
org.wso2.carbon.identity.core.*; version="${carbon.identity.framework.imp.pkg.version}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.wso2.carbon.idp.mgt.IdentityProviderManagementException;
import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.user.core.service.RealmService;
import org.wso2.carbon.utils.security.KeystoreUtils;

import java.nio.charset.StandardCharsets;
import java.security.Key;
Expand All @@ -58,7 +59,6 @@
public class JWTAuthTokenGenerator implements AuthTokenGenerator {

private static final Log log = LogFactory.getLog(JWTAuthTokenGenerator.class);
private static final String KEY_STORE_EXTENSION = ".jks";
// We are keeping a private key map which will have private key for each tenant domain. We are keeping this as a
// static Map since then we don't need to read the key from keystore every time.
private static Map<Integer, Key> privateKeys = new ConcurrentHashMap<>();
Expand Down Expand Up @@ -187,7 +187,6 @@ private int getTenantId(String tenantDomain) throws AuthAPIServerException {

private String getTenantKeyStoreName(String tenantDomain) {

String ksName = tenantDomain.trim().replace(".", "-");
return ksName + KEY_STORE_EXTENSION;
return KeystoreUtils.getKeyStoreFileLocation(tenantDomain);
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
<osgi.framework.imp.pkg.version>[1.7.0, 2.0.0)</osgi.framework.imp.pkg.version>
<osgi.service.component.imp.pkg.version>[1.2.0, 2.0.0)</osgi.service.component.imp.pkg.version>

<carbon.kernel.version>4.6.0</carbon.kernel.version>
<carbon.kernel.version>4.9.23</carbon.kernel.version>
<carbon.kernel.imp.pkg.version>[4.5.0, 5.0.0)</carbon.kernel.imp.pkg.version>
<carbon.identity.framework.version>5.25.28</carbon.identity.framework.version>
<carbon.identity.framework.imp.pkg.version>[5.20.321, 8.0.0)</carbon.identity.framework.imp.pkg.version>
Expand Down

0 comments on commit 39b6970

Please sign in to comment.