亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? listcert.cpp

?? 可列出系統MY CA ROOT USERDS等存儲區的證書
?? CPP
字號:

#define		_WIN32_WINNT	0x0500
#include "stdafx.h"
#include <stdio.h>
#include <windows.h>
#include <Wincrypt.h>
#include <cryptuiapi.h>

#pragma comment(lib,"crypt32.lib")
#define MY_ENCODING_TYPE  (PKCS_7_ASN_ENCODING | X509_ASN_ENCODING)

/*
PCCERT_CONTEXT GetSubjectCert(
HCERTSTORE hCertStore,       // the store to search
LPCTSTR pszSearchName)       // the string to match
{

  //********************************************************************
  // Declare variables.
  PCCERT_CONTEXT   pCertContext = NULL;
  BOOL             fFound = FALSE;
  BOOL             fMore = TRUE;
  DWORD            dwSize = 0;
  LPSTR            pszSubjectName;
  LPSTR            pszNameFound;
  CERT_NAME_BLOB   NameBlob;
  
	//********************************************************************
	//  Enumerate the certificates in the store until a match is found.
	while(fMore && !fFound)
	{     
    if(!(pCertContext = CertEnumCertificatesInStore(
	hCertStore,
	pCertContext)))
    {
	// The end of the store has been reached. Get out of the loop.
	fMore=FALSE;
	break;
	}
	NameBlob = pCertContext->pCertInfo->Issuer;
	// Call CertNameToStr to get dwSize, the length of the 
	// CertNameString
	dwSize = CertNameToStr(
	MY_ENCODING_TYPE,        // Encoding type
	&NameBlob,               // the subject from the pCertInfo
	CERT_SIMPLE_NAME_STR,    // Type of string
	NULL,                    // Place to return string.
	// In the first pass, NULL since 
	// space for the name string has not
	// yet been allocated.
	0);                      // Size of the name string 
	if (dwSize<2)        // If the string length returned is 
	// less than 2, the function could not
	// determine a valid name string length.
	// The function failed. 
	{     
	// The call to the function failed. Get out of the loop.
	printf("Error First pass of getting Name String1");
	fMore = FALSE;
	break;
	}           
	// Allocate memory for the subject name string.
	if(!(pszSubjectName = (LPSTR)malloc(dwSize)))
	{  
	// Memory allocation failed. Get out of the loop.
	printf("Error Allocating Memory");
	fMore = FALSE;
	break;
	}   
	//  Make second call to CertNameToStr to get the string.
	dwSize = CertNameToStr(
	MY_ENCODING_TYPE,       // Encoding type
	&NameBlob,              // CERT_NAME_BLOB
	CERT_SIMPLE_NAME_STR,   // Type
	pszSubjectName,         // Place to return string
	dwSize);                // Size of string (chars)
	if(dwSize<2)
	{  
	// If the length returned is less than 2, 
	// the function failed. Get out of the loop.
	printf("Error in second pass.\n");
	fMore = FALSE;
	break;
	}
	pszNameFound = strstr(pszSubjectName,                   
	pszSearchName);
	if(pszNameFound)
	{
	// The string searched for was matched. Get out of the loop.
	printf("Target Certificate %s Found \n", pszNameFound);
	fFound = TRUE;
	break;
	}  // end while  
	free(pszSubjectName);
	if(!fFound)
	{      
	printf("Target Cert Not Found\n");
	CertFreeCertificateContext(pCertContext);
	return NULL;
	}   
	else
    return (pCertContext);   // return the whole context that included
	// the subject name string.
	}       // end of function
	
*/

void MyHandleError(char *s){
    printf("An error occured in running the program.\n");
    printf("%s\n\n",s);
    printf("Program terminating.\n");
    exit(1);
}

