private static Object transformAttributeValueIfNecessary(final Object attributeValue) {
        if (getBinaryAttributeValuePredicate().test(attributeValue)) {
            return EncodingUtils.encodeBase64((byte[]) attributeValue);
        }
        return attributeValue;
    }
The default implementation of the attribute
encoder that will use a per-service key-pair
to encrypt the credential password and PGT
when available. All other attributes remain in
place.

@author Misagh Moayyed
@since 4.1
core/cas-server-core-services-authentication/src/main/java/org/apereo/cas/authentication/support/DefaultCasProtocolAttributeEncoder.java