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
-
Method Summary
Modifier and TypeMethodDescriptiondecodePublicKey
(String encryptedPublicKey) decodes an base64-encoded public keycom.ibm.websphere.ltpa.PublicKey
decryptPrivateKey
(String encryptedKey, String password) decrypt the private key (com.ibm.websphere.ltpa.PrivateKey
) that is used to sign an LTPA2 tokendecryptSharedKey
(String encryptedKey, 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
@NonNull public 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
@NonNull public 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