All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.minestom.server.crypto.PlayerPublicKey Maven / Gradle / Ivy

There is a newer version: 7320437640
Show newest version
package net.minestom.server.crypto;

import net.minestom.server.network.NetworkBuffer;
import net.minestom.server.network.NetworkBufferTemplate;

import java.security.PublicKey;
import java.time.Instant;

import static net.minestom.server.network.NetworkBuffer.*;

/**
 * Player's public key used to sign chat messages
 */
public record PlayerPublicKey(Instant expiresAt, PublicKey publicKey, byte[] signature) {
    public static final NetworkBuffer.Type SERIALIZER = NetworkBufferTemplate.template(
            INSTANT_MS, PlayerPublicKey::expiresAt,
            PUBLIC_KEY, PlayerPublicKey::publicKey,
            BYTE_ARRAY, PlayerPublicKey::signature,
            PlayerPublicKey::new
    );
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy