Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update keystore extension to PKCS12. #53

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading