Documentation ¶
Overview ¶
Package crypto contains code and structs shared between the manage and agent modules.
Index ¶
- Constants
- type Key
- type KeyPair
- func (kp *KeyPair) Bytes() []byte
- func (kp *KeyPair) Error() error
- func (kp *KeyPair) ErrorMessage() string
- func (kp *KeyPair) FromPEM(pair PEMPair) *KeyPair
- func (kp *KeyPair) GenerateKeyPair() *KeyPair
- func (kp *KeyPair) HasErrors() bool
- func (kp *KeyPair) Marshal() *KeyPair
- func (kp *KeyPair) String() (string, string)
- func (kp *KeyPair) ToHCL() *KeyPair
- func (kp *KeyPair) ToJSON() *KeyPair
- func (kp *KeyPair) ToPEM(pair *PEMPair) *KeyPair
- func (kp *KeyPair) ToYAML() *KeyPair
- func (kp *KeyPair) Unmarshal() *KeyPair
- type Message
- func (m *Message) DecodeBase64() *Message
- func (m *Message) Decrypt(encrypted []byte) *Message
- func (m *Message) EncodeBase64() *Message
- func (m *Message) Encrypt(message []byte) *Message
- func (m *Message) Error() error
- func (m *Message) ErrorMessage() string
- func (m *Message) HasErrors() bool
- func (m *Message) SetMessage(message []byte) *Message
- func (m *Message) SetPrivateKey(private *Key) *Message
- func (m *Message) SetPublicKey(public *Key) *Message
- func (m *Message) String() string
- type PEMPair
Constants ¶
const ( PublicKeyBanner = "PUBLIC KEY" PrivateKeyBanner = "PRIVATE KEY" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key represents a single key and its various forms.
func (*Key) ErrorMessage ¶
ErrorMessage returns the error message.
type KeyPair ¶
KeyPair manages the encryption routines for one public/private key pair.
func (*KeyPair) ErrorMessage ¶
ErrorMessage returns the error message.
func (*KeyPair) FromPEM ¶
FromPEM will set the public/private keys form the string in PEM format. func (kp *KeyPair) SetFromPEM(public string, private string) *KeyPair {
func (*KeyPair) GenerateKeyPair ¶
GenerateKeyPair will generate a public/private encryption key pair.
func (*KeyPair) ToPEM ¶
ToPEM will get the public/private keys and return them as a PEMPair func (kp *KeyPair) ToPEM(public string, private string) *KeyPair {
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message starts a new encrypted Message request.
func (*Message) DecodeBase64 ¶
DecodeBase64 will base64 decode the encrypted message.
func (*Message) Decrypt ¶
Decrypt will Encrypt the message. decrypted > encrypted > EncodeBase64 > transport > DecodeBase64 > encrypted > decrypted
func (*Message) EncodeBase64 ¶
EncodeBase64 will base64 encode the encrypted message.
func (*Message) Encrypt ¶
Encrypt will Encrypt the message. decrypted > encrypted > EncodeBase64 > transport > DecodeBase64 > encrypted > decrypted
func (*Message) ErrorMessage ¶
ErrorMessage returns the error message.
func (*Message) SetMessage ¶
SetMessage sets the message key for the encryption.
func (*Message) SetPrivateKey ¶
SetPrivateKey sets the private key for the encryption.
func (*Message) SetPublicKey ¶
SetPublicKey sets the public key for the encryption.