Class AesDataCodec

java.lang.Object
org.geysermc.floodgate.core.crypto.DataCodec
org.geysermc.floodgate.core.crypto.aes.AesDataCodec

public final class AesDataCodec extends DataCodec
  • Constructor Details

    • AesDataCodec

      public AesDataCodec()
  • Method Details

    • init

      public void init(Key key)
      Description copied from class: DataCodec
      Initializes the instance by giving it the key it needs to sign/verify or encrypt/decrypt data
      Specified by:
      init in class DataCodec
      Parameters:
      key - the key used to sign/verify or encrypt/decrypt data
    • encode

      public List<ByteBuffer> encode(ByteBuffer plainText) throws Exception
      Description copied from class: DataCodec
      Encodes the given data using the Key provided in DataCodec.init(Key)
      Specified by:
      encode in class DataCodec
      Parameters:
      plainText - the data to encode
      Returns:
      the encoded data
      Throws:
      Exception - when the encoding failed
    • decode

      public ByteBuffer decode(List<ByteBuffer> ivAndCipherText) throws Exception
      Description copied from class: DataCodec
      Decodes the given data using the Key provided in DataCodec.init(Key)
      Specified by:
      decode in class DataCodec
      Parameters:
      ivAndCipherText - the data sections to decode
      Returns:
      the decoded data
      Throws:
      Exception - when the decoding failed