Documentation
¶
Overview ¶
Package wincng is the sensor for the cryptography Windows itself provides: the CNG algorithm registry and primitive providers, key storage providers (KSPs) and legacy cryptographic service providers (CSPs). Unlike the file sensor it does not infer capability from a file's name and version; it ASKS the operating system what is registered, which is a stronger kind of evidence (`capable`, `probed`).
The sensor itself knows nothing about Windows: every call goes through the API in internal/winapi, so the logic here is tested anywhere with a fake. Security rules (ADR-0013): no subprocess and no network; no key, certificate or secret is opened or enumerated; a key storage provider is OPENED (which loads its code) only if it is on the in-box allow-list in internal/knowledge; a parameter set is probed only for the two post-quantum families; and it runs only for a live Windows host.
Index ¶
Constants ¶
const ( OpCipher = winapi.OpCipher OpHash = winapi.OpHash OpAsymmetricEncrypt = winapi.OpAsymmetricEncrypt OpSecretAgreement = winapi.OpSecretAgreement OpSignature = winapi.OpSignature OpRNG = winapi.OpRNG OpKeyDerivation = winapi.OpKeyDerivation OpAll = winapi.OpAll MaxName = winapi.MaxName )
Operation classes and limits.
const ( // Name is the sensor's registry name. Name = "windows-cng" // Version is the version of this sensor's behaviour. Version = "0.1.0" )
Variables ¶
var ErrUnsupported = winapi.ErrUnsupported
ErrUnsupported means the API exists only on Windows.
Functions ¶
Types ¶
type Sensor ¶
type Sensor struct {
// contains filtered or unexported fields
}
Sensor implements sense.Sensor.
func (*Sensor) Detect ¶
Detect reports whether Windows can be asked about THIS machine. The sensor asks the running operating system, so it runs only for a live Windows host: never for a mounted disk, a `--root` override, an image or a test fixture, where the answers would describe the wrong machine.
type StorageProvider ¶
type StorageProvider = winapi.StorageProvider
StorageProvider is a registered key storage provider.