Documentation ¶
Overview ¶
Package prekey defines a pre-key and signed pre-key.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bundle ¶
type Bundle struct { RegistrationID uint32 DeviceID address.DeviceID PreKeyID *ID PreKeyPublic curve.PublicKey SignedPreKeyID ID SignedPreKeyPublic curve.PublicKey SignedPreKeySignature []byte IdentityKey identity.Key }
Bundle represents a pre-key bundle as defined by the X3DH protocol.
See https://signal.org/docs/specifications/x3dh/#sending-the-initial-message for more information.
type PreKey ¶
type PreKey struct {
// contains filtered or unexported fields
}
PreKey represents a public pre-key.
type SignedPreKey ¶
type SignedPreKey struct {
// contains filtered or unexported fields
}
SignedPreKey represents a public signed pre-key.
func (*SignedPreKey) GetSigned ¶
func (s *SignedPreKey) GetSigned() *v1.SignedPreKeyRecordStructure
Get signed
type SignedStore ¶
type SignedStore interface { // Load fetches the signed pre-key associated with the id from the store. Load(ctx context.Context, id ID) (*SignedPreKey, bool, error) // Store stores the signed pre-key associated with the given ID in the store. Store(ctx context.Context, id ID, record *SignedPreKey) error }
SignedStore defines a signed pre-key store.
func NewInMemSignedStore ¶
func NewInMemSignedStore() SignedStore
NewInMemSignedStore creates a new in-memory signed pre-key store.
type Store ¶
type Store interface { // Load fetches the pre-key associated with the id from the store. Load(ctx context.Context, id ID) (*PreKey, bool, error) // Store stores the pre-key associated with the given ID in the store. Store(ctx context.Context, id ID, preKey *PreKey) error // Delete removes the pre-key entry identified by the given ID from the store. Delete(ctx context.Context, id ID) error }
Store defines a pre-key store.
func NewInMemStore ¶
func NewInMemStore() Store
NewInMemStore creates a new in-memory pre-key store.
Click to show internal directories.
Click to hide internal directories.