Class DataCodecKeyPair

java.lang.Object
org.geysermc.floodgate.core.crypto.DataCodec
org.geysermc.floodgate.core.crypto.DataCodecKeyPair
Direct Known Subclasses:
Ed25519DataCodec, RsaDataCodec

public abstract class DataCodecKeyPair extends DataCodec
  • Constructor Details

    • DataCodecKeyPair

      public DataCodecKeyPair(String algorithmName, String signatureAlgorithm)
  • 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
    • init

      public void init(KeyPair keyPair)
    • 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> dataSections) 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:
      dataSections - the data sections to decode
      Returns:
      the decoded data
      Throws:
      Exception - when the decoding failed