Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( DriverVerify = Action(winguid.New("F750E6C3-38EE-11d1-85E5-00C04FC295EE")) // DRIVER_ACTION_VERIFY GenericVerifyV2 = Action(winguid.New("00AAC56B-CD44-11D0-8CC2-00C04FC295EE")) // WINTRUST_ACTION_GENERIC_VERIFY_V2 )
Supported trust provider actions.
Functions ¶
func VerifyFile ¶
VerifyFile calls the WinVerifyTrustEx function within the Windows Trust API to verify the authenticode signature of a file. It returns nil if the file was signed by a trusted publisher and the signature is valid.
It is the caller's responsibility to call this function twice when performing file verification. The first call should use StateActionVerify and the second call should use StateActionClose. This is necessary to release system resources allocated by the first call.
Types ¶
type Action ¶
Action is a GUID that identifies an action that can be performed by a Windows Trust Provider.
type DataType ¶
type DataType uint32
DataType identifies the type of data provided when making wintrust API calls.
type FileData ¶
type FileData struct { UserInterfaceMode UIMode RevocationChecks RevocationCheck File FileInfo StateAction StateAction StateData syscall.Handle ProviderFlags uint32 UserInterfaceContext UIContext SignatureSettings *SignatureSettings }
FileData holds data for wintrust API calls that verify the authenticode signature of a file.
type FileInfo ¶
type FileInfo struct { Path string Handle syscall.Handle // Optional handle to file with read access KnownSubject windows.GUID // Optional subject type }
FileInfo holds information about a file to be examined by wintrust API calls.
type RevocationCheck ¶
type RevocationCheck uint32
RevocationCheck describes possible options for revocation checking when making wintrust API calls.
const ( RevocationCheckNone RevocationCheck = iota // WTD_REVOKE_NONE RevocationCheckWholeChain // WTD_REVOKE_WHOLECHAIN )
Revocation checking options.
type SignatureSettings ¶
type SignatureSettings struct { Size uint32 Index uint32 Flags uint32 SecondarySigs uint32 VerifiedSigIndex uint32 CryptoPolicy uintptr }
SignatureSettings can be used to communicate signature verification requirements in wintrust API calls.
type StateAction ¶
type StateAction uint32
StateAction identifies the type of verification action to be taken.
const ( StateActionIgnore StateAction = iota // WTD_STATEACTION_IGNORE StateActionVerify // WTD_STATEACTION_VERIFY StateActionClose // WTD_STATEACTION_CLOSE StateActionAutoCache // WTD_STATEACTION_AUTO_CACHE StateActionAutoCacheFlush // WTD_STATEACTION_AUTO_CACHE_FLUSH )
Possible state actions.