def string_to_sign(data):
    """ Build a signed SNS string from a dict """
    strings = []
    for key in ('Message', 'MessageId', 'Subject', 'SubscribeURL', 'Timestamp',
                'Token', 'TopicArn', 'Type'):
        if key in data:
            strings += [key, data[key]]
    strings.append("")
    return '\n'.join(strings).encode('utf8')