Documentation ¶
Overview ¶
Package easypgp is a generated protocol buffer package.
It is generated from these files:
easypgp.proto
It has these top-level messages:
CipherWithSignature EncryptedMessage DecryptedMessage
Index ¶
- func Decrypt(cipher string, recipient *KeyPair) (string, error)
- func DecryptSymmetric(cipher, key string) (string, error)
- func EncryptSymmetric(text, key string) (string, error)
- func Sign(message string, signer *KeyPair) (string, error)
- func Verify(message string, signature string, signer_pubkey string) (bool, error)
- type CipherWithSignature
- type DecryptedMessage
- type EncryptedMessage
- func (*EncryptedMessage) Descriptor() ([]byte, []int)
- func (m *EncryptedMessage) GetContent() *CipherWithSignature
- func (m *EncryptedMessage) GetSenderPubkey() string
- func (m *EncryptedMessage) GetTimestamp() uint64
- func (*EncryptedMessage) ProtoMessage()
- func (m *EncryptedMessage) Reset()
- func (m *EncryptedMessage) String() string
- func (msg EncryptedMessage) VerifySignature() (bool, error)
- func (msg EncryptedMessage) VerifySignatureAgainst(pubkey string) (bool, error)
- type KeyPair
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptSymmetric ¶
func EncryptSymmetric ¶
Types ¶
type CipherWithSignature ¶
type CipherWithSignature struct { Cipher string `protobuf:"bytes,1,opt,name=cipher" json:"cipher,omitempty"` Signature string `protobuf:"bytes,2,opt,name=signature" json:"signature,omitempty"` }
func (*CipherWithSignature) Descriptor ¶
func (*CipherWithSignature) Descriptor() ([]byte, []int)
func (*CipherWithSignature) GetCipher ¶
func (m *CipherWithSignature) GetCipher() string
func (*CipherWithSignature) GetSignature ¶
func (m *CipherWithSignature) GetSignature() string
func (*CipherWithSignature) ProtoMessage ¶
func (*CipherWithSignature) ProtoMessage()
func (*CipherWithSignature) Reset ¶
func (m *CipherWithSignature) Reset()
func (*CipherWithSignature) String ¶
func (m *CipherWithSignature) String() string
type DecryptedMessage ¶
type DecryptedMessage struct { Text string `protobuf:"bytes,1,opt,name=text" json:"text,omitempty"` SignatureOk bool `protobuf:"varint,2,opt,name=signature_ok,json=signatureOk" json:"signature_ok,omitempty"` }
func DecryptAndVerify ¶
func DecryptAndVerify(message *EncryptedMessage, recipient *KeyPair) (*DecryptedMessage, error)
func (*DecryptedMessage) Descriptor ¶
func (*DecryptedMessage) Descriptor() ([]byte, []int)
func (*DecryptedMessage) GetSignatureOk ¶
func (m *DecryptedMessage) GetSignatureOk() bool
func (*DecryptedMessage) GetText ¶
func (m *DecryptedMessage) GetText() string
func (*DecryptedMessage) ProtoMessage ¶
func (*DecryptedMessage) ProtoMessage()
func (*DecryptedMessage) Reset ¶
func (m *DecryptedMessage) Reset()
func (*DecryptedMessage) String ¶
func (m *DecryptedMessage) String() string
type EncryptedMessage ¶
type EncryptedMessage struct { Content *CipherWithSignature `protobuf:"bytes,1,opt,name=content" json:"content,omitempty"` SenderPubkey string `protobuf:"bytes,2,opt,name=sender_pubkey,json=senderPubkey" json:"sender_pubkey,omitempty"` Timestamp uint64 `protobuf:"varint,3,opt,name=timestamp" json:"timestamp,omitempty"` }
func EncryptAndSign ¶
func EncryptAndSign(message string, recipient *KeyPair, sender *KeyPair) (*EncryptedMessage, error)
func NewEmptyEncryptedMessage ¶
func NewEmptyEncryptedMessage() *EncryptedMessage
func (*EncryptedMessage) Descriptor ¶
func (*EncryptedMessage) Descriptor() ([]byte, []int)
func (*EncryptedMessage) GetContent ¶
func (m *EncryptedMessage) GetContent() *CipherWithSignature
func (*EncryptedMessage) GetSenderPubkey ¶
func (m *EncryptedMessage) GetSenderPubkey() string
func (*EncryptedMessage) GetTimestamp ¶
func (m *EncryptedMessage) GetTimestamp() uint64
func (*EncryptedMessage) ProtoMessage ¶
func (*EncryptedMessage) ProtoMessage()
func (*EncryptedMessage) Reset ¶
func (m *EncryptedMessage) Reset()
func (*EncryptedMessage) String ¶
func (m *EncryptedMessage) String() string
func (EncryptedMessage) VerifySignature ¶
func (msg EncryptedMessage) VerifySignature() (bool, error)
func (EncryptedMessage) VerifySignatureAgainst ¶
func (msg EncryptedMessage) VerifySignatureAgainst(pubkey string) (bool, error)
Click to show internal directories.
Click to hide internal directories.