Documentation
¶
Overview ¶
Package test_ca makes a throwaway certificate hierarchy shaped like a real e-seal's: a root, an issuing CA, a sealing certificate and a timestamping unit, with a CRL from each CA.
Index ¶
- type Authority
- func (a *Authority) Chain() []*x509.Certificate
- func (a *Authority) Crls(now time.Time) ([][]byte, error)
- func (a *Authority) IssueSeal(publicKey crypto.PublicKey) (*x509.Certificate, error)
- func (a *Authority) IssueToken(digest []byte, nonce *big.Int, at time.Time) ([]byte, error)
- func (a *Authority) RootPem() []byte
- func (a *Authority) ServeHTTP(writer http.ResponseWriter, request *http.Request)
- func (a *Authority) Timestamp(_ context.Context, digest []byte) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authority ¶
type Authority struct {
Root *x509.Certificate
Issuing *x509.Certificate
Seal *x509.Certificate
SealKey crypto.Signer
Tsa *x509.Certificate
// contains filtered or unexported fields
}
Authority is the hierarchy and the sealing key.
func New ¶
New makes a hierarchy valid from an hour before now for a year, sealing in the name of organization.
func (*Authority) Chain ¶
func (a *Authority) Chain() []*x509.Certificate
Chain is the sealing certificate and its issuing CA, as a signature carries them.
func (*Authority) IssueSeal ¶ added in v1.116.0
IssueSeal issues a sealing certificate for a key the authority does not hold, such as one in an HSM, from its issuing CA, valid as long as the authority's own.
func (*Authority) IssueToken ¶
IssueToken makes a timestamp token over a SHA-256 digest at the given time.