Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotPE = errors.New("not a PE image")
ErrNotPE is what Sign returns for a file that is no PE image.
Functions ¶
func Sign ¶
Sign signs a PE image with key and, with a stamper, a timestamp, and returns the image with its signature. An image signed before is signed again in place of its old signature.
Types ¶
type Key ¶
type Key struct {
Private *rsa.PrivateKey
Cert *x509.Certificate
// Chain holds the certificates above Cert that the signature carries,
// so that Windows need not fetch them.
Chain []*x509.Certificate
}
Key is the identity a Windows file is signed with.
type Stamper ¶
Stamper asks a timestamp server to sign the digest of a signature's value. RFC 3161's TimeStampReq asks, and the token of its TimeStampResp answer is the signature's unsigned attribute.
type Timestamp ¶
type Timestamp struct {
// URL is the server's address, such as http://timestamp.digicert.com.
URL string
// Client makes the request; http.DefaultClient without one.
Client *http.Client
}
Timestamp is a timestamp server, RFC 3161's: it signs the digest of a signature's value with the current time, so that Windows trusts the signature past the certificate's expiration.