private boolean isEncryptedString(String str) { if (str == null) { return false; } return cipher.isEncryptedString(str); }
private boolean isEncryptedString(String str) { if (str == null) { return false; } return cipher.isEncryptedString(str); }
private boolean isEncryptedString(String str) { if (str == null) { return false; } return cipher.isEncryptedString(str); }
private boolean isEncryptedString( String str ) { if( str == null ) return false; return _cipher.isEncryptedString( str ); } //----------------------------------------------------------------------------
private boolean isEncryptedString( String str ) { return cipher.isEncryptedString( str ); }
public String encrypt( String password, String encoding ) throws PlexusCipherException { // check if the password is encrypted if ( plexusCipher.isEncryptedString( password ) ) { return password; } if ( password != null ) { return plexusCipher.encryptAndDecorate( password, encoding ); } return null; }
public String decrypt( String encodedPassword, String encoding ) throws PlexusCipherException { // check if the password is encrypted if ( !plexusCipher.isEncryptedString( encodedPassword ) ) { return encodedPassword; } if ( encodedPassword != null ) { return plexusCipher.decryptDecorated( encodedPassword, encoding ); } return null; } }
public String decrypt( String encodedPassword, String encoding ) throws PlexusCipherException { // check if the password is encrypted if ( !plexusCipher.isEncryptedString( encodedPassword ) ) { return encodedPassword; } if ( encodedPassword != null ) { return plexusCipher.decryptDecorated( encodedPassword, encoding ); } return null; } }
/** * Gets a {@link PasswordProcessor} instance for the given password. * * @param password The password to handle. * @return A processor for the given password. */ public static PasswordProcessor getInstance(String password) { PlexusCipher cipher = buildCipher(); if ( cipher == null || !cipher.isEncryptedString( password ) ) { return new DefaultPasswordProcessor( password ); } else { return new DecryptionProcessor( password, cipher ); } }