Documentation ¶
Overview ¶
Decoder for PKCS#5 encrypted PKCS#8 private keys.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var KeyPassword = []byte{}
For testing, a key can be set here. If this is empty, the key will be queried via prompt.
Functions ¶
func RawKeyHash ¶
func VerifySigs ¶
func VerifySigs(key PubSignKey, sigs []Sig, hash []byte) (int, error)
Types ¶
type PrivEncKey ¶ added in v0.0.2
type PrivEncKey struct {
Rsa *rsa.PrivateKey
}
XXX: Only RSA supported for now.
func ParsePrivEncKey ¶ added in v0.0.2
func ParsePrivEncKey(keyBytes []byte) (PrivEncKey, error)
func ReadPrivEncKey ¶ added in v0.0.2
func ReadPrivEncKey(filename string) (PrivEncKey, error)
ReadPubEncKey reads a private encryption key from a file.
func ReadPrivEncKeys ¶ added in v0.0.2
func ReadPrivEncKeys(filenames []string) ([]PrivEncKey, error)
ReadPubSignKeys reads a set of private encryption keys from several files.
type PrivSignKey ¶ added in v0.0.2
type PrivSignKey struct { // Only one of these members is non-nil. Rsa *rsa.PrivateKey Ec *ecdsa.PrivateKey }
func ParsePrivSignKey ¶ added in v0.0.2
func ParsePrivSignKey(keyBytes []byte) (PrivSignKey, error)
func ReadPrivSignKey ¶ added in v0.0.2
func ReadPrivSignKey(filename string) (PrivSignKey, error)
ReadPrivSignKey reads a private signing key from a file.
func ReadPrivSignKeys ¶ added in v0.0.2
func ReadPrivSignKeys(filenames []string) ([]PrivSignKey, error)
ReadPubSignKeys reads a set of private signing keys from several files.
func (*PrivSignKey) AssertValid ¶ added in v0.0.2
func (key *PrivSignKey) AssertValid()
func (*PrivSignKey) PubBytes ¶ added in v0.0.2
func (key *PrivSignKey) PubBytes() ([]byte, error)
func (*PrivSignKey) PubKey ¶ added in v0.0.2
func (key *PrivSignKey) PubKey() PubSignKey
func (*PrivSignKey) SigLen ¶ added in v0.0.2
func (key *PrivSignKey) SigLen() uint16
type PubEncKey ¶ added in v0.0.2
func ParsePubEncKey ¶ added in v0.0.2
func ReadPubEncKey ¶ added in v0.0.2
ReadPubEncKey reads a public encryption key from a file.
func ReadPubEncKeys ¶ added in v0.0.2
ReadPubSignKeys reads a set of public encryption keys from several files.
func (*PubEncKey) AssertValid ¶ added in v0.0.2
func (key *PubEncKey) AssertValid()
type PubSignKey ¶
func ParsePubSignKey ¶ added in v0.0.2
func ParsePubSignKey(keyBytes []byte) (PubSignKey, error)
func ReadPubSignKey ¶ added in v0.0.2
func ReadPubSignKey(filename string) (PubSignKey, error)
ReadPubSignKey reads a public signing key from a file.
func ReadPubSignKeys ¶ added in v0.0.2
func ReadPubSignKeys(filenames []string) ([]PubSignKey, error)
ReadPubSignKeys reads a set of public signing keys from several files.
func (*PubSignKey) AssertValid ¶
func (key *PubSignKey) AssertValid()
func (*PubSignKey) Bytes ¶
func (key *PubSignKey) Bytes() ([]byte, error)