| 1 | package certstore |
| 2 | |
| 3 | import ( |
| 4 | "fmt" |
| 5 | "os" |
| 6 | "testing" |
| 7 | ) |
| 8 | |
| 9 | func TestMain(m *testing.M) { |
| 10 | // Prefer CryptoAPI |
| 11 | fmt.Println("CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG") |
| 12 | winAPIFlag = 0x00010000 |
| 13 | if status := m.Run(); status != 0 { |
| 14 | os.Exit(status) |
| 15 | } |
| 16 | |
| 17 | // Prefer CNG |
| 18 | fmt.Println("CRYPT_ACQUIRE_PREFER_NCRYPT_KEY_FLAG") |
| 19 | winAPIFlag = 0x00020000 |
| 20 | if status := m.Run(); status != 0 { |
| 21 | os.Exit(status) |
| 22 | } |
| 23 | |
| 24 | os.Exit(0) |
| 25 | } |