def remove_cert(name, thumbprint, context=_DEFAULT_CONTEXT, store=_DEFAULT_STORE):
 ret = {'name': name, 'changes': dict(), 'comment': str(), 'result': None}
 store_path = 'Cert:\\{0}\\{1}'.format(context, store)
 current_certs = __salt__['win_pki.get_certs'](context=context, store=store)
 if (thumbprint not in current_certs):
  ret['comment'] = "Certificate '{0}' already removed from store: {1}".format(thumbprint, store_path)
  ret['result'] = True
 elif __opts__['test']:
  ret['comment'] = "Certificate '{0}' will be removed from store: {1}".format(thumbprint, store_path)
  ret['changes'] = {'old': thumbprint, 'new': None}
 else:
  ret['changes'] = {'old': thumbprint, 'new': None}
  ret['result'] = __salt__['win_pki.remove_cert'](thumbprint=thumbprint, context=context, store=store)
  if ret['result']:
   ret['comment'] = "Certificate '{0}' removed from store: {1}".format(thumbprint, store_path)
  else:
   ret['comment'] = "Certificate '{0}' unable to be removed from store: {1}".format(thumbprint, store_path)
 return ret

def remove_cert ( name , thumbprint , context = _DEFAULT_CONTEXT , store = _DEFAULT_STORE ) : ret = { 'name' : name , 'changes' : dict ( ) , 'comment' : str ( ) , 'result' : None } store_path = 'Cert:\\{0}\\{1}' . format ( context , store ) current_certs = __salt__ [ 'win_pki.get_certs' ] ( context = context , store = store ) if ( thumbprint not in current_certs ) : ret [ 'comment' ] = "Certificate '{0}' already removed from store: {1}" . format ( thumbprint , store_path ) ret [ 'result' ] = True elif __opts__ [ 'test' ] : ret [ 'comment' ] = "Certificate '{0}' will be removed from store: {1}" . format ( thumbprint , store_path ) ret [ 'changes' ] = { 'old' : thumbprint , 'new' : None } else : ret [ 'changes' ] = { 'old' : thumbprint , 'new' : None } ret [ 'result' ] = __salt__ [ 'win_pki.remove_cert' ] ( thumbprint = thumbprint , context = context , store = store ) if ret [ 'result' ] : ret [ 'comment' ] = "Certificate '{0}' removed from store: {1}" . format ( thumbprint , store_path ) else : ret [ 'comment' ] = "Certificate '{0}' unable to be removed from store: {1}" . format ( thumbprint , store_path ) return ret
remove the certificate from the given certificate store .