-
Notifications
You must be signed in to change notification settings - Fork 1
/
wintypes.go
executable file
·106 lines (88 loc) · 1.86 KB
/
wintypes.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
package wincert
import (
"syscall"
)
const (
CERT_STORE_PROV_SYSTEM = 9
CERT_SYSTEM_STORE_LOCAL_MACHINE = 0x20000
CERT_NAME_SIMPLE_DISPLAY_TYPE = 0x4
AT_SIGNATURE = 0x2
AT_KEYEXCHANGE = 0x1
OIG_RSA_RSA1SHA = "1.2.840.113549.1.1.5"
CALG_SHA_256 = 0x0000800c
CRYPT_EXPORTABLE = 0x1
CRYPT_NEWKEYSET = 0x8
CERT_KEY_PROV_INFO_PROP_ID = 0x2
)
type CertInfo struct {
DwVersion uint32
SerialNumber CryptoApiBlob
SignatureAlgorithm AlgorithmId
Issuer CryptoApiBlob
NotBefore syscall.Filetime
NotAfter syscall.Filetime
Subject CryptoApiBlob
SubjectPublicKeyInfo PublicKeyInfo
IssuerUniqueId CryptBitBlob
SubjectUniqueId CryptBitBlob
CExtension uint32
RgExtension *CertExtension
}
type PublicKeyInfo struct {
Algorithm AlgorithmId
PublicKey CryptBitBlob
}
type CryptBitBlob struct {
CbData uint32
PbData *uint8
CUnusedBits uint32
}
type AlgorithmId struct {
PszObjId *int8
Parameters CryptoApiBlob
}
type SystemTime struct {
Year uint16
Month uint16
DayOfWeek uint16
Day uint16
Hour uint16
Minute uint16
Second uint16
MilliSeconds uint16
}
type CryptoApiBlob struct {
DataSize uint32
Data []byte
}
type CertNameBlob struct {
CryptoApiBlob
}
type KeyProvInfo struct {
ContainerName *uint16
ProvName *uint16
ProvType uint32
Flags uint32
CProvParam uint32
ProvParam *KeyProvParam
KeySpec uint32
}
type KeyProvParam struct {
Param uint32
Data *uint8
DataSize uint32
Flags uint32
}
type AlgorithmIdentifier struct {
OID *int8
Parameters CryptoApiBlob
}
type CertExtension struct {
OIDSize *int8
Critical int32
Value CryptoApiBlob
}
type CertExtensions struct {
Capacity uint32
Extensions *CertExtension
}