def validate_fingerprint(ctx, param, value):
    if value is not None:
        fingerprint = value.replace(':', '').strip().upper()
        try:
            if len(fingerprint.decode('hex')) != 20:
                raise ValueError()
        except (TypeError, __HOLE__):
            raise click.BadParameter('Invalid SHA1 fingerprint provided.')
        return fingerprint
dataset/ETHPy150Open mitsuhiko/osx-openconnect-helper/openconnect_helper.py/validate_fingerprint