Documentation ¶
Index ¶
- Constants
- Variables
- func ExtractPublicKey(priv crypto.PrivateKey) (crypto.PublicKey, error)
- func GenBase64Token(randr io.Reader, logger *zap.Logger) (string, error)
- func GenerateKey(randr io.Reader, ktype KeyType, usage string, logger *zap.Logger) (crypto.PrivateKey, error)
- func PubKeyPinString(pub crypto.PublicKey) (string, error)
- func SubjectKeyIdFromPubkey(pub crypto.PublicKey) ([]byte, error)
- func VerifyCACert(cert *x509.Certificate, t time.Time) error
- func VerifyCACertAndKey(priv crypto.PrivateKey, cert *x509.Certificate, t time.Time) error
- func VerifyPublicKeyMatch(a, b crypto.PublicKey) error
- func VerifyServerCert(cert *x509.Certificate, cacert *x509.Certificate, t time.Time) error
- type KeyType
- type UnexpectedKeyTypeErr
Constants ¶
View Source
const TokenBitsLength = 6 * 4 * 3
Variables ¶
View Source
var DefaultKeyType = KeyRSA4096
View Source
var ErrKeyAnyForGenerateKey = errors.New("KeyAny is not a valid keytype for wcrypto.GenerateKey") //nolint
View Source
var ErrPublicKeyMismatch = errors.New("public keys do not match")
View Source
var ServerKeyType = KeySECP256R1
Functions ¶
func ExtractPublicKey ¶
func ExtractPublicKey(priv crypto.PrivateKey) (crypto.PublicKey, error)
func GenerateKey ¶
func PubKeyPinString ¶
PubKeyPinString extracts the SHA256 hash for use of curl`s --pinnedpubkey commandline option.
func VerifyCACert ¶
func VerifyCACert(cert *x509.Certificate, t time.Time) error
func VerifyCACertAndKey ¶
func VerifyCACertAndKey(priv crypto.PrivateKey, cert *x509.Certificate, t time.Time) error
func VerifyPublicKeyMatch ¶
func VerifyServerCert ¶
func VerifyServerCert(cert *x509.Certificate, cacert *x509.Certificate, t time.Time) error
Types ¶
type KeyType ¶
type KeyType int
Keep this in sync with pb.KeyType
func KeyTypeFromString ¶
func (KeyType) CompatibleWith ¶ added in v0.1.0
func (*KeyType) UnmarshalFlag ¶
func (*KeyType) UnmarshalYAML ¶
type UnexpectedKeyTypeErr ¶ added in v0.2.1
func (UnexpectedKeyTypeErr) Error ¶ added in v0.2.1
func (e UnexpectedKeyTypeErr) Error() string
func (UnexpectedKeyTypeErr) Is ¶ added in v0.2.1
func (UnexpectedKeyTypeErr) Is(target error) bool
Click to show internal directories.
Click to hide internal directories.