Class LtpaKeyUtils
java.lang.Object
de.sephirothj.spring.security.ltpa2.LtpaKeyUtils
Utility class for working with encoded and/or encrpyted keys exported from IBM WebSphere Application Server and Liberty Profile
- Author:
- Sephiroth
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NonNull PublicKeydecodePublicKey(@NonNull String encryptedPublicKey) decodes an base64-encoded public keycom.ibm.websphere.ltpa.PublicKey@NonNull PrivateKeydecryptPrivateKey(@NonNull String encryptedKey, @NonNull String password) decrypt the private key (com.ibm.websphere.ltpa.PrivateKey) that is used to sign an LTPA2 token@NonNull SecretKeydecryptSharedKey(@NonNull String encryptedKey, @NonNull String password) decrypts the shared secret key (com.ibm.websphere.ltpa.3DESKey) that is used to encrypt a serialized LTPA2 token
-
Constructor Details
-
LtpaKeyUtils
public LtpaKeyUtils()
-
-
Method Details
-
decodePublicKey
public @NonNull PublicKey decodePublicKey(@NonNull String encryptedPublicKey) throws GeneralSecurityException decodes an base64-encoded public keycom.ibm.websphere.ltpa.PublicKey- Parameters:
encryptedPublicKey- the base64-encoded public key which corresponds to the private key that is used to sign an LTPA2 token- Returns:
- the decoded public key
- Throws:
GeneralSecurityException- if anything went wrong
-
decryptPrivateKey
public @NonNull PrivateKey decryptPrivateKey(@NonNull String encryptedKey, @NonNull String password) throws GeneralSecurityException decrypt the private key (com.ibm.websphere.ltpa.PrivateKey) that is used to sign an LTPA2 token- Parameters:
encryptedKey- the base64-encoded and with 3DES encrypted keypassword- the password for decryption- Returns:
- the decrypted key
- Throws:
GeneralSecurityException- if anything went wrong