Skip to content

Instantly share code, notes, and snippets.

@ilgrosso
Created August 30, 2013 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilgrosso/6389336 to your computer and use it in GitHub Desktop.
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
// 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()
@ilgrosso
Copy link
Author

GuardedString is packed into connid-framework JAR, declared as Maven dependency:

<dependency>
  <groupId>org.connid</groupId>
  <artifactId>connid-framework</artifactId>
  <version>1.3.3</version>
</dependency>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment