Documentation ¶
Index ¶
- Constants
- func KeysExist(keysPath string) bool
- func PrivatePath(keysPath string) string
- type KeyPair
- func (pair *KeyPair) Decrypt(ciphertext []byte) ([]byte, error)
- func (pair *KeyPair) DecryptBlock(block []byte) ([]byte, error)
- func (pair *KeyPair) EncryptBlockFor(block []byte, pubKey *rsa.PublicKey) ([]byte, error)
- func (pair *KeyPair) EncryptFor(cleartext []byte, pubKey *rsa.PublicKey) ([]byte, error)
- func (pair *KeyPair) Load() (err error)
- func (pair *KeyPair) Save() (err error)
- func (pair *KeyPair) Sign(hash crypto.Hash, hashed []byte) ([]byte, error)
- func (pair *KeyPair) SignMessage(data []byte) ([]byte, error)
- func (pair *KeyPair) Verify(signature []byte, hasher crypto.Hash, hash []byte) error
- func (pair *KeyPair) VerifyMessage(data []byte, signature []byte) error
Constants ¶
View Source
const ( AESKEyLength = 32 NonceLength = 12 )
View Source
const Hasher = crypto.SHA256
Variables ¶
This section is empty.
Functions ¶
func PrivatePath ¶
Types ¶
type KeyPair ¶
type KeyPair struct { Path string Bits int PrivatePath string Private *rsa.PrivateKey PrivatePEM []byte PublicPath string Public *rsa.PublicKey PublicPEM []byte // sha256 of PublicSSH Fingerprint []byte FingerprintHex string }
func FromPublicPEM ¶
func (*KeyPair) EncryptBlockFor ¶
func (*KeyPair) EncryptFor ¶
Click to show internal directories.
Click to hide internal directories.