Documentation
¶
Overview ¶
Package testutil holds helpers that tests of several packages share. It is imported by tests only.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PKCS12 ¶
type PKCS12 struct {
Certs []*x509.Certificate
KeyDER []byte // PKCS#8, as OpenSSL decrypted it
Text string // the whole output, for the stable facts of -info
}
PKCS12 is what `openssl pkcs12 -nodes` read from a file: the certificates and the decrypted key as PEM blocks, parsed with crypto/x509. Tests compare these with the originals instead of OpenSSL's text, whose format differs between versions (3.0 prints "subject=CN = x", 3.5 "subject=CN=x").
func OpenSSLPKCS12 ¶
OpenSSLPKCS12 opens file with the password (written to a temp file, never on the command line) and returns what OpenSSL read. info adds -info (MAC and encryption facts in Text). An error carries OpenSSL's output.
func (*PKCS12) InfoProblems ¶
InfoProblems checks the stable facts of -info: the names of algorithms and numbers, never the layout around them.
func (*PKCS12) Problems ¶
func (p *PKCS12) Problems(leaf *x509.Certificate, chain []*x509.Certificate, friendlyName string) []string
Problems compares what OpenSSL read with the originals: exactly the leaf and the chain (byte for byte, order free), a key that belongs to the leaf, and the friendly name. It names each missing or wrong part.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package dnsserver is an in-process DNS server for tests: an authoritative server with a small zone store, RFC 2136 UPDATE with TSIG, and a log of every message it received.
|
Package dnsserver is an in-process DNS server for tests: an authoritative server with a small zone store, RFC 2136 UPDATE with TSIG, and a log of every message it received. |