Documentation ¶
Index ¶
- Constants
- Variables
- func CreateSMSRegisterRequest(pushToken []byte) string
- func GetCarrierInfo(ctx context.Context, url string) (map[string]any, error)
- func GetGatewayByMCCMNC(ctx context.Context, mccmnc string) (string, error)
- func ParseSMSRegisterResponse(resp string) (phoneNumber string, sig []byte, err error)
- func ValidatePreKey(key *idsproto.PublicDevicePrekey, deviceKey *ecdsa.PublicKey) bool
- func VerifyKeyValidator(keyValidator []byte, ...) bool
- func VerifySignedPairECPayload(sharedSecret []byte, myPreKey, myDeviceKey *ec.CompactPublicKey, ...) bool
- func VerifySignedPairPayload(senderKey *UserIdentity, body ParsedBody) bool
- type AttachmentDownloader
- func (ad *AttachmentDownloader) DownloadFile(ctx context.Context, u *User, path string, ...) error
- func (ad *AttachmentDownloader) DownloadMemory(ctx context.Context, u *User) ([]byte, error)
- func (ad *AttachmentDownloader) GetFileSize() int
- func (ad *AttachmentDownloader) Prepare(ctx context.Context, u *User) error
- type AuthIDCertPair
- type AuthResponse
- type ChunkChecksum
- type Config
- type DependentRegistration
- type DownloadChunk
- type DownloadContainer
- func (dc *DownloadContainer) Download(ctx context.Context, ua Versions) (*mmcsproto.ConfirmResponse_Request, []byte, error)
- func (dc *DownloadContainer) DownloadAndWriteChunk(ctx context.Context, prog *DownloadProgress, ua Versions, chunk *DownloadChunk, ...) (*mmcsproto.ConfirmResponse_Request, error)
- func (dc *DownloadContainer) Write(ctx context.Context, data []byte, into io.WriterAt) error
- type DownloadProgress
- type Handle
- type InMemoryLookupCache
- func (i InMemoryLookupCache) Clear(_ context.Context) error
- func (i InMemoryLookupCache) Delete(_ context.Context, ourURI, theirURI uri.ParsedURI) error
- func (i InMemoryLookupCache) Get(_ context.Context, ourURI, theirURI uri.ParsedURI) (*LookupResult, error)
- func (i InMemoryLookupCache) GetMany(_ context.Context, ourURI uri.ParsedURI, theirURIs []uri.ParsedURI) (map[uri.ParsedURI]*LookupResult, error)
- func (i InMemoryLookupCache) Invalidate(_ context.Context, ourURI, theirURI uri.ParsedURI) error
- func (i InMemoryLookupCache) MarkBroadcasted(ctx context.Context, handle uri.ParsedURI, broadcasted ...uri.ParsedURI) error
- func (i InMemoryLookupCache) Put(_ context.Context, ourURI, theirURI uri.ParsedURI, result *LookupResult) error
- type InMemoryOutgoingCounter
- type InMemoryOutgoingCounterStore
- type InMemoryRerouteHistory
- func (i InMemoryRerouteHistory) Clear(_ context.Context) error
- func (i InMemoryRerouteHistory) Delete(_ context.Context, handle uri.ParsedURI) error
- func (i InMemoryRerouteHistory) Get(_ context.Context, handle uri.ParsedURI) (*time.Time, error)
- func (i InMemoryRerouteHistory) Put(_ context.Context, handle uri.ParsedURI) error
- type JSONAuthIDCertPair
- type JSONCertificate
- type JSONConfig
- type JSONECPrivateKey
- type JSONRSAPrivateKey
- type LookupCache
- type LookupIdentity
- type LookupIdentityClientData
- type LookupParams
- type LookupQuery
- type LookupResult
- type LookupResults
- type MMCSDownloader
- func (md *MMCSDownloader) Decrypt(ctx context.Context, prog *DownloadProgress, file ReadWriterAt) error
- func (md *MMCSDownloader) Download(ctx context.Context, prog *DownloadProgress, ua Versions, into io.WriterAt) error
- func (md *MMCSDownloader) DownloadAndDecrypt(ctx context.Context, prog *DownloadProgress, ua Versions, into ReadWriterAt, ...) error
- func (md *MMCSDownloader) SendGetComplete(ctx context.Context, ua Versions, attachmentURL string) (*http.Response, error)
- type OutgoingCounter
- type OutgoingCounterStore
- type ParsedBody
- type PreparedUpload
- type PrivateDeviceData
- type ReadWriterAt
- type RegisterError
- type RegisterReq
- type RegisterResp
- type RegisterRespAlert
- type RegisterRespAlertAction
- type RegisterRespService
- type RegisterRespServiceUser
- type RegisterService
- type RegisterServiceCapabilities
- type RegisterServiceUser
- type RerouteHistory
- type RespDependentRegistrations
- type RespHandle
- type SMSForwarding
- type SigningPayload
- type UploadChunk
- type UploadedAttachment
- type User
- func (u *User) Authenticate(ctx context.Context, username, password, code string) (*AuthResponse, error)
- func (u *User) DecryptSignedPairECPayload(sharedSecret, payload []byte) ([]byte, error)
- func (u *User) DecryptSignedPairPayload(body ParsedBody) ([]byte, error)
- func (u *User) DeriveExistingPairECSharedSecret(ephemeralPubKeyRaw []byte) ([]byte, error)
- func (u *User) DownloadAttachment(ctx context.Context, url, ownerID string, sig, decryptionKey []byte) ([]byte, error)
- func (u *User) EncryptSignPairECPayload(ctx context.Context, theirURI uri.ParsedURI, ...) ([]byte, error)
- func (u *User) EncryptSignPairPayload(ctx context.Context, key *UserIdentity, payload []byte) ([]byte, error)
- func (u *User) EncryptSignPayload(ctx context.Context, theirURI uri.ParsedURI, ident *LookupIdentity, ...) ([]byte, apns.EncryptionType, error)
- func (u *User) GenerateLoggableData() *idsproto.KeyTransparencyLoggableData
- func (u *User) GeneratePreKeyData() []byte
- func (u *User) GetAuthCert(ctx context.Context, authToken, profileID string) (*x509.Certificate, error)
- func (u *User) GetAuthCertSMS(ctx context.Context, pushToken, signature []byte, phoneNumber string) (*x509.Certificate, error)
- func (u *User) GetDependentRegistrations(ctx context.Context, profileID string) (map[string]any, error)
- func (u *User) GetPhoneRegistrationHandle() *uri.ParsedURI
- func (u *User) HasAuthCerts() bool
- func (u *User) HasIDSKeys() bool
- func (u *User) HasValidIDCerts() bool
- func (u *User) Lookup(ctx context.Context, ownHandle uri.ParsedURI, params LookupParams, ...) (map[uri.ParsedURI]*LookupResult, error)
- func (u *User) LookupDevice(ctx context.Context, ownHandle, theirHandle uri.ParsedURI, wantedToken []byte, ...) (*LookupIdentity, error)
- func (u *User) LookupServer(ctx context.Context, ownHandle uri.ParsedURI, uris ...uri.ParsedURI) (map[uri.ParsedURI]*LookupResult, error)
- func (u *User) NeedsRefresh() bool
- func (u *User) PublicIdentity() *UserIdentity
- func (u *User) Register(ctx context.Context, handles map[string][]Handle, validationData []byte) error
- func (u *User) RegisterSpecificAuthCerts(ctx context.Context, handles map[string][]Handle, validationData []byte, ...) error
- func (u *User) TriggerReroute(ctx context.Context, url, token string) error
- func (u *User) UpdateHandles(ctx context.Context) (bool, map[string][]Handle, []string, error)
- func (u *User) UpdateHandlesIfChanged(ctx context.Context, handles []uri.ParsedURI) bool
- func (u *User) UploadAttachment(ctx context.Context, data []byte, filename, mimeType string) (*UploadedAttachment, error)
- func (u *User) VerifySignedPairECPayload(ctx context.Context, ourURI, theirURI uri.ParsedURI, ...) error
- func (u *User) VerifySignedPairPayload(ctx context.Context, ourURI, theirURI uri.ParsedURI, theirPushToken []byte, ...) error
- type UserIdentity
- type Versions
Constants ¶
View Source
const ( MinResultRefreshInterval = 1 * day MinNegativeResultRefreshInterval = 1 * time.Hour ResultExpiry = 7 * day )
View Source
const ChunkChecksumLength = 21
View Source
const MaxChunkSize = 5 * 1024 * 1024
View Source
const ProtocolVersion = "1640"
Variables ¶
View Source
var AppleEpoch = time.Date(2001, 1, 1, 0, 0, 0, 0, time.UTC)
View Source
var DeviceName = "beeper-imessage"
View Source
var NoLookupParams = LookupParams{}
Functions ¶
func GetGatewayByMCCMNC ¶
func ValidatePreKey ¶
func ValidatePreKey(key *idsproto.PublicDevicePrekey, deviceKey *ecdsa.PublicKey) bool
func VerifyKeyValidator ¶
func VerifyKeyValidator(keyValidator []byte, senderDeviceKey, receiverSigningKey, receiverPreKey *ec.CompactPublicKey) bool
func VerifySignedPairECPayload ¶
func VerifySignedPairECPayload(sharedSecret []byte, myPreKey, myDeviceKey *ec.CompactPublicKey, outer *idsproto.OuterMessage, pub *ec.CompactPublicKey) bool
func VerifySignedPairPayload ¶
func VerifySignedPairPayload(senderKey *UserIdentity, body ParsedBody) bool
Types ¶
type AttachmentDownloader ¶
type AttachmentDownloader struct { URL string OwnerID string Signature []byte DecryptionKey []byte MD *MMCSDownloader RawData []byte }
func NewAttachmentDownloader ¶
func NewAttachmentDownloader(url, ownerID string, signature, decryptionKey []byte) *AttachmentDownloader
func (*AttachmentDownloader) DownloadFile ¶
func (ad *AttachmentDownloader) DownloadFile(ctx context.Context, u *User, path string, progressFunc func(progress *DownloadProgress, save bool)) error
func (*AttachmentDownloader) DownloadMemory ¶
func (*AttachmentDownloader) GetFileSize ¶
func (ad *AttachmentDownloader) GetFileSize() int
type AuthIDCertPair ¶
type AuthIDCertPair struct { Added time.Time AuthCert *x509.Certificate IDCert *x509.Certificate RefreshNeeded bool }
type AuthResponse ¶
type ChunkChecksum ¶
type ChunkChecksum [ChunkChecksumLength]byte
type Config ¶
type Config struct { ProfileID string AuthPrivateKey *rsa.PrivateKey AuthIDCertPairs map[string]*AuthIDCertPair IDRegisteredAt time.Time PushKey *rsa.PrivateKey PushCert *x509.Certificate PushToken []byte PushGenVersion int PushGenRetried bool IDSEncryptionKey *rsa.PrivateKey IDSSigningKey *ecdsa.PrivateKey NGMDeviceKey *ec.CompactPrivateKey NGMPreKey *ec.CompactPrivateKey Handles []uri.ParsedURI DefaultHandle uri.ParsedURI PreferredHandle uri.ParsedURI SMSForwarding *SMSForwarding Versions DeviceUUID uuid.UUID // WARNING: This is being used to determine if the user logged in at a time // when pair-ec registration was enabled. If this is zero, then we know // that the user might have been registered before pair-ec was enabled. LoggedInAt time.Time LastLoginTestAt time.Time }
func (*Config) MarshalJSON ¶
func (*Config) ToJSONConfig ¶
func (c *Config) ToJSONConfig() *JSONConfig
func (*Config) UnmarshalJSON ¶
type DependentRegistration ¶
type DependentRegistration struct { ClientData LookupIdentityClientData `plist:"client-data"` DeviceName string `plist:"device-name"` HardwareVersion string `plist:"hardware-version"` Identities []Handle `plist:"identities"` IsHSATrustedDevice bool `plist:"is-hsa-trusted-device"` PrivateDeviceData PrivateDeviceData `plist:"private-device-data"` PushToken []byte `plist:"push-token"` SelfHandle string `plist:"self-handle"` Service apns.Topic `plist:"service"` SubServices []apns.Topic `plist:"sub-services"` // This contains phone number URIs for iPhones that have registered a phone number LinkedUserURI []uri.ParsedURI `plist:"linked-user-uri"` }
type DownloadChunk ¶
type DownloadChunk struct { Downloaded bool Checksum ChunkChecksum // Size is the number of bytes in this chunk. Size int // Offset is the byte offset from the start of the container containing this chunk. Offset int // OffsetInFile is the byte offset of this chunk from the start of the entire file. OffsetInFile int64 }
type DownloadContainer ¶
type DownloadContainer struct { Downloaded bool Chunks []DownloadChunk Request *mmcsproto.HTTPRequest CLAuthP1 string CLAuthP2 string }
func (*DownloadContainer) Download ¶
func (dc *DownloadContainer) Download(ctx context.Context, ua Versions) (*mmcsproto.ConfirmResponse_Request, []byte, error)
func (*DownloadContainer) DownloadAndWriteChunk ¶
func (dc *DownloadContainer) DownloadAndWriteChunk(ctx context.Context, prog *DownloadProgress, ua Versions, chunk *DownloadChunk, into io.WriterAt) (*mmcsproto.ConfirmResponse_Request, error)
type DownloadProgress ¶
type DownloadProgress struct { Prepared bool `json:"prepared"` Allocated bool `json:"allocated"` GetCompleted bool `json:"get_completed"` DownloadedBytes int `json:"downloaded_bytes"` DecryptedBytes int `json:"decrypted_bytes"` Size int `json:"total_bytes"` // contains filtered or unexported fields }
func (*DownloadProgress) Percent ¶
func (dp *DownloadProgress) Percent() float64
type InMemoryLookupCache ¶
type InMemoryLookupCache map[uriTuple]*LookupResult
func (InMemoryLookupCache) Get ¶
func (i InMemoryLookupCache) Get(_ context.Context, ourURI, theirURI uri.ParsedURI) (*LookupResult, error)
func (InMemoryLookupCache) Invalidate ¶
func (InMemoryLookupCache) MarkBroadcasted ¶
func (InMemoryLookupCache) Put ¶
func (i InMemoryLookupCache) Put(_ context.Context, ourURI, theirURI uri.ParsedURI, result *LookupResult) error
type InMemoryOutgoingCounter ¶
type InMemoryOutgoingCounter struct {
Counter uint32
}
type InMemoryOutgoingCounterStore ¶
type InMemoryOutgoingCounterStore map[uri.ParsedURI]OutgoingCounter
func (InMemoryOutgoingCounterStore) Get ¶
func (s InMemoryOutgoingCounterStore) Get(ctx context.Context, theirURI uri.ParsedURI) (OutgoingCounter, error)
type InMemoryRerouteHistory ¶
func (InMemoryRerouteHistory) Clear ¶
func (i InMemoryRerouteHistory) Clear(_ context.Context) error
type JSONAuthIDCertPair ¶
type JSONAuthIDCertPair struct { Added time.Time `json:"added"` AuthCert JSONCertificate `json:"auth"` IDCert JSONCertificate `json:"id"` RefreshNeeded bool `json:"refresh_needed"` }
type JSONCertificate ¶
type JSONCertificate struct {
*x509.Certificate
}
func (*JSONCertificate) MarshalJSON ¶
func (c *JSONCertificate) MarshalJSON() ([]byte, error)
func (*JSONCertificate) Sha256Fingerprint ¶
func (c *JSONCertificate) Sha256Fingerprint() []byte
func (*JSONCertificate) UnmarshalJSON ¶
func (c *JSONCertificate) UnmarshalJSON(data []byte) error
func (*JSONCertificate) Unwrap ¶
func (c *JSONCertificate) Unwrap() *x509.Certificate
type JSONConfig ¶
type JSONConfig struct { Encryption struct { RSAKey JSONRSAPrivateKey `json:"rsa_key"` ECKey JSONECPrivateKey `json:"ec_key"` NGMDeviceKey JSONECPrivateKey `json:"ngm_device_key"` NGMPreKey JSONECPrivateKey `json:"ngm_pre_key"` } `json:"encryption"` DeviceUUID uuid.UUID `json:"device_uuid"` Handles []string `json:"handles"` DefaultHandle string `json:"default_handle"` PreferredHandle string `json:"preferred_handle"` AuthKey JSONRSAPrivateKey `json:"auth_key"` ProfileID string `json:"profile_id,omitempty"` AuthIDCertPairs map[string]*JSONAuthIDCertPair `json:"auth_id_cert_pairs"` RegisteredAt time.Time `json:"registered_at"` Push struct { Token []byte `json:"token"` Key JSONRSAPrivateKey `json:"key"` Cert JSONCertificate `json:"cert"` Version int `json:"version"` Retried bool `json:"retried,omitempty"` } `json:"push"` SMSForwarding *SMSForwarding `json:"sms_forwarding,omitempty"` Versions Versions `json:"versions"` LoggedInAt time.Time `json:"logged_in_at"` LastLoginTestAt time.Time `json:"last_login_test_at"` }
func (*JSONConfig) ToConfig ¶
func (c *JSONConfig) ToConfig() *Config
type JSONECPrivateKey ¶
type JSONECPrivateKey struct {
*ecdsa.PrivateKey
}
func (*JSONECPrivateKey) MarshalJSON ¶
func (k *JSONECPrivateKey) MarshalJSON() ([]byte, error)
func (*JSONECPrivateKey) UnmarshalJSON ¶
func (k *JSONECPrivateKey) UnmarshalJSON(data []byte) error
func (*JSONECPrivateKey) Unwrap ¶
func (k *JSONECPrivateKey) Unwrap() *ecdsa.PrivateKey
type JSONRSAPrivateKey ¶
type JSONRSAPrivateKey struct {
*rsa.PrivateKey
}
func (*JSONRSAPrivateKey) MarshalJSON ¶
func (k *JSONRSAPrivateKey) MarshalJSON() ([]byte, error)
func (*JSONRSAPrivateKey) Sha256Fingerprint ¶
func (k *JSONRSAPrivateKey) Sha256Fingerprint() []byte
func (*JSONRSAPrivateKey) UnmarshalJSON ¶
func (k *JSONRSAPrivateKey) UnmarshalJSON(data []byte) error
func (*JSONRSAPrivateKey) Unwrap ¶
func (k *JSONRSAPrivateKey) Unwrap() *rsa.PrivateKey
type LookupCache ¶
type LookupCache interface { Get(ctx context.Context, ourURI, theirURI uri.ParsedURI) (*LookupResult, error) GetMany(ctx context.Context, ourURI uri.ParsedURI, theirURIs []uri.ParsedURI) (map[uri.ParsedURI]*LookupResult, error) Put(ctx context.Context, ourURI, theirURI uri.ParsedURI, result *LookupResult) error Delete(ctx context.Context, ourURI, theirURI uri.ParsedURI) error Invalidate(ctx context.Context, ourURI, theirURI uri.ParsedURI) error Clear(ctx context.Context) error MarkBroadcasted(ctx context.Context, handle uri.ParsedURI, broadcasted ...uri.ParsedURI) error }
type LookupIdentity ¶
type LookupIdentity struct { ClientData LookupIdentityClientData `plist:"client-data" json:"client_data"` KTLoggableData *idsproto.KeyTransparencyLoggableData `plist:"kt-loggable-data" json:"kt_loggable_data"` PushToken []byte `plist:"push-token" json:"push_token"` SessionToken []byte `plist:"session-token" json:"session_token"` SessionTokenExpiresSeconds int `plist:"session-token-expires-seconds" json:"session_token_expires_seconds"` SessionTokenRefreshSeconds int `plist:"session-token-refresh-seconds" json:"session_token_refresh_seconds"` }
type LookupIdentityClientData ¶
type LookupIdentityClientData struct { PublicMessageIdentityKey *UserIdentity `json:"public_message_identity_key"` PublicDevicePrekey *idsproto.PublicDevicePrekey `json:"public_device_prekey"` NGMPublicIdentity *idsproto.NgmPublicIdentity `json:"ngm_public_identity"` Extra map[string]any `json:"extra"` }
func (*LookupIdentityClientData) MarshalPlist ¶
func (l *LookupIdentityClientData) MarshalPlist() (any, error)
func (*LookupIdentityClientData) UnmarshalPlist ¶
func (l *LookupIdentityClientData) UnmarshalPlist(unmarshal func(any) error) error
type LookupParams ¶
type LookupQuery ¶
type LookupResult ¶
type LookupResult struct { Identities []LookupIdentity `plist:"identities" json:"identities"` KTAccountKey []byte `plist:"kt-account-key" json:"kt_account_key"` SenderCorrelationIdentifier string `plist:"sender-correlation-identifier" json:"sender_correlation_identifier"` Status int `plist:"status" json:"status"` Time time.Time `plist:"-" json:"-"` Broadcasted bool `plist:"-" json:"-"` }
func (*LookupResult) FindIdentity ¶
func (lr *LookupResult) FindIdentity(pushToken []byte, requireNGMKey bool) *LookupIdentity
type LookupResults ¶
type LookupResults struct { // TODO plist doesn't like decoding into a map[uri.ParsedURI]LookupResult Results map[uri.PlainURI]*LookupResult `plist:"results"` Status int `plist:"status"` }
type MMCSDownloader ¶
type MMCSDownloader struct { AuthID string Signature []byte DecryptionKey []byte TotalSize int Containers []*DownloadContainer Confirmations []*mmcsproto.ConfirmResponse_Request Expiry time.Time }
func ParseMMCSAuthorizeGetResponse ¶
func ParseMMCSAuthorizeGetResponse(auth *mmcsproto.AuthorizeGetResponse, authID string, signature, decryptionKey []byte) (*MMCSDownloader, error)
func (*MMCSDownloader) Decrypt ¶
func (md *MMCSDownloader) Decrypt(ctx context.Context, prog *DownloadProgress, file ReadWriterAt) error
func (*MMCSDownloader) Download ¶
func (md *MMCSDownloader) Download(ctx context.Context, prog *DownloadProgress, ua Versions, into io.WriterAt) error
func (*MMCSDownloader) DownloadAndDecrypt ¶
func (md *MMCSDownloader) DownloadAndDecrypt(ctx context.Context, prog *DownloadProgress, ua Versions, into ReadWriterAt, authURL string) error
func (*MMCSDownloader) SendGetComplete ¶
type OutgoingCounter ¶
type OutgoingCounterStore ¶
type ParsedBody ¶
func ParseBody ¶
func ParseBody(payload []byte) (out ParsedBody, err error)
func (ParsedBody) Bytes ¶
func (pb ParsedBody) Bytes() []byte
type PreparedUpload ¶
type PrivateDeviceData ¶
type PrivateDeviceData struct { AP string `plist:"ap,omitempty"` // "0" on mac, "1" on iphone/ipad C string `plist:"c,omitempty"` // "1", not on Macs, only iPhones/iPads? D string `plist:"d,omitempty"` // Seconds (with floating point microseconds) since Apple epoch (2001-01-01 00:00 UTC) DT int `plist:"dt,omitempty"` // 1 on macs, 2 on iphones, 4 on ipads? perhaps device type? EC string `plist:"ec,omitempty"` // "1", not on Macs, only iPhones/iPads? GT string `plist:"gt,omitempty"` // "0" H string `plist:"h,omitempty"` // "1" KTF string `plist:"ktf,omitempty"` // "0" or "1" KTV int `plist:"ktv,omitempty"` // observed values: "70", 75, 81, 87 M string `plist:"m,omitempty"` // "0" on mac/ipad, "1" on iphone P string `plist:"p,omitempty"` // "0" on mac/ipad, "1" on iphone SoftwareBuild string `plist:"pb,omitempty"` // 22F82 SoftwareName string `plist:"pn,omitempty"` // "macOS" (or "iPhone OS" for ios) SoftwareVersion string `plist:"pv,omitempty"` // 13.4.1 S string `plist:"s,omitempty"` // "0" T string `plist:"t,omitempty"` // "0" UUID plistuuid.UUID `plist:"u,omitempty"` V string `plist:"v,omitempty"` // "1", version? }
type RegisterError ¶
type RegisterError struct { Alert *RegisterRespAlert Status types.IDSStatus UserID string }
func (RegisterError) Error ¶
func (re RegisterError) Error() string
func (RegisterError) Is ¶
func (re RegisterError) Is(other error) bool
func (RegisterError) Unwrap ¶
func (re RegisterError) Unwrap() error
type RegisterReq ¶
type RegisterReq struct { DeviceName string `plist:"device-name"` HardwareVersion string `plist:"hardware-version"` Language string `plist:"language"` OSVersion string `plist:"os-version"` SoftwareVersion string `plist:"software-version"` PrivateDeviceData PrivateDeviceData `plist:"private-device-data"` Services []RegisterService `plist:"services"` ValidationData []byte `plist:"validation-data"` }
type RegisterResp ¶
type RegisterResp struct { Message string `plist:"message"` Status types.IDSStatus `plist:"status"` Services []RegisterRespService `plist:"services"` RetryInterval int `plist:"retry-interval"` }
type RegisterRespAlert ¶
type RegisterRespAlert struct { Body string `plist:"body"` Button string `plist:"button"` Title string `plist:"title"` Action RegisterRespAlertAction `plist:"action"` }
type RegisterRespAlertAction ¶
type RegisterRespService ¶
type RegisterRespService struct { Service string `plist:"service"` Users []RegisterRespServiceUser `plist:"users"` Status types.IDSStatus `plist:"status"` }
type RegisterRespServiceUser ¶
type RegisterRespServiceUser struct { URIs []RespHandle `plist:"uris"` UserID string `plist:"user-id"` Cert []byte `plist:"cert"` Status types.IDSStatus `plist:"status"` Alert *RegisterRespAlert `plist:"alert"` }
type RegisterService ¶
type RegisterService struct { Capabilities []RegisterServiceCapabilities `plist:"capabilities"` Service apns.Topic `plist:"service"` SubServices []apns.Topic `plist:"sub-services"` Users []RegisterServiceUser `plist:"users"` }
type RegisterServiceUser ¶
type RerouteHistory ¶
type RespDependentRegistrations ¶
type RespDependentRegistrations struct { ExpiryEpochMillis int64 `plist:"expiry-epoch-milli-sec"` Status types.IDSStatus `plist:"status"` Registrations []DependentRegistration `plist:"registrations"` }
type RespHandle ¶
type SMSForwarding ¶
func (*SMSForwarding) GetHandle ¶
func (sf *SMSForwarding) GetHandle() uri.ParsedURI
func (*SMSForwarding) GetToken ¶
func (sf *SMSForwarding) GetToken() []byte
type SigningPayload ¶
type SigningPayload []byte
type UploadChunk ¶
type UploadedAttachment ¶
type UploadedAttachment struct { Name string `xml:"name,attr,omitempty"` Width int `xml:"width,attr"` Height int `xml:"height,attr"` Datasize int `xml:"datasize,attr,omitempty"` MimeType string `xml:"mime-type,attr,omitempty"` UTIType string `xml:"uti-type,attr,omitempty"` FileSize int `xml:"file-size,attr,omitempty"` MessagePart int `xml:"message-part,attr"` // don't omitempty, as we always require this, even if 0 MMCSSignatureHex string `xml:"mmcs-signature-hex,attr,omitempty"` MMCSURL string `xml:"mmcs-url,attr,omitempty"` MMCSOwner string `xml:"mmcs-owner,attr,omitempty"` DecryptionKey string `xml:"decryption-key,attr,omitempty"` InlineAttachment string `xml:"inline-attachment,attr,omitempty"` }
type User ¶
type User struct { *Config LookupCache LookupCache RerouteHistory RerouteHistory Conn *apns.Connection OutgoingCounterStore OutgoingCounterStore DontPublishKeys bool // contains filtered or unexported fields }
func NewUser ¶
func NewUser(conn *apns.Connection, cfg *Config, lookupCache LookupCache, rerouteHistory RerouteHistory, enablePairECSending bool, outgoingCounterStore OutgoingCounterStore, parentRegisterIDS parentRegisterIDS) *User
func (*User) Authenticate ¶
func (*User) DecryptSignedPairECPayload ¶
func (*User) DecryptSignedPairPayload ¶
func (u *User) DecryptSignedPairPayload(body ParsedBody) ([]byte, error)
func (*User) DeriveExistingPairECSharedSecret ¶
func (*User) DownloadAttachment ¶
func (*User) EncryptSignPairECPayload ¶
func (*User) EncryptSignPairPayload ¶
func (*User) EncryptSignPayload ¶
func (*User) GenerateLoggableData ¶
func (u *User) GenerateLoggableData() *idsproto.KeyTransparencyLoggableData
func (*User) GeneratePreKeyData ¶
func (*User) GetAuthCert ¶
func (*User) GetAuthCertSMS ¶
func (*User) GetDependentRegistrations ¶
func (*User) GetPhoneRegistrationHandle ¶
func (*User) HasAuthCerts ¶
func (*User) HasIDSKeys ¶
func (*User) HasValidIDCerts ¶
func (*User) LookupDevice ¶
func (*User) LookupServer ¶
func (u *User) LookupServer(ctx context.Context, ownHandle uri.ParsedURI, uris ...uri.ParsedURI) (map[uri.ParsedURI]*LookupResult, error)
LookupServer asks IDS whether the list of provided uris exist on iMessage and returns a map of results If the request completes successfully but the user is not on iMessage, the LookupResult in the map will have an empty list for the Identities array
func (*User) NeedsRefresh ¶
func (*User) PublicIdentity ¶
func (u *User) PublicIdentity() *UserIdentity
func (*User) RegisterSpecificAuthCerts ¶
func (*User) TriggerReroute ¶
func (*User) UpdateHandles ¶
func (*User) UpdateHandlesIfChanged ¶
func (*User) UploadAttachment ¶
func (*User) VerifySignedPairECPayload ¶
func (*User) VerifySignedPairPayload ¶
type UserIdentity ¶
func (*UserIdentity) Hash ¶
func (i *UserIdentity) Hash() []byte
func (*UserIdentity) MarshalBinary ¶
func (i *UserIdentity) MarshalBinary() ([]byte, error)
func (*UserIdentity) MarshalJSON ¶
func (i *UserIdentity) MarshalJSON() ([]byte, error)
func (*UserIdentity) ToBytes ¶
func (i *UserIdentity) ToBytes() []byte
func (*UserIdentity) UnmarshalBinary ¶
func (i *UserIdentity) UnmarshalBinary(data []byte) error
func (*UserIdentity) UnmarshalJSON ¶
func (i *UserIdentity) UnmarshalJSON(data []byte) error
type Versions ¶
type Versions struct { HardwareVersion string `json:"hardware_version"` SoftwareName string `json:"software_name"` SoftwareVersion string `json:"software_version"` SoftwareBuildID string `json:"software_build_id"` SerialNumber string `json:"serial_number,omitempty"` UniqueDeviceID string `json:"unique_device_id,omitempty"` }
func (*Versions) CombinedVersion ¶
func (*Versions) DefaultIfEmpty ¶
func (v *Versions) DefaultIfEmpty()
func (*Versions) IDSOSVersion ¶
func (*Versions) IMTransferUserAgent ¶
func (*Versions) MMEClientInfo ¶
func (*Versions) MarshalZerologObject ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.