nu.studer.gradle.credentials.domain
Class CredentialsEncryptor

java.lang.Object
  extended by nu.studer.gradle.credentials.domain.CredentialsEncryptor

public final class CredentialsEncryptor
extends java.lang.Object

Encrypts/decrypts credentials through password-based encryption.

See Also:
Encryption

Method Summary
 java.lang.String decrypt(java.lang.String string)
          Decrypts the given string.
 java.lang.String encrypt(java.lang.String string)
          Encrypts the given string.
static CredentialsEncryptor withPassphrase(char[] passphrase)
          Creates a new instance that will use the given passphrase for all encryption/decryption activities.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

encrypt

public java.lang.String encrypt(java.lang.String string)
Encrypts the given string.

Parameters:
string - the string to encrypt
Returns:
the encrypted string

decrypt

public java.lang.String decrypt(java.lang.String string)
Decrypts the given string.

Parameters:
string - the string to decrypt
Returns:
the decrypted string

withPassphrase

public static CredentialsEncryptor withPassphrase(char[] passphrase)
Creates a new instance that will use the given passphrase for all encryption/decryption activities.

Parameters:
passphrase - the passphrase to encrypt/decrypt the credentials with
Returns:
the new instance