docs: def crl_managed(name,
                  signing_private_key,
                  signing_private_key_passphrase=None,
                  signing_cert=None,
                  revoked=None,
                  days_valid=100,
                  digest="",
                  days_remaining=30,
                  include_expired=False,
                  **kwargs):
      '''
      Manage a Certificate Revocation List
  
      name
          Path to the certificate
  
      signing_private_key
          The private key that will be used to sign this crl. This is
          usually your CA's private key.
  
      signing_private_key_passphrase
          Passphrase to decrypt the private key.
  
      signing_cert
          The certificate of the authority that will be used to sign this crl.
          This is usually your CA's certificate.
  
      revoked
          A list of certificates to revoke. Must include either a serial number or a
          the certificate itself. Can optionally include the revocation date and
          notAfter date from the certificate. See example below for details.
  
      days_valid : 100
          The number of days the certificate should be valid for.
  
      digest
          The digest to use for signing the CRL. This has no effect on versions
          of pyOpenSSL less than 0.14.
  
      days_remaining : 30
          The crl should be automatically recreated if there are less than
          ``days_remaining`` days until the crl expires. Set to 0 to disable
          automatic renewal.
  
      include_expired : False
          If ``True``, include expired certificates in the CRL.
  
      kwargs
          Any arguments supported by :py:func:`file.managed <salt.states.file.managed>` are supported.
  
      Example:
  
      .. code-block:: yaml
  
          /etc/pki/ca.crl:
            x509.crl_managed:
              - signing_private_key: /etc/pki/myca.key
              - signing_cert: /etc/pki/myca.crt
              - revoked:
                - compromized_Web_key:
                  - certificate: /etc/pki/certs/badweb.crt
                  - revocation_date: 2015-03-01 00:00:00
                  - reason: keyCompromise
                - terminated_vpn_user:
                  - serial_number: D6:D2:DC:D8:4D:5C:C0:F4
                  - not_after: 2016-01-01 00:00:00
                  - revocation_date: 2015-02-25 00:00:00
                  - reason: cessationOfOperation
      '''
      if revoked is None:
          revoked = []
  
      revoked = _revoked_to_list(revoked)
  
      current_days_remaining = 0
      current_comp = {}
  
      if os.path.isfile(name):
          try:
              current = __salt__['x509.read_crl'](crl=name)
              current_comp = current.copy()
              current_comp.pop('Last Update')
              current_notafter = current_comp.pop('Next Update')
              current_days_remaining = (
                  datetime.datetime.strptime(current_notafter, '%Y-%m-%d %H:%M:%S') -
                  datetime.datetime.now()).days
              if days_remaining == 0:
                  days_remaining = current_days_remaining - 1
          except salt.exceptions.SaltInvocationError:
              current = '{0} is not a valid CRL.'.format(name)
      else:
          current = '{0} does not exist.'.format(name)
  
      new_crl = __salt__['x509.create_crl'](text=True, signing_private_key=signing_private_key,
                                            signing_private_key_passphrase=signing_private_key_passphrase,
                                            signing_cert=signing_cert, revoked=revoked, days_valid=days_valid,
                                            digest=digest, include_expired=include_expired)
  
      new = __salt__['x509.read_crl'](crl=new_crl)
      new_comp = new.copy()
      new_comp.pop('Last Update')
      new_comp.pop('Next Update')
  
      file_args, kwargs = _get_file_args(name, **kwargs)
      new_crl_created = False
      if (current_comp == new_comp and
              current_days_remaining > days_remaining and
              __salt__['x509.verify_crl'](name, signing_cert)):
          file_args['contents'] = __salt__[
              'x509.get_pem_entry'](name, pem_type='X509 CRL')
      else:
          new_crl_created = True
          file_args['contents'] = new_crl
  
      ret = __states__['file.managed'](**file_args)
      if new_crl_created:
          ret['changes'] = {'Old': current, 'New': __salt__[
              'x509.read_crl'](crl=new_crl)}
      return ret