TlsAEADCipher (Bouncy Castle Library 1.52 API Specification)

org.bouncycastle.crypto.tls

## Class TlsAEADCipher

- java.lang.Object
- - org.bouncycastle.crypto.tls.TlsAEADCipher

- All Implemented Interfaces:
    TlsCipher

      public class TlsAEADCipher
      extends java.lang.Object
      implements TlsCipher

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected TlsContext` | `context`
    `protected AEADBlockCipher` | `decryptCipher`
    `protected byte[]` | `decryptImplicitNonce`
    `protected AEADBlockCipher` | `encryptCipher`
    `protected byte[]` | `encryptImplicitNonce`
    `protected int` | `macSize`
    `protected int` | `nonce_explicit_length`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TlsAEADCipher(TlsContext context, AEADBlockCipher clientWriteCipher, AEADBlockCipher serverWriteCipher, int cipherKeySize, int macSize)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `decodeCiphertext(long seqNo, short type, byte[] ciphertext, int offset, int len)`
    `byte[]` | `encodePlaintext(long seqNo, short type, byte[] plaintext, int offset, int len)`
    `protected byte[]` | `getAdditionalData(long seqNo, short type, int len)`
    `int` | `getPlaintextLimit(int ciphertextLimit)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### context

          protected TlsContext context

    - #### macSize

          protected int macSize

    - #### nonce_explicit_length

          protected int nonce_explicit_length

    - #### encryptCipher

          protected AEADBlockCipher encryptCipher

    - #### decryptCipher

          protected AEADBlockCipher decryptCipher

    - #### encryptImplicitNonce

          protected byte[] encryptImplicitNonce

    - #### decryptImplicitNonce

          protected byte[] decryptImplicitNonce

  - ### Constructor Detail

    - #### TlsAEADCipher

          public TlsAEADCipher(TlsContext context,
                       AEADBlockCipher clientWriteCipher,
                       AEADBlockCipher serverWriteCipher,
                       int cipherKeySize,
                       int macSize)
                        throws java.io.IOException

      Throws:
        `java.io.IOException`

  - ### Method Detail

    - #### getPlaintextLimit

          public int getPlaintextLimit(int ciphertextLimit)

      Specified by:
        `getPlaintextLimit` in interface `TlsCipher`

    - #### encodePlaintext

          public byte[] encodePlaintext(long seqNo,
                               short type,
                               byte[] plaintext,
                               int offset,
                               int len)
                                 throws java.io.IOException

      Specified by:
        `encodePlaintext` in interface `TlsCipher`
      Throws:
        `java.io.IOException`

    - #### decodeCiphertext

          public byte[] decodeCiphertext(long seqNo,
                                short type,
                                byte[] ciphertext,
                                int offset,
                                int len)
                                  throws java.io.IOException

      Specified by:
        `decodeCiphertext` in interface `TlsCipher`
      Throws:
        `java.io.IOException`

    - #### getAdditionalData

          protected byte[] getAdditionalData(long seqNo,
                                 short type,
                                 int len)
                                      throws java.io.IOException

      Throws:
        `java.io.IOException`