public class SignalServiceAccountManager
extends java.lang.Object
| Constructor and Description |
|---|
SignalServiceAccountManager(java.lang.String url,
TrustStore trustStore,
java.lang.String user,
java.lang.String password,
java.lang.String userAgent)
Construct a SignalServiceAccountManager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDevice(java.lang.String deviceIdentifier,
org.whispersystems.libsignal.ecc.ECPublicKey deviceKey,
org.whispersystems.libsignal.IdentityKeyPair identityKeyPair,
java.lang.String code) |
java.lang.String |
getAccountVerificationToken() |
org.whispersystems.libsignal.util.guava.Optional<ContactTokenDetails> |
getContact(java.lang.String e164number)
Checks whether a contact is currently registered with the server.
|
java.util.List<ContactTokenDetails> |
getContacts(java.util.Set<java.lang.String> e164numbers)
Checks which contacts in a set are registered with the server.
|
java.util.List<DeviceInfo> |
getDevices() |
java.lang.String |
getNewDeviceVerificationCode() |
int |
getPreKeysCount() |
SignedPreKeyEntity |
getSignedPreKey() |
void |
removeDevice(long deviceId) |
void |
requestSmsVerificationCode()
Request an SMS verification code.
|
void |
requestVoiceVerificationCode()
Request a Voice verification code.
|
void |
setAccountAttributes(java.lang.String signalingKey,
int signalProtocolRegistrationId,
boolean voice)
Refresh account attributes with server.
|
void |
setGcmId(org.whispersystems.libsignal.util.guava.Optional<java.lang.String> gcmRegistrationId)
Register/Unregister a Google Cloud Messaging registration ID.
|
void |
setPreKeys(org.whispersystems.libsignal.IdentityKey identityKey,
org.whispersystems.libsignal.state.PreKeyRecord lastResortKey,
org.whispersystems.libsignal.state.SignedPreKeyRecord signedPreKey,
java.util.List<org.whispersystems.libsignal.state.PreKeyRecord> oneTimePreKeys)
Register an identity key, last resort key, signed prekey, and list of one time prekeys
with the server.
|
void |
setSignedPreKey(org.whispersystems.libsignal.state.SignedPreKeyRecord signedPreKey)
Set the client's signed prekey.
|
void |
verifyAccountWithCode(java.lang.String verificationCode,
java.lang.String signalingKey,
int signalProtocolRegistrationId,
boolean voice)
Verify a Signal Service account with a received SMS or voice verification code.
|
void |
verifyAccountWithToken(java.lang.String verificationToken,
java.lang.String signalingKey,
int axolotlRegistrationId,
boolean voice)
Verify a Signal Service account with a signed token from a trusted source.
|
public SignalServiceAccountManager(java.lang.String url,
TrustStore trustStore,
java.lang.String user,
java.lang.String password,
java.lang.String userAgent)
url - The URL for the Signal Service.trustStore - The TrustStore for the SignalService server's TLS certificate.user - A Signal Service phone number.password - A Signal Service password.userAgent - A string which identifies the client software.public void setGcmId(org.whispersystems.libsignal.util.guava.Optional<java.lang.String> gcmRegistrationId)
throws java.io.IOException
gcmRegistrationId - The GCM id to register. A call with an absent value will unregister.java.io.IOExceptionpublic void requestSmsVerificationCode()
throws java.io.IOException
java.io.IOExceptionpublic void requestVoiceVerificationCode()
throws java.io.IOException
java.io.IOExceptionpublic void verifyAccountWithCode(java.lang.String verificationCode,
java.lang.String signalingKey,
int signalProtocolRegistrationId,
boolean voice)
throws java.io.IOException
verificationCode - The verification code received via SMS or Voice
(see requestSmsVerificationCode() and
requestVoiceVerificationCode()).signalingKey - 52 random bytes. A 32 byte AES key and a 20 byte Hmac256 key,
concatenated.signalProtocolRegistrationId - A random 14-bit number that identifies this Signal install.
This value should remain consistent across registrations for the
same install, but probabilistically differ across registrations
for separate installs.voice - A boolean that indicates whether the client supports secure voice (RedPhone) calls.java.io.IOExceptionpublic void verifyAccountWithToken(java.lang.String verificationToken,
java.lang.String signalingKey,
int axolotlRegistrationId,
boolean voice)
throws java.io.IOException
verificationToken - The signed token provided by a trusted server.signalingKey - 52 random bytes. A 32 byte AES key and a 20 byte Hmac256 key,
concatenated.axolotlRegistrationId - A random 14-bit number that identifies this Signal install.
This value should remain consistent across registrations for the
same install, but probabilistically differ across registrations
for separate installs.voice - A boolean that indicates whether the client supports secure voice (RedPhone) calls.java.io.IOExceptionpublic void setAccountAttributes(java.lang.String signalingKey,
int signalProtocolRegistrationId,
boolean voice)
throws java.io.IOException
signalingKey - 52 random bytes. A 32 byte AES key and a 20 byte Hmac256 key, concatenated.signalProtocolRegistrationId - A random 14-bit number that identifies this Signal install.
This value should remain consistent across registrations for the same
install, but probabilistically differ across registrations for
separate installs.voice - A boolean that indicates whether the client supports secure voice (RedPhone)java.io.IOExceptionpublic void setPreKeys(org.whispersystems.libsignal.IdentityKey identityKey,
org.whispersystems.libsignal.state.PreKeyRecord lastResortKey,
org.whispersystems.libsignal.state.SignedPreKeyRecord signedPreKey,
java.util.List<org.whispersystems.libsignal.state.PreKeyRecord> oneTimePreKeys)
throws java.io.IOException
identityKey - The client's long-term identity keypair.lastResortKey - The client's "last resort" prekey.signedPreKey - The client's signed prekey.oneTimePreKeys - The client's list of one-time prekeys.java.io.IOExceptionpublic int getPreKeysCount()
throws java.io.IOException
java.io.IOExceptionpublic void setSignedPreKey(org.whispersystems.libsignal.state.SignedPreKeyRecord signedPreKey)
throws java.io.IOException
signedPreKey - The client's new signed prekey.java.io.IOExceptionpublic SignedPreKeyEntity getSignedPreKey() throws java.io.IOException
java.io.IOExceptionpublic org.whispersystems.libsignal.util.guava.Optional<ContactTokenDetails> getContact(java.lang.String e164number) throws java.io.IOException
e164number - The contact to check.java.io.IOExceptionpublic java.util.List<ContactTokenDetails> getContacts(java.util.Set<java.lang.String> e164numbers) throws java.io.IOException
e164numbers - The contacts to check.java.io.IOExceptionpublic java.lang.String getAccountVerificationToken()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getNewDeviceVerificationCode()
throws java.io.IOException
java.io.IOExceptionpublic void addDevice(java.lang.String deviceIdentifier,
org.whispersystems.libsignal.ecc.ECPublicKey deviceKey,
org.whispersystems.libsignal.IdentityKeyPair identityKeyPair,
java.lang.String code)
throws org.whispersystems.libsignal.InvalidKeyException,
java.io.IOException
org.whispersystems.libsignal.InvalidKeyExceptionjava.io.IOExceptionpublic java.util.List<DeviceInfo> getDevices() throws java.io.IOException
java.io.IOExceptionpublic void removeDevice(long deviceId)
throws java.io.IOException
java.io.IOException