2013/11/06

[OpenSSL] 數位簽章格式(SMIME, PEM and DER)

基於X.509和PKCS#7之下的數位簽章檔案有三個格式,分別是SMIME(Secure Multipurpose Internet Mail Extensions)、PEM(Privacy Enhanced Mail)和DER三種格式,SMIME會把整個簽章檔案內容以及簽章base64編碼的數據做為輸出內容;而PEM則是只有base64編碼的部分。
什麼是base64呢?簡單來說,在MIME格式的email中,將binary轉成ASCII的一種方法,把原本的二進制取6個bit為一個單位,用大寫字母(26個)、小寫字母(26個)、0~9(10個)和加除號"+ /"(2個),總共64個(26+26+10+2=64),基於這64個字元的編碼方式,可以簡單地做文字的加密。




以下以sign.txt文字檔案為例子
Sign.txt
------------------檔案內容----------------------
Content-type: text/plain

Test OpenSSL Signed Content
------------------檔案內容----------------------

透過簽章之後得到的結果如下,SMIME格式,上半部包含了原本檔案的內容,下半部則是base64的編碼結果。
Sign_SMIME.txt
-------------------檔案內容---------------------
MIME-Version: 1.0
Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha1"; boundary="----1BAA5059BD3F93A02E0E0816AB278824"

This is an S/MIME signed message

------1BAA5059BD3F93A02E0E0816AB278824
Content-type: text/plain

Test OpenSSL Signed Content

------1BAA5059BD3F93A02E0E0816AB278824
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"

MIIESwYJKoZIhvcNAQcCoIIEPDCCBDgCAQExCzAJBgUrDgMCGgUAMAsGCSqGSIb3
DQEHAaCCAqowggKmMIICD6ADAgECAgkAn6t+YSgtBGEwDQYJKoZIhvcNAQEEBQAw
VzELMAkGA1UEBhMCVUsxEjAQBgNVBAcTCVRlc3QgQ2l0eTEWMBQGA1UEChMNT3Bl
blNTTCBHcm91cDEcMBoGA1UEAxMTVGVzdCBTL01JTUUgUm9vdCBDQTAeFw0wNzA0
MTMxODI5MjdaFw0xNzA0MDkxODI5MjdaMFYxCzAJBgNVBAYTAlVLMSUwIwYDVQQD
ExxPcGVuU1NMIHRlc3QgUy9NSU1FIHNpZ25lciAxMSAwHgYJKoZIhvcNAQkBFhF0
ZXN0MUBvcGVuc3NsLm9yZzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAvWhw
BDs43akhRfOPAo/Ok8H2jMHo8UboXqQBE76LQOJPpCfxptSPCkc9T6UbKzzdCWlu
RBVQPoW//gvK2KGTo30+v994QJVxJnbR0jjdZeN9hqTXh1JWtmQY0wxeoqaeeq2Q
B0PSgk3sDvKBx/xG5WJXSS+T3/fp4IzAwesiZ+ECAwEAAaN7MHkwCQYDVR0TBAIw
ADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUw
HQYDVR0OBBYEFLIqqO9y0iwU0EdQsFOqvxIe1LGkMB8GA1UdIwQYMBaAFEdTKnEJ
cVBip7CEajvaVY9BSyOgMA0GCSqGSIb3DQEBBAUAA4GBAG91hWgF93hFX/FZIxch
yDD+Lk6LDJcyx6dB4+WXnUymCV8Ct3ulSKlRqUKqUm38azyQPXoiHXPXK5ZhVMyW
cNnQ/Bsg5if4mvxcsX1vVIwm3o/ByRlnQtl0iLYrAYDFWwhbWSMkCq72jhgfftdb
fvJh1BHF+++UOJCWBfQm2YuAMYIBaTCCAWUCAQEwZDBXMQswCQYDVQQGEwJVSzES
MBAGA1UEBxMJVGVzdCBDaXR5MRYwFAYDVQQKEw1PcGVuU1NMIEdyb3VwMRwwGgYD
VQQDExNUZXN0IFMvTUlNRSBSb290IENBAgkAn6t+YSgtBGEwCQYFKw4DAhoFAKBd
MBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTEzMTEw
NjAyMjYxM1owIwYJKoZIhvcNAQkEMRYEFNJX+SOrVF33DO/enrXSyiScf7pxMA0G
CSqGSIb3DQEBAQUABIGAG7ZVCprJWSsQri/3V+gG7k1eHZg+IiwbalVMgS1m1NBq
wKnSL8398KXc/aCvj12SkQVQz7/nFP2X6rtE3oOvs4T3SxxyU9UlBsBtkRDKe0k2
8O8XD54t6jYUolEmkJ1BQP/G8PMuo3CkjMTDYNuWly6E8eBVjLt44fYraFmf/As=

------1BAA5059BD3F93A02E0E0816AB278824--
--------------------檔案內容--------------------

PEM格式,與SMIME的base64編碼的部分相同。
Sign_PEM.txt
--------------------檔案內容--------------------
-----BEGIN PKCS7-----
MIIESwYJKoZIhvcNAQcCoIIEPDCCBDgCAQExCzAJBgUrDgMCGgUAMAsGCSqGSIb3
DQEHAaCCAqowggKmMIICD6ADAgECAgkAn6t+YSgtBGEwDQYJKoZIhvcNAQEEBQAw
VzELMAkGA1UEBhMCVUsxEjAQBgNVBAcTCVRlc3QgQ2l0eTEWMBQGA1UEChMNT3Bl
blNTTCBHcm91cDEcMBoGA1UEAxMTVGVzdCBTL01JTUUgUm9vdCBDQTAeFw0wNzA0
MTMxODI5MjdaFw0xNzA0MDkxODI5MjdaMFYxCzAJBgNVBAYTAlVLMSUwIwYDVQQD
ExxPcGVuU1NMIHRlc3QgUy9NSU1FIHNpZ25lciAxMSAwHgYJKoZIhvcNAQkBFhF0
ZXN0MUBvcGVuc3NsLm9yZzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAvWhw
BDs43akhRfOPAo/Ok8H2jMHo8UboXqQBE76LQOJPpCfxptSPCkc9T6UbKzzdCWlu
RBVQPoW//gvK2KGTo30+v994QJVxJnbR0jjdZeN9hqTXh1JWtmQY0wxeoqaeeq2Q
B0PSgk3sDvKBx/xG5WJXSS+T3/fp4IzAwesiZ+ECAwEAAaN7MHkwCQYDVR0TBAIw
ADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUw
HQYDVR0OBBYEFLIqqO9y0iwU0EdQsFOqvxIe1LGkMB8GA1UdIwQYMBaAFEdTKnEJ
cVBip7CEajvaVY9BSyOgMA0GCSqGSIb3DQEBBAUAA4GBAG91hWgF93hFX/FZIxch
yDD+Lk6LDJcyx6dB4+WXnUymCV8Ct3ulSKlRqUKqUm38azyQPXoiHXPXK5ZhVMyW
cNnQ/Bsg5if4mvxcsX1vVIwm3o/ByRlnQtl0iLYrAYDFWwhbWSMkCq72jhgfftdb
fvJh1BHF+++UOJCWBfQm2YuAMYIBaTCCAWUCAQEwZDBXMQswCQYDVQQGEwJVSzES
MBAGA1UEBxMJVGVzdCBDaXR5MRYwFAYDVQQKEw1PcGVuU1NMIEdyb3VwMRwwGgYD
VQQDExNUZXN0IFMvTUlNRSBSb290IENBAgkAn6t+YSgtBGEwCQYFKw4DAhoFAKBd
MBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTEzMTEw
NjAyMjYxM1owIwYJKoZIhvcNAQkEMRYEFNJX+SOrVF33DO/enrXSyiScf7pxMA0G
CSqGSIb3DQEBAQUABIGAG7ZVCprJWSsQri/3V+gG7k1eHZg+IiwbalVMgS1m1NBq
wKnSL8398KXc/aCvj12SkQVQz7/nFP2X6rtE3oOvs4T3SxxyU9UlBsBtkRDKe0k2
8O8XD54t6jYUolEmkJ1BQP/G8PMuo3CkjMTDYNuWly6E8eBVjLt44fYraFmf/As=
-----END PKCS7-----
--------------------檔案內容--------------------

而最後一個DER格式,因為是使用二進制編碼,格式上主要為TLV(text, length, value),也就是說每個字串會包含最前頭的代表、字串長度以及數值。有興趣可以參考http://en.wikipedia.org/wiki/Type-length-value

因此可以在裡面看到很多簽章的格式細節,使用16進制檢視結果如下所示:
Sign_DER.txt
--------------------檔案內容--------------------
00000000h: 30 82 04 4B 06 09 2A 86 48 86 F7 0D 01 07 02 A0 ; 0?K..*....?
00000010h: 82 04 3C 30 82 04 38 02 01 01 31 0B 30 09 06 05 ; ?<0?8...1.0...
00000020h: 2B 0E 03 02 1A 05 00 30 0B 06 09 2A 86 48 86 F7 ; +......0...*
00000030h: 0D 01 07 01 A0 82 02 AA 30 82 02 A6 30 82 02 0F ; ....?.????.
00000040h: A0 03 02 01 02 02 09 00 9F AB 7E 61 28 2D 04 61 ; ?......~a(-.a
00000050h: 30 0D 06 09 2A 86 48 86 F7 0D 01 01 04 05 00 30; 0...*......0
00000060h: 57 31 0B 30 09 06 03 55 04 06 13 02 55 4B 31 12 ; W1.0...U....UK1.
00000070h: 30 10 06 03 55 04 07 13 09 54 65 73 74 20 43 69 ; 0...U....Test Ci
00000080h: 74 79 31 16 30 14 06 03 55 04 0A 13 0D 4F 70 65 ; ty1.0...U....Ope
00000090h: 6E 53 53 4C 20 47 72 6F 75 70 31 1C 30 1A 06 03 ; nSSL Group1.0...
000000a0h: 55 04 03 13 13 54 65 73 74 20 53 2F 4D 49 4D 45 ; U....Test S/MIME
000000b0h: 20 52 6F 6F 74 20 43 41 30 1E 17 0D 30 37 30 34 ;  Root CA0...0704
000000c0h: 31 33 31 38 32 39 32 37 5A 17 0D 31 37 30 34 30 ; 13182927Z..17040
000000d0h: 39 31 38 32 39 32 37 5A 30 56 31 0B 30 09 06 03 ; 9182927Z0V1.0...
000000e0h: 55 04 06 13 02 55 4B 31 25 30 23 06 03 55 04 03 ; U....UK1%0#..U..
000000f0h: 13 1C 4F 70 65 6E 53 53 4C 20 74 65 73 74 20 53 ; ..OpenSSL test S
00000100h: 2F 4D 49 4D 45 20 73 69 67 6E 65 72 20 31 31 20 ; /MIME signer 11 
00000110h: 30 1E 06 09 2A 86 48 86 F7 0D 01 09 01 16 11 74 ; 0...*......t
00000120h: 65 73 74 31 40 6F 70 65 6E 73 73 6C 2E 6F 72 67 ; est1@openssl.org
00000130h: 30 81 9F 30 0D 06 09 2A 86 48 86 F7 0D 01 01 01 ; 0?0...*....
00000140h: 05 00 03 81 8D 00 30 81 89 02 81 81 00 BD 68 70 ; ...?.0?.?.篁p
00000150h: 04 3B 38 DD A9 21 45 F3 8F 02 8F CE 93 C1 F6 8C ; .;8搣!E?.?
00000160h: C1 E8 F1 46 E8 5E A4 01 13 BE 8B 40 E2 4F A4 27 ; 錘轆醁?.?@槄?
00000170h: F1 A6 D4 8F 0A 47 3D 4F A5 1B 2B 3C DD 09 69 6E ; 韘?.G=O?+<?in
00000180h: 44 15 50 3E 85 BF FE 0B CA D8 A1 93 A3 7D 3E BF ; D.P>?忐?ㄎ>?
00000190h: DF 78 40 95 71 26 76 D1 D2 38 DD 65 E3 7D 86 A4 ; 腢@&v旂8惷翥
000001a0h: D7 87 52 56 B6 64 18 D3 0C 5E A2 A6 9E 7A AD 90 ; ?RV辜.?^╪?
000001b0h: 07 43 D2 82 4D EC 0E F2 81 C7 FC 46 E5 62 57 49 ; .C?M??F嶙WI
000001c0h: 2F 93 DF F7 E9 E0 8C C0 C1 EB 22 67 E1 02 03 01 ; /玃?擱?g?..
000001d0h: 00 01 A3 7B 30 79 30 09 06 03 55 1D 13 04 02 30 ; ..ㄌ0y0...U....0
000001e0h: 00 30 2C 06 09 60 86 48 01 86 F8 42 01 0D 04 1F ; .0,..`.B....
000001f0h: 16 1D 4F 70 65 6E 53 53 4C 20 47 65 6E 65 72 61 ; ..OpenSSL Genera
00000200h: 74 65 64 20 43 65 72 74 69 66 69 63 61 74 65 30 ; ted Certificate0
00000210h: 1D 06 03 55 1D 0E 04 16 04 14 B2 2A A8 EF 72 D2 ; ...U......?剁r?
00000220h: 2C 14 D0 47 50 B0 53 AA BF 12 1E D4 B1 A4 30 1F ; ,.籿P訕矽..埜?.
00000230h: 06 03 55 1D 23 04 18 30 16 80 14 47 53 2A 71 09 ; ..U.#..0.€.GS*q.
00000240h: 71 50 62 A7 B0 84 6A 3B DA 55 8F 41 4B 23 A0 30 ; qPb妍;渵K#?
00000250h: 0D 06 09 2A 86 48 86 F7 0D 01 01 04 05 00 03 81 ; ...*.......?
00000260h: 81 00 6F 75 85 68 05 F7 78 45 5F F1 59 23 17 21 ; ?ou.驎E_鎉#.!
00000270h: C8 30 FE 2E 4E 8B 0C 97 32 C7 A7 41 E3 E5 97 9D ; ??N??A蜲?
00000280h: 4C A6 09 5F 02 B7 7B A5 48 A9 51 A9 42 AA 52 6D ; L?_.暍以咋咕析m
00000290h: FC 6B 3C 90 3D 7A 22 1D 73 D7 2B 96 61 54 CC 96 ; <?z".s?T?
000002a0h: 70 D9 D0 FC 1B 20 E6 27 F8 9A FC 5C B1 7D 6F 54 ; p棞? ??惦oT
000002b0h: 8C 26 DE 8F C1 C9 19 67 42 D9 74 88 B6 2B 01 80 ; ??賽.gB敪+.€
000002c0h: C5 5B 08 5B 59 23 24 0A AE F6 8E 18 1F 7E D7 5B ; 騾.[Y#$.浪?.~莨
000002d0h: 7E F2 61 D4 11 C5 FB EF 94 38 90 96 05 F4 26 D9 ; ~瀡?蠹?8?.??
000002e0h: 8B 80 31 82 01 69 30 82 01 65 02 01 01 30 64 30 ; ?1?i0?e...0d0
000002f0h: 57 31 0B 30 09 06 03 55 04 06 13 02 55 4B 31 12 ; W1.0...U....UK1.
00000300h: 30 10 06 03 55 04 07 13 09 54 65 73 74 20 43 69 ; 0...U....Test Ci
00000310h: 74 79 31 16 30 14 06 03 55 04 0A 13 0D 4F 70 65 ; ty1.0...U....Ope
00000320h: 6E 53 53 4C 20 47 72 6F 75 70 31 1C 30 1A 06 03 ; nSSL Group1.0...
00000330h: 55 04 03 13 13 54 65 73 74 20 53 2F 4D 49 4D 45 ; U....Test S/MIME
00000340h: 20 52 6F 6F 74 20 43 41 02 09 00 9F AB 7E 61 28 ;  Root CA...~a(
00000350h: 2D 04 61 30 09 06 05 2B 0E 03 02 1A 05 00 A0 5D ; -.a0...+......
00000360h: 30 18 06 09 2A 86 48 86 F7 0D 01 09 03 31 0B 06 ; 0...*....1..
00000370h: 09 2A 86 48 86 F7 0D 01 07 01 30 1C 06 09 2A 86 ; .*....0...*?
00000380h: 48 86 F7 0D 01 09 05 31 0F 17 0D 31 33 31 31 30 ; H....1...13110
00000390h: 36 30 32 32 36 31 33 5A 30 23 06 09 2A 86 48 86 ; 6022613Z0#..*?
000003a0h: F7 0D 01 09 04 31 16 04 14 D2 57 F9 23 AB 54 5D ; ?...1...浠?俊]
000003b0h: F7 0C EF DE 9E B5 D2 CA 24 9C 7F BA 71 30 0D 06 ; ?檹疺$?歌0..
000003c0h: 09 2A 86 48 86 F7 0D 01 01 01 05 00 04 81 80 1B ; .*.......?.
000003d0h: B6 55 0A 9A C9 59 2B 10 AE 2F F7 57 E8 06 EE 4D ; 貸.Y+.?讄?薁
000003e0h: 5E 1D 98 3E 22 2C 1B 6A 55 4C 81 2D 66 D4 D0 6A ; ^.?",.jUL?f婕j
000003f0h: C0 A9 D2 2F CD FD F0 A5 DC FD A0 AF 8F 5D 92 91 ; 孺?咥藆媻?
00000400h: 05 50 CF BF E7 14 FD 97 EA BB 44 DE 83 AF B3 84 ; .P狤??篕D?秦?
00000410h: F7 4B 1C 72 53 D5 25 06 C0 6D 91 10 CA 7B 49 36 ; 蘲.rS?.鴦?吙I6
00000420h: F0 EF 17 0F 9E 2D EA 36 14 A2 51 26 90 9D 41 40 ; 豵..??.㎝&?A@
00000430h: FF C6 F0 F3 2E A3 70 A4 8C C4 C3 60 DB 96 97 2E ; ?φ?鏽`??
00000440h: 84 F1 E0 55 8C BB 78 E1 F6 2B 68 59 9F FC 0B    ; 豥x暡+hY.
--------------------檔案內容--------------------

詳細格式說明如下列表格

30 82 04 4B
ContentInfo header, Length: 04 4B
06 09 2A 86 48 86 F7 0D 01 07 02
ContentType=signedData
A0 82 04 3C
[0] EXPLICIT
30 82 04 38
SignedData header, Length: 04 38
02 01 01
Version=1
31 0B
30 09
06 05 2B 0E 03 02 1A
05 00
SET OF DigestAlgorithmIdentifier header

Algorithm=SHA-1
Parameters=NULL
30 0B
06 09 2A 86 48 86 F7 0D 01 07 01
ContentInfo header
contentType=data
A0 82 02 AA
Certificate(s)
30 82 02 A6
Manufacturer CVC header
30 82 02 0F
tbs Manufacturer CVC header
A0 03 02 01 02
Version=v3(2)
02 09 00 9F AB 7E 61 28 2D 04 61
Serial Number = 00 9F AB 7E 61 28 2D 04 61
30 0D
06 09 2A 86 48 86 F7 0D 01 01 04
05 00
Signature
Algorithm=SHA-1 with RSA OID
Parameter=NULL
30 57
Issuer SEQUENCE
31 0B 30 09 06 03 55 04 06
13 02 55 4B
AttributeType=countryName
AttributeValue=”UK”
31 12 30 10 06 03 55 04 07
13 09 54 65 73 74 20 43 69 74 79
AttributeType=organizationalName
AttributeValue=”Test City”
31 16 30 14 06 03 55 04 0A
13 0D 4F 70 65 6E 53 53 4C 20 47 72 6F 75 70
AttributeType= organizationalUnitName
AttributeValue=”OpenSSL Group”
31 1C 30 1A 06 03 55 04 03
13 13 54 65 73 74 20 53 2F 4D 49 4D 45 20 52 6F 6F 74 20 43 41
AttributeType= commonName
AttributeValue=”Test S/MIME ROOT CA”
30 1E
17 0D 30 37 30 34 31 33 31 38 32 39 32 37 5A
17 0D 31 37 30 34 30 39 31 38 32 39 32 37 5A
Validity SEQUENCE
Not before=2007/04/13:18:29:27Z
Not after=2017/04/09:18:29:27Z
30 56
Subject SEQUENCE
31 0B 30 09 06 03 55 04 06
13 02 55 4B
AttributeType=countryName
AttributeValues=”UK”
31 25 30 23 06 03 55 04 03
13 1C 4F 70 65 6E 53 53 4C 20 74 65 73 74 20 53 2F 4D 49 4D 45 20 73 69 67 6E 65 72 20 31 31
AttributeType=organizationalName
AttributeValues=”OpenSSL Test S/MIME Signer 11”
30 1E 06 09 2A 86 48 86 F7 0D 01 09 01
16 11 74 65 73 74 31 40 6F 70 65 6E 73 73 6C 2E 6F 72 67
AttributeType=emailAddress
AttributeValues=”test1@openssl.org”
30 81 9F
SubjectPublicKeyInfo header
30 0D
06 09 2A 86 48 86 F7 0D 01 01 01
05 00
Public Key SEQUENCE
Algorithm=RSA encryption
Parameters=NULL
03 81 8D 00 30 81 89
Public Key header
02 81 81 00
Public Key modulus header
BD 68 70 04 3B 38 DD A9 21 45 F3 8F 02 8F CE 93
C1 F6 8C C1 E8 F1 46 E8 5E A4 01 13 BE 8B 40 E2
4F A4 27 F1 A6 D4 8F 0A 47 3D 4F A5 1B 2B 3C DD
09 69 6E 44 15 50 3E 85 BF FE 0B CA D8 A1 93 A3
7D 3E BF DF 78 40 95 71 26 76 D1 D2 38 DD 65 E3
7D 86 A4 D7 87 52 56 B6 64 18 D3 0C 5E A2 A6 9E
7A AD 90 07 43 D2 82 4D EC 0E F2 81 C7 FC 46 E5
62 57 49 2F 93 DF F7 E9 E0 8C C0 C1 EB 22 67 E1

02 03 01 00 01
Public Key exponent
A3 7B 30 79 30 09 06 03 55 1D 13 04 02 30 00
30 2C
06 09 60 86 48 01 86 F8 42 01 0D
04 1F 16 1D 4F 70 65 6E 53 53 4C 20 47 65 6E 65 72 61 74 65 64 20 43 65 72 74 69 66 69 63 61 74 65
30 1D 06 03 55 1D 0E 04 16 04 14 B2 2A A8 EF 72 D2 2C 14 D0 47 50 B0 53 AA BF 12 1E D4 B1 A4
30 1F 06 03 55 1D 23 04 18 30 16 80 14 47 53 2A 71 09 71 50 62 A7 B0 84 6A 3B DA 55 8F 41 4B 23 A0
[3] Extensions
30 0D
06 09 2A 86 48 86 F7 0D 01 01 04 05 00
Signature SEQUENCE
Algorithm=SHA-1 with RSA OID
03 81 81 00
6F 75 85 68 05 F7 78 45 5F F1 59 23 17 21 C8 30
FE 2E 4E 8B 0C 97 32 C7 A7 41 E3 E5 97 9D 4C A6
09 5F 02 B7 7B A5 48 A9 51 A9 42 AA 52 6D FC 6B
3C 90 3D 7A 22 1D 73 D7 2B 96 61 54 CC 96 70 D9
D0 FC 1B 20 E6 27 F8 9A FC 5C B1 7D 6F 54 8C 26
DE 8F C1 C9 19 67 42 D9 74 88 B6 2B 01 80 C5 5B
08 5B 59 23 24 0A AE F6 8E 18 1F 7E D7 5B 7E F2
61 D4 11 C5 FB EF 94 38 90 96 05 F4 26 D9 8B 80
Signature value
1024bits
31 82 01 69
SET OF SignerInfo header
30 82 01 65
Manufacturer SignerInfo header
02 01 01
Version=1
30 64
IssuerAdnSerialNumber header
30 57
Issuer Name header
31 0B 30 09 06 03 55 04 06
13 02 55 4B
AttributeType=countryName
AttributeValues=”UK”
31 12 30 10 06 03 55 04 07
13 09 54 65 73 74 20 43 69 74 79
AttributeType=organizationalName
AttributeValue=”Test City”
31 16 30 14 06 03 55 04 0A
13 0D 4F 70 65 6E 53 53 4C 20 47 72 6F 75 70
AttributeType= organizationalUnitName
AttributeValue=”OpenSSL Group”
31 1C 30 1A 06 03 55 04 03
13 13 54 65 73 74 20 53 2F 4D 49 4D 45 20 52 6F 6F 74 20 43 41
AttributeType= commonName
AttributeValue=”Test S/MIME ROOT CA”
02 09 00 9F AB 7E 61 28 2D 04 61
CertificateSerialNumber = 00 9F AB 7E 61 28 2D 04 61
30 09
06 05 2B 0E 03 02 1A
05 00
DigestAlgorithmIdentifier header
Algorithm=SHA-1
Parameter=NULL
A0 5D
[0] AuthenticateAttributes
30 18
06 09 2A 86 48 86 F7 0D 01 09 03
31 0B 06 09 2A 86 48 86 F7 0D 01 07 01
ContentType header
AttributeType=contentType
AttributeValue=Data
30 1C
06 09 2A 86 48 86 F7 0D 01 09 05
31 0F 17 0D 31 33 31 31 30 36 30 32 32 36 31 33 5A
SigningTime header
AttributeType=signingType
AttributeValue=2013/11/06:02:26:13Z
30 23
06 09 2A 86 48 86 F7 0D 01 09 04
31 16 04 14 D2 57 F9 23 AB 54 5D F7 0C EF DE 9E B5 D2 CA 24 9C 7F BA 71
MessageDigest header
AttributeType=messageDigest
AttributeValue=OOCTET STRING Message Digest
30 0D
06 09 2A 86 48 86 F7 0D 01 01 01
05 00
SIgestEncryptedAlgorithm header
Algorithm=RSA
Parameters=NULL
04 81 80
1B B6 55 0A 9A C9 59 2B 10 AE 2F F7 57 E8 06 EE
4D 5E 1D 98 3E 22 2C 1B 6A 55 4C 81 2D 66 D4 D0
6A C0 A9 D2 2F CD FD F0 A5 DC FD A0 AF 8F 5D 92
91 05 50 CF BF E7 14 FD 97 EA BB 44 DE 83 AF B3
84 F7 4B 1C 72 53 D5 25 06 C0 6D 91 10 CA 7B 49
36 F0 EF 17 0F 9E 2D EA 36 14 A2 51 26 90 9D 41
40 FF C6 F0 F3 2E A3 70 A4 8C C4 C3 60 DB 96 97
2E 84 F1 E0 55 8C BB 78 E1 F6 2B 68 59 9F FC 0B
OCTET STRING
EncryptedDigest
1024bits


沒有留言:

張貼留言