Documentation
¶
Overview ¶
Package keymaterial checks the key material the security API stores: that the private and public halves of an RSA or GPG key pair belong together, and that a client certificate bundle carries its own private key.
Index ¶
Constants ¶
View Source
const ( RSA = "RSA" GPG = "GPG" )
Key pair types the security API accepts.
Variables ¶
View Source
var ErrInvalid = errors.New("invalid key material")
ErrInvalid reports key material that does not parse, does not match, or cannot be unlocked. Its message is safe to show the caller.
Functions ¶
Types ¶
type Bundle ¶
type Bundle struct {
// Certificates is the PEM of every certificate in the bundle, the leaf
// first; PrivateKey the PEM of its key.
Certificates string
PrivateKey string
IssuedTo string
IssuedBy string
IssuedOn time.Time
ValidUntil time.Time
// Fingerprint is the leaf's SHA-256 in colon-separated upper-case hex,
// as Java's keytool prints it.
Fingerprint string
}
Bundle is a parsed client certificate bundle.
func ParseBundle ¶
ParseBundle reads a PEM bundle of a certificate (optionally followed by its chain) and the certificate's private key, and checks the key belongs to the first certificate.
Click to show internal directories.
Click to hide internal directories.