#!/usr/bin/env python3
# ==============================================================================
# Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""cfn-ca-uninstall — uninstall any override CAs we previously installed.

Reads the install marker at C:\\cfn\\state\\ca-install-marker.json (Windows)
and removes each recorded thumbprint from the Windows trust store via
certutil -delstore, then removes the marker file. Idempotent: no-op when
the marker is absent. On POSIX the marker is not used so this is a no-op.
"""
import sys
import logging
from cfnbootstrap import _ca_uninstall


def main(argv):
    logging.basicConfig(level=logging.INFO)
    return _ca_uninstall.main(argv)


if __name__ == "__main__":
    sys.exit(main(sys.argv[1:]))
