def get_certs(context=_DEFAULT_CONTEXT, store=_DEFAULT_STORE):
 ret = dict()
 cmd = list()
 blacklist_keys = ['DnsNameList']
 store_path = 'Cert:\\{0}\\{1}'.format(context, store)
 _validate_cert_path(name=store_path)
 cmd.append("Get-ChildItem -Path '{0}' | Select-Object".format(store_path))
 cmd.append(' DnsNameList, SerialNumber, Subject, Thumbprint, Version')
 items = _cmd_run(cmd=str().join(cmd), as_json=True)
 for item in items:
  cert_info = dict()
  for key in item:
   if (key not in blacklist_keys):
    cert_info[key.lower()] = item[key]
  cert_info['dnsnames'] = [name['Unicode'] for name in item['DnsNameList']]
  ret[item['Thumbprint']] = cert_info
 return ret

def get_certs ( context = _DEFAULT_CONTEXT , store = _DEFAULT_STORE ) : ret = dict ( ) cmd = list ( ) blacklist_keys = [ 'DnsNameList' ] store_path = 'Cert:\\{0}\\{1}' . format ( context , store ) _validate_cert_path ( name = store_path ) cmd . append ( "Get-ChildItem -Path '{0}' | Select-Object" . format ( store_path ) ) cmd . append ( ' DnsNameList, SerialNumber, Subject, Thumbprint, Version' ) items = _cmd_run ( cmd = str ( ) . join ( cmd ) , as_json = True ) for item in items : cert_info = dict ( ) for key in item : if ( key not in blacklist_keys ) : cert_info [ key . lower ( ) ] = item [ key ] cert_info [ 'dnsnames' ] = [ name [ 'Unicode' ] for name in item [ 'DnsNameList' ] ] ret [ item [ 'Thumbprint' ] ] = cert_info return ret
get the available certificates in the given store .