Documentation
¶
Index ¶
- Variables
- type Cipher
- func (c *Cipher) Decrypt(hb *pbSecureMessage.HeaderAndBody) (*pbSecuregcm.DeviceToDeviceMessage, error)
- func (c *Cipher) Encrypt(d2dMsg *pbSecuregcm.DeviceToDeviceMessage) (*pbSecureMessage.HeaderAndBody, error)
- func (c *Cipher) Pin() uint16
- func (c *Cipher) SetReceiverInitMessage(msg []byte) error
- func (c *Cipher) SetReceiverPrivateKey(key *ecdsa.PrivateKey) (err error)
- func (c *Cipher) SetSenderInitMessage(msg []byte) error
- func (c *Cipher) SetSenderPublicKey(key *pbSecureMessage.EcP256PublicKey) error
- func (c *Cipher) Setup() error
- func (c *Cipher) Sign(data []byte) []byte
- func (c *Cipher) ValidateSignature(hb, signature []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidSenderInitMessage = errors.New("invalid sender init message") ErrInvalidSenderPublicKey = errors.New("invalid sender public key") )
View Source
var ( ErrInvalidReceiverInitMessage = errors.New("invalid receiver init message") ErrInvalidReceiverPrivateKey = errors.New("invalid receiver private key") )
View Source
var ErrInvalidCipher = errors.New("cipher was not prepared for setup")
View Source
var (
ErrInvalidSecureMessageSignature = errors.New("got invalid signature for secure message")
)
Functions ¶
This section is empty.
Types ¶
type Cipher ¶
type Cipher struct {
// contains filtered or unexported fields
}
func (*Cipher) Decrypt ¶
func (c *Cipher) Decrypt( hb *pbSecureMessage.HeaderAndBody, ) (*pbSecuregcm.DeviceToDeviceMessage, error)
func (*Cipher) Encrypt ¶
func (c *Cipher) Encrypt( d2dMsg *pbSecuregcm.DeviceToDeviceMessage, ) (*pbSecureMessage.HeaderAndBody, error)
func (*Cipher) SetReceiverInitMessage ¶
func (*Cipher) SetReceiverPrivateKey ¶
func (c *Cipher) SetReceiverPrivateKey(key *ecdsa.PrivateKey) (err error)
func (*Cipher) SetSenderInitMessage ¶
func (*Cipher) SetSenderPublicKey ¶
func (c *Cipher) SetSenderPublicKey(key *pbSecureMessage.EcP256PublicKey) error
func (*Cipher) ValidateSignature ¶
Click to show internal directories.
Click to hide internal directories.