void main(void)
{
	
	//-------------------------------------------------------------------
	// Copyright (c) Microsoft Corporation.  All rights reserved.
	// This program lists all of the certificates in a system certificate
	// store and all of the property identifier numbers of those 
	// certificates. It also demonstrates the use of two
	// UI functions. One, CryptUIDlgSelectCertificateFromStore, 
	// displays the certificates in a store
	// and allows the user to select one of them, 
	// The other, CryptUIDlgViewContext,
	// displays the contents of a single certificate.
	
	//-------------------------------------------------------------------
	// Declare and initialize variables.
	
	HCERTSTORE       hCertStore;        
	PCCERT_CONTEXT   pCertContext=NULL;      
	char pszNameString[256];
	char pszStoreName[256];
	void*            pvData;
	DWORD            cbData;
	DWORD            dwPropId = 0; 
	// Zero must be used on the first
	// call to the function. After that,
	// the last returned property identifier is passed.
	
	//-------------------------------------------------------------------
	//  Begin processing. Get the name of the system certificate store 
	//  to be enumerated. Output here is to stderr so that the program  
	//  can be run from the command line and stdout can be redirected  
	//  to a file.
	
	printf("Please enter the store name:");
	scanf("%s",pszStoreName);
	printf("The store name is %s .\n",pszStoreName);
	
	//-------------------------------------------------------------------
	// Open a system certificate store.
	
	if ( hCertStore = CertOpenSystemStore(
		NULL,
		pszStoreName))
	{
		printf("The %s store has been opened. \n", 
			pszStoreName);
	}
	else
	{
		// If the store was not opened, exit to an error routine.
		MyHandleError("The store was not opened.");
	}
	
	//-------------------------------------------------------------------
	// Use CertEnumCertificatesInStore to get the certificates 
	// from the open store. pCertContext must be reset to
	// NULL to retrieve the first certificate in the store.
	
	// pCertContext = NULL;
	//----------------------------------------	
	while(pCertContext= CertEnumCertificatesInStore(
		hCertStore,
		pCertContext))
	{
		//-------------------------------------------------------------------
		// A certificate was retrieved. Continue.
		//-------------------------------------------------------------------
		//  Display the certificate.
		/*
		if ( CryptUIDlgViewContext(
			CERT_STORE_CERTIFICATE_CONTEXT,
			pCertContext,
			NULL,
			NULL,
			0,
			NULL))
		{
			//     printf("OK\n");
		}
		else
		{
			MyHandleError("UI failed.");
		}
		*/
		getchar();
		if(CertGetNameString(
			pCertContext,
			CERT_NAME_SIMPLE_DISPLAY_TYPE,
			0,
			NULL,
			pszNameString,
			128))
		{
			printf(" %s \n",pszNameString);
		}
		else
			printf("CertGetName failed. \n");
		
		//-------------------------------------------------------------------
		// Loop to find all of the property identifiers for the specified  
		// certificate. The loop continues until 
		// CertEnumCertificateContextProperties returns zero.
	//==============================================================	
		while(dwPropId = CertEnumCertificateContextProperties(
			pCertContext, // The context whose properties are to be 
			dwPropId))    // listed. Number of the last property found.  
			// This must be zero to find the first 
			// property identifier.
		{
			//-------------------------------------------------------------------
			// When the loop is executed, a property identifier has been found.
			// Print the property number.
			
			printf("Property # %d found->", dwPropId);
			
			//-------------------------------------------------------------------
			//  Indicate the kind of property found.
			
			switch(dwPropId)
			{
			case CERT_FRIENDLY_NAME_PROP_ID:
				{
					printf("Friendly name: ");
					break;
				}
			case CERT_SIGNATURE_HASH_PROP_ID:
				{
					printf("Signature hash identifier ");
					break;
				}
			case CERT_KEY_PROV_HANDLE_PROP_ID:
				{
					printf("KEY PROVE HANDLE");
					break;
				}
			case CERT_KEY_PROV_INFO_PROP_ID:
				{
					printf("KEY PROV INFO PROP ID ");
					break;
				}
			case CERT_SHA1_HASH_PROP_ID:
				{
					printf("SHA1 HASH identifier");
					break;
				}
			case CERT_MD5_HASH_PROP_ID:
				{
					printf("md5 hash identifier ");
					break;
				}
			case CERT_KEY_CONTEXT_PROP_ID:
				{
					printf("KEY CONTEXT PROP identifier");
					break;
				}
			case CERT_KEY_SPEC_PROP_ID:
				{
					printf("KEY SPEC PROP identifier");
					break;
				}
			case CERT_ENHKEY_USAGE_PROP_ID:
				{
					printf("ENHKEY USAGE PROP identifier");
					break;
				}
			case CERT_NEXT_UPDATE_LOCATION_PROP_ID:
				{
					printf("NEXT UPDATE LOCATION PROP identifier");
					break;
				}
			case CERT_PVK_FILE_PROP_ID:
				{
					printf("PVK FILE PROP identifier ");
					break;
				}
			case CERT_DESCRIPTION_PROP_ID:
				{
					printf("DESCRIPTION PROP identifier ");
					break;
				}
			case CERT_ACCESS_STATE_PROP_ID:
				{
					printf("ACCESS STATE PROP identifier ");
					break;
				}
			case CERT_SMART_CARD_DATA_PROP_ID:
				{
					printf("SMART_CARD DATA PROP identifier ");
					break;
				}
			case CERT_EFS_PROP_ID:
				{
					printf("EFS PROP identifier ");
					break;
				}
			case CERT_FORTEZZA_DATA_PROP_ID:
				{
					printf("FORTEZZA DATA PROP identifier ");
					break;
				}
			case CERT_ARCHIVED_PROP_ID:
				{
					printf("ARCHIVED PROP identifier ");
					break;
				}
			case CERT_KEY_IDENTIFIER_PROP_ID:
				{
					printf("KEY IDENTIFIER PROP identifier ");
					break;
				}
			case CERT_AUTO_ENROLL_PROP_ID:
				{
					printf("AUTO ENROLL identifier. ");
					break;
				}
			} // End switch
	//==========================================================================		
			//-------------------------------------------------------------------
			// Retrieve information on the property by first getting the size 
			// of the property size. 
			// For details, see CertGetCertificateContextProperty.
	/*	
			if(CertGetCertificateContextProperty(
				pCertContext, 
				dwPropId , 
				NULL, 
				&cbData))
			{
				//  Continue.
			}
			else
			{  
				// If the first call to the function failed,
				// exit to an error routine.
				MyHandleError("Call #1 to GetCertContextProperty failed.");
			}
			//-------------------------------------------------------------------
			// The call succeeded. Use the size to allocate memory 
			// for the property.
			
			if(pvData = (void*)malloc(cbData))
			{
				// Memory is allocated. Continue.
			}
			else
			{
				// If memory allocation failed, exit to an error routine.
				MyHandleError("Memory allocation failed.");
			}
			//----------------------------------------------------------------
			// Allocation succeeded. Retrieve the property data.
			
			if(CertGetCertificateContextProperty(
				pCertContext,
				dwPropId,
				pvData, 
				&cbData))
			{
				// The data has been retrieved. Continue.
			}
			else
			{
				// If error occurred in the second call, 
				// exit to an error routine.
				MyHandleError("Call #2 failed.");
			}
			//---------------------------------------------------------------
			// Show the results.
			
			printf("The Property Content is %d \n", pvData);
			
			//----------------------------------------------------------------
			// Free the certificate context property memory.
		
			free(pvData);
			*/
			printf("\n");
  }  // End inner while
} // End outer while
/*
//-------------------------------------------------------------------
//  Select an new certificate using UI.
if(!(pCertContext = CryptUIDlgSelectCertificateFromStore(
   hCertStore,
   NULL,
   NULL,
   NULL,
   CRYPTUI_SELECT_LOCATION_COLUMN,
   0,
   NULL)))
{
    MyHandleError("Select UI failed." );
}

*/

//-------------------------------------------------------------------
// Clean up.

CertFreeCertificateContext(pCertContext);
CertCloseStore(hCertStore,0);
printf("The function completed successfully. \n");
} // End of main

