我正在从事需要在 WebShpere 和 PHP 网络应用程序之间实现 SSO 的项目。
然而,在我查看了实现 SSO 的可能方法之后,我找到了用于在不同 IBM 技术之间实现 SSO 的 LTPA token 。
但是 LTPA token 2 是加密的 cookie 文件。如果我想使用此文件中的信息,例如(用户 ID、用户名、电子邮件...等),我应该解密它。
我对 LTPA token 2 进行了深入搜索,以下是我从 IBM 找到的最佳定义。
LTPA2 signatures are generated using SHA-1 as the hash algorithm, and RSA (1024-bit key) as the encryption algorithm. After the digital signature has been attached, the user data and signature are encrypted with a 3DES or AES key obtained from the LTPA key file (refer to “Consuming LTPA tokens” and “Generating LTPA tokens”).
但我仍在尝试解密此 token ,但运气不佳。
有什么帮助吗?
最佳答案
Alfresco 项目做到了这一点。看看这个blog post用于指针,包括工作代码。
澄清一下,LTPA token 的内容是或多或少类似于“uid=user,cn=users,ou=myorg,dc=com@ldaprealm%timeout%[RSA signature]”的字符串,使用共享 AES key 并使用 Base64 编码。 LTPA v2 将不使用 3DES,而只使用 AES。所以你真正需要做的是用 AES 解密 cookie,你已经可以读取用户名了。您不必验证 RSA 签名。
关于java - 如何解密 LTPA token 版本 2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18428016/