Documentation
¶
Overview ¶
Package tsa requests RFC 3161 timestamp tokens and reads the TSTInfo inside them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrBadResponse = errors.New("bad timestamping service response")
ErrBadResponse is a timestamping service that refused, answered something unreadable, or answered with a token that is not for this request or not from a trusted authority; it is the service's failure, not the caller's input.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Url string
// Roots are the trust anchors the authority's certificate has to chain to; a client without them refuses to timestamp.
Roots *x509.CertPool
// Intermediates complete that chain where the token does not carry the whole of it.
Intermediates []*x509.Certificate
FetchOptions []fetch_config.Option
// Nonce makes the request nonce; nil means a random one.
Nonce func() (*big.Int, error)
}
Client is a Timestamper speaking RFC 3161 over HTTP.
type Timestamper ¶
Timestamper returns a timestamp token, a CMS ContentInfo, over the SHA-256 digest given.
type Token ¶
type Token struct {
Der []byte
Info *TstInfo
Certificate *x509.Certificate
SignedData *cms.ParsedSignedData
}
Token is a verified timestamp token.
func ParseToken ¶
ParseToken reads a timestamp token and checks the TSA's signature over it; it does not check the TSA's certificate chain.
type TstInfo ¶
type TstInfo struct {
Policy asn1.ObjectIdentifier
HashAlgorithm asn1.ObjectIdentifier
HashedMessage []byte
SerialNumber *big.Int
GenTime time.Time
Nonce *big.Int
}
TstInfo is what a timestamp authority asserts: that the imprint existed at GenTime.
func ParseTstInfo ¶
ParseTstInfo reads a TSTInfo; its optional fields are told apart by tag, which encoding/asn1 cannot do for untagged ones.