//-------------------------------------------------------------------
//  This example uses the function MyHandleError, a simple error
//  handling function, to print an error message to  
//  the standard error (stderr) file and exit the program. 
//  For most applications, replace this function with one 
//  that does more extensive error reporting.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品丝袜久久久久久app| 首页欧美精品中文字幕| 日韩理论在线观看| 日韩精品亚洲一区| 国产成人亚洲精品狼色在线| 97久久精品人人澡人人爽| 精品国产污污免费网站入口| 国产精品美日韩| 激情久久五月天| 一本久久精品一区二区| 国产成人综合视频| 国产成人8x视频一区二区| 欧美精品一区二区三区在线 | 日韩丝袜美女视频| 欧美极品美女视频| 日韩午夜在线影院| 国产日产欧美一区二区三区| 欧美一级免费观看| 欧美精品电影在线播放| 久久久亚洲欧洲日产国码αv| 精品制服美女久久| 中文字幕乱码亚洲精品一区| 欧美专区亚洲专区| 老司机免费视频一区二区| 国产精品欧美一级免费| 91性感美女视频| 视频一区视频二区中文字幕| 亚洲一区二区在线观看视频| 国产欧美精品一区aⅴ影院| 久久精品国产999大香线蕉| 在线观看日产精品| 91视频www| 884aa四虎影成人精品一区| 欧美激情一区二区三区四区| 韩国女主播一区| 欧美精品 日韩| 亚洲制服丝袜av| 99riav久久精品riav| 久久影院视频免费| 国产精品综合一区二区| 日韩欧美国产高清| 一区二区三区日韩欧美精品| www.久久久久久久久| 国产成人精品午夜视频免费 | 国产精品小仙女| 欧美人体做爰大胆视频| 18欧美乱大交hd1984| 国产成人精品免费一区二区| 精品日韩欧美一区二区| 免费一级片91| 日韩视频免费观看高清完整版在线观看 | 久久国产精品区| 欧美精品日韩精品| 一区二区理论电影在线观看| 91首页免费视频| 亚洲欧洲美洲综合色网| 99国产麻豆精品| 成人欧美一区二区三区白人| 国产aⅴ精品一区二区三区色成熟| 精品国产乱码久久久久久1区2区| 日韩高清在线电影| 欧美日韩的一区二区| 视频在线观看91| 日韩精品一区二区三区三区免费| 免费高清视频精品| 久久久久国产精品厨房| 成人在线视频一区二区| 国产精品久久二区二区| av电影在线观看完整版一区二区| 中文字幕一区二区在线播放| 91麻豆精东视频| 亚洲一区二区在线免费观看视频| 99麻豆久久久国产精品免费| 亚洲欧洲在线观看av| 在线观看视频一区二区欧美日韩| 亚洲福利国产精品| 欧美成人一区二区三区片免费 | 成人免费视频视频在线观看免费| 国产精品成人一区二区三区夜夜夜| 99久久伊人精品| 亚洲午夜免费电影| 欧美成人乱码一区二区三区| 国产精品18久久久久久久久久久久| 久久一区二区三区国产精品| av亚洲精华国产精华| 亚洲午夜久久久久久久久电影网| 欧美videos大乳护士334| 国产91精品精华液一区二区三区| 亚洲男人电影天堂| 欧美一区二区性放荡片| 国产电影一区在线| 亚洲图片你懂的| 欧美高清视频一二三区 | 欧美三级中文字幕在线观看| 麻豆成人在线观看| 国产精品麻豆视频| 久久综合九色综合久久久精品综合 | 国产日韩欧美制服另类| 国产mv日韩mv欧美| 亚洲精品成人天堂一二三| 色偷偷久久一区二区三区| 成人高清免费在线播放| 亚洲福利国产精品| 成人久久18免费网站麻豆| 日韩和欧美的一区| 欧美亚洲国产怡红院影院| 尤物视频一区二区| 日韩精品中文字幕在线不卡尤物| 成人国产精品视频| 蜜臀av一区二区在线免费观看 | 99久久伊人久久99| 国产综合色视频| 婷婷综合在线观看| 白白色 亚洲乱淫| 天堂蜜桃91精品| 午夜av一区二区三区| 亚洲人成亚洲人成在线观看图片| 国产精品狼人久久影院观看方式| 精品国产网站在线观看| 欧美精品久久一区二区三区| 欧美午夜在线一二页| 91偷拍与自偷拍精品| 国产剧情一区二区| 国产成人精品亚洲777人妖 | 欧美日韩中文国产| 欧美性猛片aaaaaaa做受| 色综合久久久久综合体桃花网| 国产精品亚洲成人| av一区二区三区| 成人短视频下载| 成人一区在线观看| 99久久精品国产导航| 99免费精品视频| 99久久综合国产精品| 欧美午夜电影网| 欧美影院午夜播放| 99久久99久久精品免费观看| av亚洲精华国产精华| 日韩专区中文字幕一区二区| 国产精品久久久久久久蜜臀| 国产亚洲综合av| 久久精品亚洲一区二区三区浴池| 久久99精品一区二区三区三区| 久久久不卡网国产精品二区| 在线观看网站黄不卡| 国产成人激情av| 99视频有精品| 99精品视频一区| 成人高清av在线| 欧日韩精品视频| 91高清视频免费看| 欧美剧在线免费观看网站| 精品免费日韩av| 国产日韩欧美亚洲| 中文字幕中文在线不卡住| 亚洲chinese男男1069| 日韩电影在线观看电影| 五月婷婷综合网| 蜜桃av一区二区三区电影| 国产精品一品二品| 欧美三级日本三级少妇99| 国产欧美一区二区精品秋霞影院| 一区二区三区中文在线| 国产永久精品大片wwwapp| 欧美无砖砖区免费| 中文字幕免费观看一区| 日本不卡一区二区三区| 91性感美女视频| 国产午夜亚洲精品午夜鲁丝片| 亚洲成人午夜电影| 99久久精品情趣| 久久夜色精品国产欧美乱极品| 亚洲国产一区视频| 91亚洲午夜精品久久久久久| 久久一夜天堂av一区二区三区| 亚洲电影中文字幕在线观看| 91在线播放网址| 国产女人aaa级久久久级| 日本成人超碰在线观看| 精品免费视频.| 婷婷综合在线观看| 欧美中文字幕一区二区三区| 亚洲国产精品v| 成人免费视频视频在线观看免费| 免费看欧美美女黄的网站| 久久婷婷久久一区二区三区| 国产真实乱对白精彩久久| 亚洲日本免费电影| 欧美mv日韩mv国产网站app| 日日夜夜精品视频天天综合网| 91久久一区二区| 一区二区三区四区视频精品免费 | 中文字幕在线观看一区| 欧美一区二区三区思思人| 色一情一乱一乱一91av| 91在线视频播放地址| av亚洲精华国产精华精华| 国产一区二区91| 国产尤物一区二区在线| 国产精品影视在线观看|