Documentation ¶
Overview ¶
Package ncrypt provides wrappers around ncrypt.h functions. https://docs.microsoft.com/en-us/windows/win32/api/ncrypt/
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SignHash ¶
func SignHash(priv windows.Handle, pub crypto.PublicKey, digest []byte, opts crypto.SignerOpts) ([]byte, error)
SignHash is a wrapper for the NCryptSignHash function that supports only a subset of well-supported cryptographic primitives.
Signature algorithms: ECDSA, RSA. Hash functions: SHA-256. RSA schemes: RSASSA-PKCS1 and RSASSA-PSS.
https://docs.microsoft.com/en-us/windows/win32/api/ncrypt/nf-ncrypt-ncryptsignhash
Types ¶
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key is a wrapper around the certificate store and context that uses it to implement signing-related methods with CryptoNG functionality.
func Cred ¶
func Cred( issuerNames [][]byte, filterCallback func(*x509.Certificate) bool, storeName string, provider string, ) (*Key, error)
Cred returns a Key wrapping the first certificate in the system store matching one of the given issuerNames and satisfying the filterCallback.
func (*Key) CertificateChain ¶
CertificateChain returns the credential as a raw X509 cert chain. This contains the public key.