Search in sources :

Example 1 with OneTimeString

use of com.intellij.credentialStore.OneTimeString in project intellij-community by JetBrains.

the class BasePasswordSafeProvider method get.

@Nullable
public Credentials get(@NotNull CredentialAttributes attributes) {
    byte[] masterKey = key();
    byte[] encryptedPassword = getEncryptedPassword(EncryptionUtil.encryptKey(masterKey, EncryptionUtil.rawKey(attributes)));
    OneTimeString password = encryptedPassword == null ? null : EncryptionUtil.decryptText(masterKey, encryptedPassword);
    return password == null ? null : new Credentials(attributes.getUserName(), password);
}
Also used : OneTimeString(com.intellij.credentialStore.OneTimeString) Credentials(com.intellij.credentialStore.Credentials) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

Credentials (com.intellij.credentialStore.Credentials)1 OneTimeString (com.intellij.credentialStore.OneTimeString)1 Nullable (org.jetbrains.annotations.Nullable)1