Documentation ¶
Overview ¶
Decoder for PKCS#5 encrypted PKCS#8 private keys.
Index ¶
- Variables
- func EncTypeString(typ EncType) string
- func EncryptAES(plain []byte, secret []byte, nonce []byte) ([]byte, error)
- func RawKeyHash(pubKeyBytes []byte) []byte
- func SigTypeString(typ SigType) string
- func VerifySigs(key PubSignKey, sigs []Sig, hash []byte) (int, error)
- type EncType
- type PrivEncKey
- type PrivSignKey
- type PubEncKey
- type PubSignKey
- type Sig
- type SigType
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 EncTypeString ¶ added in v0.0.9
func RawKeyHash ¶
func SigTypeString ¶ added in v0.0.9
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.
func (*PrivEncKey) Decrypt ¶ added in v0.0.2
func (k *PrivEncKey) Decrypt(ciph []byte) ([]byte, error)
func (*PrivEncKey) PubEncKey ¶ added in v0.0.9
func (key *PrivEncKey) PubEncKey() PubEncKey
type PrivSignKey ¶ added in v0.0.2
type PrivSignKey struct { // Only one of these members is non-nil. Rsa *rsa.PrivateKey Ec *ecdsa.PrivateKey Ed25519 *ed25519.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)
func (*PubSignKey) Hash ¶ added in v0.0.9
func (key *PubSignKey) Hash() ([]byte, error)
func (*PubSignKey) SigType ¶ added in v0.0.9
func (key *PubSignKey) SigType() (SigType, error)