crypto-lib/src/main/java/com/streamsets/pipeline/stage/processor/crypto/FieldEncrypter.java
public byte[] prepareEncrypt(Field field, Map<String, String> context) {
    context.put(SDC_FIELD_TYPE, field.getType().name());

    if (field.getType() == Field.Type.BYTE_ARRAY) {
      return field.getValueAsByteArray();
    } else {
      // Treat all other data as strings
      return field.getValueAsString().getBytes(Charsets.UTF_8);
    }
  }
public byte[] prepareEncrypt(Field field, Map<String, String> context) {
    context.put(SDC_FIELD_TYPE, field.getType().name());

    if (field.getType() == Field.Type.BYTE_ARRAY) {
      return field.getValueAsByteArray();
    } else {
      // Treat all other data as strings
      return field.getValueAsString().getBytes(Charsets.UTF_8);
    }
  }
public byte [ ] prepareEncrypt ( Field field , Map < String , String > context ) { context . put ( SDC_FIELD_TYPE , field . getType ( ) . name ( ) ) ; if ( field . getType ( ) == Field . Type . BYTE_ARRAY ) { return field . getValueAsByteArray ( ) ; } else { // Treat all other data as strings return field . getValueAsString ( ) . getBytes ( Charsets . UTF_8 ) ; } }
Does data type conversions in preparation for encryption.

@param field {@link Field} to encrypt
@param context (AAD)
@return byte array to encrypt
Does data type conversions in preparation for encryption .