public class TokenIOAsync
extends java.lang.Object
implements java.io.Closeable
Modifier and Type | Method and Description |
---|---|
io.reactivex.Observable<java.lang.Boolean> |
aliasExists(io.token.proto.common.alias.AliasProtos.Alias alias)
Checks if a given alias already exists.
|
io.reactivex.Observable<java.lang.String> |
beginRecovery(io.token.proto.common.alias.AliasProtos.Alias alias)
Begins account recovery.
|
void |
close() |
io.reactivex.Observable<MemberAsync> |
completeRecovery(java.lang.String memberId,
java.util.List<io.token.proto.common.member.MemberProtos.MemberRecoveryOperation> recoveryOperations,
io.token.proto.common.security.SecurityProtos.Key privilegedKey,
CryptoEngine cryptoEngine)
Completes account recovery.
|
io.reactivex.Observable<MemberAsync> |
completeRecoveryWithDefaultRule(java.lang.String memberId,
java.lang.String verificationId,
java.lang.String code)
Completes account recovery if the default recovery rule was set.
|
io.reactivex.Observable<MemberAsync> |
createBusinessMember(io.token.proto.common.alias.AliasProtos.Alias alias)
Creates a new business-use Token member with a set of auto-generated keys and alias.
|
io.reactivex.Observable<MemberAsync> |
createClaimedMember(java.lang.String tokenRequestId)
Creates a new transient Token member and claims it for the creator of the token request
corresponding to the given token request ID.
|
io.reactivex.Observable<MemberAsync> |
createMember()
Creates a new personal-use Token member with a set of auto-generated keys and no alias.
|
io.reactivex.Observable<MemberAsync> |
createMember(io.token.proto.common.alias.AliasProtos.Alias alias)
Creates a new personal-use Token member with a set of auto-generated keys and and an alias.
|
io.reactivex.Observable<MemberAsync> |
createMember(io.token.proto.common.alias.AliasProtos.Alias alias,
io.token.proto.common.member.MemberProtos.CreateMemberType memberType)
Creates a new Token member with a set of auto-generated keys, an alias, and member type.
|
io.reactivex.Observable<MemberAsync> |
createMember(io.token.proto.common.alias.AliasProtos.Alias alias,
io.token.proto.common.member.MemberProtos.CreateMemberType memberType,
java.lang.String tokenRequestId)
Creates a new Token member with a set of auto-generated keys, an alias, and member type.
|
io.reactivex.Observable<io.token.proto.common.member.MemberProtos.MemberRecoveryOperation.Authorization> |
createRecoveryAuthorization(java.lang.String memberId,
io.token.proto.common.security.SecurityProtos.Key privilegedKey)
Create a recovery authorization for some agent to sign.
|
io.reactivex.Observable<java.lang.String> |
generateTokenRequestUrl(java.lang.String requestId)
Generate a Token request URL from a request ID, and state.
|
io.reactivex.Observable<java.lang.String> |
generateTokenRequestUrl(java.lang.String requestId,
java.lang.String state)
Generate a Token request URL from a request ID, and state.
|
io.reactivex.Observable<java.lang.String> |
generateTokenRequestUrl(java.lang.String requestId,
java.lang.String state,
java.lang.String csrfToken)
Generate a Token request URL from a request ID, a state, and a CSRF token.
|
io.reactivex.Observable<java.util.List<io.token.proto.common.bank.BankProtos.Bank>> |
getBanks(java.util.List<java.lang.String> bankIds,
java.lang.Integer page,
java.lang.Integer perPage)
Returns a list of token enabled banks.
|
io.reactivex.Observable<java.util.List<io.token.proto.common.bank.BankProtos.Bank>> |
getBanks(java.util.List<java.lang.String> bankIds,
java.lang.String search,
java.lang.String country,
java.lang.Integer page,
java.lang.Integer perPage,
java.lang.String sort)
Deprecated.
|
io.reactivex.Observable<java.util.List<io.token.proto.common.bank.BankProtos.Bank>> |
getBanks(java.util.List<java.lang.String> bankIds,
java.lang.String search,
java.lang.String country,
java.lang.Integer page,
java.lang.Integer perPage,
java.lang.String sort,
java.lang.String provider)
Returns a list of token enabled banks.
|
io.reactivex.Observable<java.util.List<io.token.proto.common.bank.BankProtos.Bank>> |
getBanks(java.lang.String search,
java.lang.String country,
java.lang.Integer page,
java.lang.Integer perPage,
java.lang.String sort)
Deprecated.
|
io.reactivex.Observable<java.util.List<io.token.proto.common.bank.BankProtos.Bank>> |
getBanks(java.lang.String search,
java.lang.String country,
java.lang.Integer page,
java.lang.Integer perPage,
java.lang.String sort,
java.lang.String provider)
Returns a list of token enabled banks.
|
io.reactivex.Observable<java.util.List<java.lang.String>> |
getBanksCountries(java.lang.String provider)
Returns a list of token enabled countries for banks.
|
io.reactivex.Observable<io.token.proto.common.blob.BlobProtos.Blob> |
getBlob(java.lang.String blobId)
Retrieves a blob from the server.
|
io.reactivex.Observable<MemberAsync> |
getMember(java.lang.String memberId)
Return a Member set up to use some Token member's keys (assuming we have them).
|
io.reactivex.Observable<java.lang.String> |
getMemberId(io.token.proto.common.alias.AliasProtos.Alias alias)
Looks up member id for a given alias.
|
io.reactivex.Observable<io.token.proto.common.member.MemberProtos.MemberRecoveryOperation> |
getRecoveryAuthorization(java.lang.String verificationId,
java.lang.String code,
io.token.proto.common.security.SecurityProtos.Key key)
Gets recovery authorization from Token.
|
io.reactivex.Observable<TokenRequestResult> |
getTokenRequestResult(java.lang.String tokenRequestId)
Get the token request result based on a token's tokenRequestId.
|
io.reactivex.Observable<io.token.proto.common.notification.NotificationProtos.NotifyStatus> |
invalidateNotification(java.lang.String notificationId)
Invalidate a notification.
|
io.reactivex.Observable<io.token.proto.common.notification.NotificationProtos.NotifyStatus> |
notifyAddKey(io.token.proto.common.alias.AliasProtos.Alias alias,
java.util.List<io.token.proto.common.security.SecurityProtos.Key> keys,
io.token.proto.common.notification.NotificationProtos.DeviceMetadata deviceMetadata)
Notifies to add a key.
|
io.reactivex.Observable<NotifyResult> |
notifyCreateAndEndorseToken(java.lang.String tokenRequestId,
java.util.List<io.token.proto.common.security.SecurityProtos.Key> keys,
io.token.proto.common.notification.NotificationProtos.DeviceMetadata deviceMetadata,
io.token.proto.common.member.MemberProtos.ReceiptContact receiptContact)
Notifies subscribed devices that a token should be created and endorsed.
|
io.reactivex.Observable<NotifyResult> |
notifyEndorseAndAddKey(io.token.proto.common.token.TokenProtos.TokenPayload tokenPayload,
java.util.List<io.token.proto.common.security.SecurityProtos.Key> keys,
io.token.proto.common.notification.NotificationProtos.DeviceMetadata deviceMetadata,
java.lang.String tokenRequestId,
java.lang.String bankId,
java.lang.String state,
io.token.proto.common.member.MemberProtos.ReceiptContact receiptContact)
Deprecated.
use notifyCreateAndEndorseToken instead
|
io.reactivex.Observable<io.token.proto.common.notification.NotificationProtos.NotifyStatus> |
notifyPaymentRequest(io.token.proto.common.token.TokenProtos.TokenPayload tokenPayload)
Sends a notification to request a payment.
|
io.reactivex.Observable<TokenRequestCallback> |
parseTokenRequestCallbackUrl(java.lang.String callbackUrl)
Parse the token request callback URL to extract the state and the token ID.
|
io.reactivex.Observable<TokenRequestCallback> |
parseTokenRequestCallbackUrl(java.lang.String callbackUrl,
java.lang.String csrfToken)
Parse the token request callback URL to extract the state and the token ID.
|
io.reactivex.Observable<DeviceInfo> |
provisionDevice(io.token.proto.common.alias.AliasProtos.Alias alias)
Provisions a new device for an existing user.
|
io.reactivex.Observable<TokenRequest> |
retrieveTokenRequest(java.lang.String requestId)
Return a TokenRequest that was previously stored.
|
io.reactivex.Observable<MemberAsync> |
setupMember(io.token.proto.common.alias.AliasProtos.Alias alias,
java.lang.String memberId)
Sets up a member given a specific ID of a member that already exists in the system.
|
TokenIO |
sync()
Returns a sync version of the API.
|
io.reactivex.Completable |
updateTokenRequest(java.lang.String requestId,
io.token.proto.common.token.TokenProtos.TokenRequestOptions options)
Updates an existing token request.
|
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public TokenIO sync()
public io.reactivex.Observable<java.lang.Boolean> aliasExists(io.token.proto.common.alias.AliasProtos.Alias alias)
alias
- alias to checktrue
if alias exists, false
otherwisepublic io.reactivex.Observable<java.lang.String> getMemberId(io.token.proto.common.alias.AliasProtos.Alias alias)
alias
- alias to checkpublic io.reactivex.Observable<MemberAsync> createMember(io.token.proto.common.alias.AliasProtos.Alias alias, io.token.proto.common.member.MemberProtos.CreateMemberType memberType)
alias
- nullable member alias to use, must be unique. If null, then no alias will
be created with the member.memberType
- the type of member to registerpublic io.reactivex.Observable<MemberAsync> createMember(io.token.proto.common.alias.AliasProtos.Alias alias, io.token.proto.common.member.MemberProtos.CreateMemberType memberType, @Nullable java.lang.String tokenRequestId)
alias
- nullable member alias to use, must be unique. If null, then no alias will
be created with the member.memberType
- the type of member to registertokenRequestId
- (optional) token request id. If used, then the member will be claimed
by the creator of the corresponding token request. Only works if memberType == TRANSIENT.public io.reactivex.Observable<MemberAsync> createMember()
public io.reactivex.Observable<MemberAsync> createMember(io.token.proto.common.alias.AliasProtos.Alias alias)
alias
- alias to associate with memberpublic io.reactivex.Observable<MemberAsync> createClaimedMember(java.lang.String tokenRequestId)
tokenRequestId
- token request idpublic io.reactivex.Observable<MemberAsync> createBusinessMember(io.token.proto.common.alias.AliasProtos.Alias alias)
alias
- alias to associated with memberpublic io.reactivex.Observable<MemberAsync> setupMember(io.token.proto.common.alias.AliasProtos.Alias alias, java.lang.String memberId)
Adds an alias and a set of auto-generated keys to the member.
alias
- nullable member alias to use, must be unique. If null, then no alias will
be created with the membermemberId
- member idpublic io.reactivex.Observable<DeviceInfo> provisionDevice(io.token.proto.common.alias.AliasProtos.Alias alias)
alias
- member id to provision the device forpublic io.reactivex.Observable<MemberAsync> getMember(java.lang.String memberId)
memberId
- member idpublic io.reactivex.Completable updateTokenRequest(java.lang.String requestId, io.token.proto.common.token.TokenProtos.TokenRequestOptions options)
requestId
- token request IDoptions
- new token request optionspublic io.reactivex.Observable<TokenRequest> retrieveTokenRequest(java.lang.String requestId)
requestId
- request idpublic io.reactivex.Observable<io.token.proto.common.notification.NotificationProtos.NotifyStatus> notifyAddKey(io.token.proto.common.alias.AliasProtos.Alias alias, java.util.List<io.token.proto.common.security.SecurityProtos.Key> keys, io.token.proto.common.notification.NotificationProtos.DeviceMetadata deviceMetadata)
alias
- alias to notifykeys
- keys that need approvaldeviceMetadata
- device metadata of the keyspublic io.reactivex.Observable<io.token.proto.common.notification.NotificationProtos.NotifyStatus> notifyPaymentRequest(io.token.proto.common.token.TokenProtos.TokenPayload tokenPayload)
tokenPayload
- the payload of a token to be sentpublic io.reactivex.Observable<NotifyResult> notifyCreateAndEndorseToken(java.lang.String tokenRequestId, @Nullable java.util.List<io.token.proto.common.security.SecurityProtos.Key> keys, @Nullable io.token.proto.common.notification.NotificationProtos.DeviceMetadata deviceMetadata, @Nullable io.token.proto.common.member.MemberProtos.ReceiptContact receiptContact)
tokenRequestId
- the token request ID to sendkeys
- keys to be addeddeviceMetadata
- device metadata of the keysreceiptContact
- optional receipt contact to send@Deprecated public io.reactivex.Observable<NotifyResult> notifyEndorseAndAddKey(io.token.proto.common.token.TokenProtos.TokenPayload tokenPayload, java.util.List<io.token.proto.common.security.SecurityProtos.Key> keys, io.token.proto.common.notification.NotificationProtos.DeviceMetadata deviceMetadata, @Nullable java.lang.String tokenRequestId, @Nullable java.lang.String bankId, @Nullable java.lang.String state, @Nullable io.token.proto.common.member.MemberProtos.ReceiptContact receiptContact)
tokenPayload
- the token payload to be sentkeys
- keys to be addeddeviceMetadata
- device metadata of the keystokenRequestId
- optional token request idbankId
- optional bank idstate
- optional token request state for signingreceiptContact
- optional receipt contactpublic io.reactivex.Observable<io.token.proto.common.notification.NotificationProtos.NotifyStatus> invalidateNotification(java.lang.String notificationId)
notificationId
- notification id to invalidatepublic io.reactivex.Observable<io.token.proto.common.blob.BlobProtos.Blob> getBlob(java.lang.String blobId)
blobId
- id of the blobpublic io.reactivex.Observable<java.lang.String> beginRecovery(io.token.proto.common.alias.AliasProtos.Alias alias)
alias
- the alias used to recoverpublic io.reactivex.Observable<io.token.proto.common.member.MemberProtos.MemberRecoveryOperation.Authorization> createRecoveryAuthorization(java.lang.String memberId, io.token.proto.common.security.SecurityProtos.Key privilegedKey)
memberId
- Id of member we claim to be.privilegedKey
- new privileged key we want to use.public io.reactivex.Observable<io.token.proto.common.member.MemberProtos.MemberRecoveryOperation> getRecoveryAuthorization(java.lang.String verificationId, java.lang.String code, io.token.proto.common.security.SecurityProtos.Key key) throws VerificationException
verificationId
- the verification idcode
- the codekey
- the privileged keyVerificationException
- if the code verification failspublic io.reactivex.Observable<MemberAsync> completeRecovery(java.lang.String memberId, java.util.List<io.token.proto.common.member.MemberProtos.MemberRecoveryOperation> recoveryOperations, io.token.proto.common.security.SecurityProtos.Key privilegedKey, CryptoEngine cryptoEngine)
memberId
- the member idrecoveryOperations
- the member recovery operationsprivilegedKey
- the privileged public key in the member recovery operationscryptoEngine
- the new crypto enginepublic io.reactivex.Observable<MemberAsync> completeRecoveryWithDefaultRule(java.lang.String memberId, java.lang.String verificationId, java.lang.String code)
memberId
- the member idverificationId
- the verification idcode
- the codepublic io.reactivex.Observable<java.util.List<io.token.proto.common.bank.BankProtos.Bank>> getBanks(@Nullable java.util.List<java.lang.String> bankIds, @Nullable java.lang.Integer page, @Nullable java.lang.Integer perPage)
bankIds
- If specified, return banks whose 'id' matches any one of the given ids
(case-insensitive). Can be at most 1000.page
- Result page to retrieve. Default to 1 if not specified.perPage
- Maximum number of records per page. Can be at most 200. Default to 200
if not specified.@Deprecated public io.reactivex.Observable<java.util.List<io.token.proto.common.bank.BankProtos.Bank>> getBanks(@Nullable java.lang.String search, @Nullable java.lang.String country, @Nullable java.lang.Integer page, @Nullable java.lang.Integer perPage, @Nullable java.lang.String sort)
search
- If specified, return banks whose 'name' or 'identifier' contains the given
search string (case-insensitive)country
- If specified, return banks whose 'country' matches the given ISO 3166-1
alpha-2 country code (case-insensitive)page
- Result page to retrieve. Default to 1 if not specified.perPage
- Maximum number of records per page. Can be at most 200. Default to 200
if not specified.sort
- The key to sort the results. Could be one of: name, provider and country.
Defaults to name if not specified.public io.reactivex.Observable<java.util.List<io.token.proto.common.bank.BankProtos.Bank>> getBanks(@Nullable java.lang.String search, @Nullable java.lang.String country, @Nullable java.lang.Integer page, @Nullable java.lang.Integer perPage, @Nullable java.lang.String sort, @Nullable java.lang.String provider)
search
- If specified, return banks whose 'name' or 'identifier' contains the given
search string (case-insensitive)country
- If specified, return banks whose 'country' matches the given ISO 3166-1
alpha-2 country code (case-insensitive)page
- Result page to retrieve. Default to 1 if not specified.perPage
- Maximum number of records per page. Can be at most 200. Default to 200
if not specified.sort
- The key to sort the results. Could be one of: name, provider and country.
Defaults to name if not specified.provider
- If specified, return banks whose 'provider' matches the given provider
(case insensitive).@Deprecated public io.reactivex.Observable<java.util.List<io.token.proto.common.bank.BankProtos.Bank>> getBanks(@Nullable java.util.List<java.lang.String> bankIds, @Nullable java.lang.String search, @Nullable java.lang.String country, @Nullable java.lang.Integer page, @Nullable java.lang.Integer perPage, @Nullable java.lang.String sort)
bankIds
- If specified, return banks whose 'id' matches any one of the given ids
(case-insensitive). Can be at most 1000.search
- If specified, return banks whose 'name' or 'identifier' contains the given
search string (case-insensitive)country
- If specified, return banks whose 'country' matches the given ISO 3166-1
alpha-2 country code (case-insensitive)page
- Result page to retrieve. Default to 1 if not specified.perPage
- Maximum number of records per page. Can be at most 200. Default to 200
if not specified.sort
- The key to sort the results. Could be one of: name, provider and country.
Defaults to name if not specified.public io.reactivex.Observable<java.util.List<io.token.proto.common.bank.BankProtos.Bank>> getBanks(@Nullable java.util.List<java.lang.String> bankIds, @Nullable java.lang.String search, @Nullable java.lang.String country, @Nullable java.lang.Integer page, @Nullable java.lang.Integer perPage, @Nullable java.lang.String sort, @Nullable java.lang.String provider)
bankIds
- If specified, return banks whose 'id' matches any one of the given ids
(case-insensitive). Can be at most 1000.search
- If specified, return banks whose 'name' or 'identifier' contains the given
search string (case-insensitive)country
- If specified, return banks whose 'country' matches the given ISO 3166-1
alpha-2 country code (case-insensitive)page
- Result page to retrieve. Default to 1 if not specified.perPage
- Maximum number of records per page. Can be at most 200. Default to 200
if not specified.sort
- The key to sort the results. Could be one of: name, provider and country.
Defaults to name if not specified.provider
- If specified, return banks whose 'provider' matches the given provider
(case insensitive).public io.reactivex.Observable<java.util.List<java.lang.String>> getBanksCountries(java.lang.String provider)
provider
- If specified, return banks whose 'provider' matches the given provider
(case insensitive).public io.reactivex.Observable<java.lang.String> generateTokenRequestUrl(java.lang.String requestId)
requestId
- request idpublic io.reactivex.Observable<java.lang.String> generateTokenRequestUrl(java.lang.String requestId, java.lang.String state)
requestId
- request idstate
- statepublic io.reactivex.Observable<java.lang.String> generateTokenRequestUrl(java.lang.String requestId, java.lang.String state, java.lang.String csrfToken)
requestId
- request idstate
- statecsrfToken
- csrf tokenpublic io.reactivex.Observable<TokenRequestCallback> parseTokenRequestCallbackUrl(java.lang.String callbackUrl)
callbackUrl
- token request callback urlpublic io.reactivex.Observable<TokenRequestCallback> parseTokenRequestCallbackUrl(java.lang.String callbackUrl, java.lang.String csrfToken)
callbackUrl
- token request callback urlcsrfToken
- csrfTokenpublic io.reactivex.Observable<TokenRequestResult> getTokenRequestResult(java.lang.String tokenRequestId)
tokenRequestId
- token request id