Created
August 30, 2013 12:26
-
-
Save ilgrosso/6389336 to your computer and use it in GitHub Desktop.
Briefly shows how to get the actual clear-text password out of a ConnId's GuardedString
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// encrypted password is in encPwd | |
GuardedString encPwd = ...; | |
final StringBuilder clearPwd = new StringBuilder(); | |
encPwd.access(new GuardedString.Accessor() { | |
@Override | |
public void access(final char[] clearChars) { | |
clearPwd.append(clearChars); | |
} | |
}); | |
// clear-text password is now in clearPwd.toString() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GuardedString is packed into connid-framework JAR, declared as Maven dependency: