ltm rule command b64encodeΒΆ

iRule(1)					  BIG-IP TMSH Manual					     iRule(1)

b64encode
       Returns a string that is base-64 encoded, or if an error occurs, an empty string.

SYNOPSIS
       b64encode ANY_CHARS

DESCRIPTION
       Returns a string that is base-64 encoded, or if an error occurs, an empty string.

RETURN VALUE
       b64encode 
	   Returns a string that is base-64 encoded, or if an error occurs, an empty string.

VALID DURING
       RULE_INIT

EXAMPLES
	when RULE_INIT {
	    set ::key [AES::key]
	}
	when HTTP_RESPONSE {
	    set decrypted [HTTP::cookie "MyCookie"]
	    HTTP::cookie remove "MyCookie"
	    set encrypted [b64encode [AES::encrypt $::key $decrypted]]
	    HTTP::cookie insert name "MyCookie" value $encrypted
	}
	when HTTP_REQUEST {
	    set encrypted [HTTP::cookie "MyCookie"]
	    HTTP::cookie remove "MyCookie"
	    set decrypted [AES::decrypt $::key [b64decode $encrypted]]
	    HTTP::cookie insert name "MyCookie" value $decrypted
	}

HINTS
SEE ALSO
CHANGE LOG
       @BIGIP-9.0.0 --First introduced the command.  @BIGIP-11.1.0 --First introduced the command.

BIG-IP						      2020-06-23					     iRule(1)