OdinAccessKey
Class to handle ODIN access keys.
An access key is a 44 character long Base64-String, which consists of a version, random bytes and a checksum.
Properties
rawValue
The underlying access key as a string.
id
The key ID of the access key. This is included in room tokens, making it possible to identify which public key must be used for verification.
publicKey
The public key of the access key. The public key is based on the Ed25519 curve and must be submitted to 4Players so that a generated room token can be verified.
secretKey
The secret key of the access key. The secret key is based on the Ed25519 curve and used to sign a generated room token to access the ODIN network.
Methods
init()
Initializes a new access key instance.
init(_:)
Initializes an access key instance using an existing access key string.
deinit
Destroys the underlying token generator instance.
generateToken(roomId:userId:)
Uses the internal token generator to create a signed JWT based of this access key, which can be used by a client to join a room.