Last active
February 18, 2021 15:34
-
-
Save AZ-X/f2bf1e4aa6704eb168b998efcc89b9b2 to your computer and use it in GitHub Desktop.
golang - Secure Windows CryptoAPI calling when verifying certificate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (c *Certificate) systemVerify(opts *VerifyOptions) (chains [][]*Certificate, err error) { | |
... | |
const CERT_CHAIN_OPT_IN_WEAK_SIGNATURE = 0x00010000 // optional checking SHA1 certificate | |
err = syscall.CertGetCertificateChain(syscall.Handle(0), storeCtx, verifyTime, storeCtx.Store, para, CCERT_CHAIN_OPT_IN_WEAK_SIGNATURE|CERT_CHAIN_RETURN_LOWER_QUALITY_CONTEXTS, 0, &topCtx) | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment