Documentation
¶
Index ¶
- Constants
- Variables
- type Decrypter
- type Message
- func (msg *Message) Body() []byte
- func (msg *Message) Decrypt(recipient Decrypter) error
- func (msg *Message) Deserialize(b []byte)
- func (msg *Message) Digest() ([]byte, error)
- func (msg *Message) Encrypt(randy io.Reader, recipient delphi.PublicKey, e secretSealer) error
- func (msg *Message) IsEncrypted() bool
- func (msg *Message) IsPlain() bool
- func (msg *Message) MarshalPEM() ([]byte, error)
- func (msg *Message) MustValidate()
- func (msg *Message) Serialize() []byte
- func (msg *Message) Sign(signer crypto.Signer) error
- func (msg *Message) ToPEM() pem.Block
- func (msg *Message) UnmarshalPEM(b []byte) error
- func (msg *Message) Validate() error
- func (msg *Message) Verify(pubKey crypto.PublicKey, v Verifier) bool
- type SymmetricEncrypter
- type Verifier
Constants ¶
View Source
const NonceSize = chacha20poly1305.NonceSize
Variables ¶
View Source
var ErrBadMessage = errors.New("bad message")
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct { PlainText []byte `json:"plain,omitempty" msgpack:"plain,omitempty"` CipherText []byte `json:"ciph,omitempty" msgpack:"ciph,omitempty"` AAD []byte `json:"aad,omitempty" msgpack:"aad,omitempty"` Nonce []byte `json:"nonce,omitempty" msgpack:"nonce,omitempty"` EphemeralKey []byte `json:"eph,omitempty" msgpack:"eph,omitempty"` Signature []byte `json:"sig,omitempty" msgpack:"sig,omitempty"` }
func NewMessage ¶
func (*Message) Deserialize ¶
func (*Message) IsEncrypted ¶
func (*Message) MarshalPEM ¶
func (*Message) MustValidate ¶
func (msg *Message) MustValidate()
func (*Message) UnmarshalPEM ¶
type SymmetricEncrypter ¶
Click to show internal directories.
Click to hide internal directories.