Interface WfAccount
This interface defines how a class representing a blockchain account used for Whiteflag interacts with WFJL classes. Blockchains do not have a central user account database, and even the concept of an account does not exist on some blockchains. Therefore, this Whiteflag account is merely an abstraction for information related to a Whiteflag participant, including oneself.
Because different blockchain use the concept of an account differently,
the actual implementation is blockchain-specific. This interface therefore
defines how an object representing a blockchain account of a Whiteflag
participiant must provide relevant information to instances of WFJL classes
such a WfMessage
. Information about a Whiteflag participant includes
the blockchain address, and encryption keys and authentication tokens used
with that address. Methods implementing this interface may return `null` if
certain data is unknown or does not exist for a particpant.
- Since:
- 1.1
-
Method Summary
Modifier and TypeMethodDescriptionReturns the blockchain address as a string in the encoding specified for that specific blockchainGets the authentication token sent with an A2 message to identify the originator associated with this accountGets the authentication URL sent with an A1 message used to identify the originator associated with this accountbyte[]
Provides the binary blockchain address indepent from the representation for that blockchainGets the own ECDH key pair used to negatiate keys with other participantsGets the other's ECDH public key used to negatioate a key with this participant's accountGets the shared encryption key with this participant's accountboolean
isSelf()
Checks if this is an own account
-
Method Details
-
isSelf
boolean isSelf()Checks if this is an own account- Returns:
- TRUE if own account, else FALSE if other's account
-
getAddress
String getAddress()Returns the blockchain address as a string in the encoding specified for that specific blockchainBlockchain addresses are encoded differently for different blockchains. For example, Bitcoin uses a modified Base58 encoding and Ethereum uses a hexadecimal string.
- Returns:
- a string with the blockchain address in the encoding used for that blockchain, or null if no known address
-
getBinaryAddress
byte[] getBinaryAddress()Provides the binary blockchain address indepent from the representation for that blockchainAlthough addresses of diffrent blockchains are encoded differently, they all are essentially a binary value. Whiteflag uses that binary value to bind cryptographic keys and tokens to an address.
- Returns:
- a byte array with the binary blockchain address
-
getAuthURL
URL getAuthURL()Gets the authentication URL sent with an A1 message used to identify the originator associated with this account- Returns:
- a URL pointing to the authentication data, or null if no known url
- Whiteflag standard x-reference:
- 5.1.2.1 Method 1: URL Validation
-
getAuthToken
WfAuthToken getAuthToken()Gets the authentication token sent with an A2 message to identify the originator associated with this account- Returns:
- the authentication token, or null if no knwon token
- Whiteflag standard x-reference:
- 5.1.2.2 Method 2: Shared Token Validation
-
getEcdhKeyPair
WfECDHKeyPair getEcdhKeyPair()Gets the own ECDH key pair used to negatiate keys with other participants- Returns:
- the ECDH public key, or null if no key pair available
- Whiteflag standard x-reference:
- 5.2.4 Message Encryption
-
getEcdhPublicKey
ECPublicKey getEcdhPublicKey()Gets the other's ECDH public key used to negatioate a key with this participant's account- Returns:
- the ECDH public key, or null is no public key available
- Whiteflag standard x-reference:
- 5.2.4 Message Encryption
-