LTPA Key 解码器,用于和 IBM 产品做 SSO 集成
示例:String tokenCipher = "1eDYcavQCLHppG9P6MHRADcy/igN1W+NbsPULYoFvtlbxET8FrOmSMcDuv+sG8ko6aRvT+jB0QA3Mv4oDdVvjW7D1C2KBb7Zjn32Ii/2xM36H49UdvWDMJ0WaoW9EjKlhAq6FH+a4P98Ia/epi1OI8xx294AOriuHlxethzEvQQTZCfEGFr4ntywXWx8D1ZVXTPfd7sxNiryYvJ1bCgmuou2ouyY1voUH6rim4w+FWdCF+5YPEazAP788ubY3qVHzOxi2zFcOsBqhiK8wsyc9Pr4GFLrZ2YfNCsMxDDGF2/rgnIZDoTQaye4AUUiNG0BoMyL6mNrmtf3PZHOBvB3SGLUTSghFlP0";
String ltpa3DESKey = "yqaM5KH6fQhPRjuwFTlVWoJrHdYXOHNHp7ji+BJPSDM=";
String ltpaPassword = "password";
try {
LtpaDecoder t = new LtpaDecoder(tokenCipher, ltpa3DESKey, ltpaPassword);
System.out.println("UserInfo: " + t.getUserInfo());
System.out.println("Username: " + t.getUsername());
System.out.println("Expiry: " + t.getExpiryDate());
System.out.println("Signature: " + t.getSignature());
System.out.println("Full token: " + t.getFullToken());
catch (Exception e) {
e.printStackTrace();
}
}
The shared 3DES key is itself encrypted using the SHA hash value of the LTPA password (padded with 0x0 upto 24 bytes).
| Constructor and description |
|---|
LtpaDecoder
(String ltpa3DESKey, String ltpaPassword) |
LtpaDecoder
(String token, String ltpa3DESKey, String ltpaPassword) |
| Type | Name and description |
|---|---|
LtpaDecoder |
decode(String token) |
Date |
getExpiryDate() |
String |
getFullToken() |
String |
getSignature() |
String |
getUserInfo() |
String |
getUsername() |
boolean |
isExpired() |
static void |
main(String[] args) |
| Methods inherited from class | Name |
|---|---|
class Object |
Object#wait(long, int), Object#wait(long), Object#wait(), Object#equals(Object), Object#toString(), Object#hashCode(), Object#getClass(), Object#notify(), Object#notifyAll() |
BROPEN Documentation, 2020-04-21 10:53