private String encode(PrintStream stderr, String plaintext, String encodingType,
                          Map<String, String> properties) throws InvalidPasswordEncodingException, UnsupportedCryptoAlgorithmException {
        String ret = null;
        try {
            ret = PasswordUtil.encode(plaintext, encodingType == null ? PasswordUtil.getDefaultEncoding() : encodingType, properties);
        } catch (InvalidPasswordEncodingException e) {
            e.printStackTrace(stderr);
            throw e;
        } catch (UnsupportedCryptoAlgorithmException e) {
            e.printStackTrace(stderr);
            throw e;
        }
        return ret;
    }
private String encode ( PrintStream stderr , String plaintext , String encodingType , Map < String , String > properties ) throws InvalidPasswordEncodingException , UnsupportedCryptoAlgorithmException { String ret = null ; try { ret = PasswordUtil . encode ( plaintext , encodingType == null ? PasswordUtil . getDefaultEncoding ( ) : encodingType , properties ) ; } catch ( InvalidPasswordEncodingException e ) { e . printStackTrace ( stderr ) ; throw e ; } catch ( UnsupportedCryptoAlgorithmException e ) { e . printStackTrace ( stderr ) ; throw e ; } return ret ; }
Handle encoding of the plaintext provided. Capture any
Exceptions and print the stack trace.

@param plaintext
@param encodingType
@param encodingKey
@return ciphertext
@throws InvalidPasswordEncodingException
@throws UnsupportedCryptoAlgorithmException