91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 704KB
    文件類型: .rar
    金幣: 2
    下載: 1 次
    發布日期: 2021-05-09
  • 語言: C/C++
  • 標簽: x.509??x509??

資源簡介

純屬上級考驗,自己下的asn代碼查看器,網上找的標準, 和x509證書編碼規則

資源截圖

代碼片段和文件信息

#include?“stdio.h“
#include?“iostream.h“
#include?“string“
#include?“math.h“
using?namespace?std;
enum?classification
{
universal
application
context_specific
privateclass
};
enum?constructed
{
????simplecon
????constructed
};
//程序中未使用
enum?type
{
???boolean=1?//[有兩個值:false或true]
???interger?//[整型值]
???BitString?//[0位或多位]
???OctetString//[0字節或多字節]
???null?
???ObejectIdentifier?//[相應于一個對象的獨特標識數字]
???objectDescriptor?//[一個對象的簡稱]
???External//?[ASN.1沒有定義的數據類型]
???Real//[實數值]
???Enumerated//[數值列表,這些數據每個都有獨特的標識符,作為ASN.1定義數據類型的一部分]
???UTF8String
???Relative_oid
???Sequence//[有序數列,SEQUENCE里面的每個數值都可以是不同類型的,而SEQUENCE?OF里是0個或多個類型相同的數據]
???Set??//?[無序數列,SET里面的每個數值都可以是不同類型的,而SET?OF里是0個或多個類型相同的數據]
???NumericString//[0-9以及空格]
???PrintableString//[A-Z、a-z、0-9、空格以及符號‘()+-./:=?]
???TeletexString//T61String
???VideotexString
???IA5String
???UTCTime?//[統一全球時間格式]
???GeneralizedTime
???GraphicString
???VisibleString?//ISO646String
???GeneralString
???UniversalString
???CharaterString
???BMPString
???reserved?
???version
???issuerUniqueID
???subjectUniqueID
???external
};???????????????????



int?gettype(FILE*?cfile?)
{
//取byte第87位數值判斷?classification
unsigned?char?byte?=fgetc(cfile);
int?theclass=0thetype=0;
?theclass=byte>>6;
?thetype=(byte&31);
if(context_specific==theclass)
{
??return?32+thetype;
}
else
{
??return?thetype;
}
}
bool?IsMulti(unsigned?char?byte)
{
return?(bool)(byte>>7);
}
int?getSignlength(unsigned?char?byte)
{
return?byte&127;
}
int?ConvertByteToNum(unsigned?char*?pByteint?len)
{
int?i=0?tmp?result=0;???????????
for(i=0;i {???????????????????????????
tmp=pByte[len-i-1]*pow(256i);
result+=tmp;
}???
return?result;?????????
}
int?getLength(FILE*?cfile)
{
unsigned?char?byte?=fgetc(cfile);
int?len=getSignlength(byte);
if(IsMulti(byte))
{
???unsigned?char*?pByte=new?unsigned?char[len];
fread(pByte1lencfile);
len=ConvertByteToNum(pBytelen);
delete?pByte;
return?len;
}
else
????{
???? return?len;
}
}

void?getTypeandLen(FILE*?cfileint&?thetypeint&?len)
{
thetype=gettype(cfile);
????len=getLength(cfile);
}

void?getversion(int?ver)
{
if(0x00==ver)
{cout<<“證書版本為:v1“< else?if(0x01==ver)
{cout<<“證書版本為:v2“< else?if(0x02==ver)
{cout<<“證書版本為:v3“<}

#define?MAX_LEN?10000
#define?MAX_PATH?256
void?main()
{
FILE*?cfile;
????char?strpath[MAX_PATH];
cin>>strpath;
????cfile=fopen(strpath“rb+“);
????if(cfile==NULL)
????{
???? cout<<“open?cert?fail“< return;
}

int?thetype=0tmpint=-1len=0;
int?namelen=0;
?????unsigned?char*?pByte=NULL;
//獲取證書長度字節?
getTypeandLen(cfilethetypelen);
cout<<“證書長度為:“< //獲取證書主體長度字節?
????getTypeandLen(cfilethetypelen);
cout<<“證書主體長度為:“< //獲取版本號?
????getTypeandLen(cfilethetypelen);
????if(32==thetype)

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????1620??2010-11-30?13:56??x.509證書取公鑰\ABC.pfx

?????文件????????692??2012-01-30?17:22??x.509證書取公鑰\Debug\My.cer

?????文件?????279552??2012-02-21?12:33??x.509證書取公鑰\Debug\test.bsc

?????文件?????241719??2012-02-21?12:33??x.509證書取公鑰\Debug\test.exe

?????文件?????315212??2012-02-21?12:33??x.509證書取公鑰\Debug\test.ilk

?????文件??????19549??2012-02-21?12:33??x.509證書取公鑰\Debug\test.obj

?????文件????2259832??2012-02-21?12:29??x.509證書取公鑰\Debug\test.pch

?????文件?????582656??2012-02-21?12:33??x.509證書取公鑰\Debug\test.pdb

?????文件??????????0??2012-02-21?12:33??x.509證書取公鑰\Debug\test.sbr

?????文件???????7168??2012-02-02?09:08??x.509證書取公鑰\Debug\test.suo

?????文件??????82944??2012-02-21?12:33??x.509證書取公鑰\Debug\vc60.idb

?????文件?????110592??2012-02-21?12:33??x.509證書取公鑰\Debug\vc60.pdb

?????文件????????692??2012-01-30?17:22??x.509證書取公鑰\My.cer

?????文件???????4519??2012-02-21?12:33??x.509證書取公鑰\test.cpp

?????文件???????3381??2012-02-02?09:04??x.509證書取公鑰\test.dsp

?????文件????????516??2012-02-01?17:01??x.509證書取公鑰\test.dsw

?????文件??????41984??2012-02-27?17:13??x.509證書取公鑰\test.ncb

?????文件??????48640??2012-02-27?17:13??x.509證書取公鑰\test.opt

?????文件???????1372??2012-02-21?12:33??x.509證書取公鑰\test.plg

?????文件????????656??2012-02-02?15:01??x.509證書取公鑰\xx.cer

?????目錄??????????0??2012-02-21?12:33??x.509證書取公鑰\Debug

?????目錄??????????0??2012-02-27?17:13??x.509證書取公鑰

-----------?---------??----------?-----??----

??????????????4003296????????????????????22


評論

共有 條評論