How to store the password in encrypted format in preferences component in MPS

In other settings i have an plugin which has username and password field .How to stored this in encrypted form????

1 comment
Comment actions Permalink
Official comment

There is build in mechanism in Idea platform.
You can read about it here:

You can access this classes with java stubs from solution MPS.IDEA, model com.intellij.credentialStore@java_stub.

There is com.intellij.ide.passwordSafe.PasswordSafe class with methods:
com.intellij.credentialStore.CredentialStore#get(@NotNull CredentialAttributes attributes)
com.intellij.credentialStore.CredentialStore#set(@NotNull CredentialAttributes attributes, @Nullable Credentials credentials)

Where CredentialAttributes contains your service name, user name, and class, while Credentials contains username and password.

Please sign in to leave a comment.