Class MlsCipherSuite

java.lang.Object
org.bouncycastle.mls.crypto.MlsCipherSuite

public class MlsCipherSuite extends Object
  • Field Details

    • MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519

      public static final short MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519
      See Also:
    • MLS_128_DHKEMP256_AES128GCM_SHA256_P256

      public static final short MLS_128_DHKEMP256_AES128GCM_SHA256_P256
      See Also:
    • MLS_128_DHKEMX25519_CHACHA20POLY1305_SHA256_Ed25519

      public static final short MLS_128_DHKEMX25519_CHACHA20POLY1305_SHA256_Ed25519
      See Also:
    • MLS_256_DHKEMX448_AES256GCM_SHA512_Ed448

      public static final short MLS_256_DHKEMX448_AES256GCM_SHA512_Ed448
      See Also:
    • MLS_256_DHKEMP521_AES256GCM_SHA512_P521

      public static final short MLS_256_DHKEMP521_AES256GCM_SHA512_P521
      See Also:
    • MLS_256_DHKEMX448_CHACHA20POLY1305_SHA512_Ed448

      public static final short MLS_256_DHKEMX448_CHACHA20POLY1305_SHA512_Ed448
      See Also:
    • MLS_256_DHKEMP384_AES256GCM_SHA384_P384

      public static final short MLS_256_DHKEMP384_AES256GCM_SHA384_P384
      See Also:
    • BCMLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519

      public static final MlsCipherSuite BCMLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519
    • BCMLS_128_DHKEMP256_AES128GCM_SHA256_P256

      public static final MlsCipherSuite BCMLS_128_DHKEMP256_AES128GCM_SHA256_P256
    • BCMLS_128_DHKEMX25519_CHACHA20POLY1305_SHA256_Ed25519

      public static final MlsCipherSuite BCMLS_128_DHKEMX25519_CHACHA20POLY1305_SHA256_Ed25519
    • BCMLS_256_DHKEMX448_AES256GCM_SHA512_Ed448

      public static final MlsCipherSuite BCMLS_256_DHKEMX448_AES256GCM_SHA512_Ed448
    • BCMLS_256_DHKEMP521_AES256GCM_SHA512_P521

      public static final MlsCipherSuite BCMLS_256_DHKEMP521_AES256GCM_SHA512_P521
    • BCMLS_256_DHKEMX448_CHACHA20POLY1305_SHA512_Ed448

      public static final MlsCipherSuite BCMLS_256_DHKEMX448_CHACHA20POLY1305_SHA512_Ed448
    • BCMLS_256_DHKEMP384_AES256GCM_SHA384_P384

      public static final MlsCipherSuite BCMLS_256_DHKEMP384_AES256GCM_SHA384_P384
    • ALL_SUPPORTED_SUITES

      public static final short[] ALL_SUPPORTED_SUITES
  • Constructor Details

    • MlsCipherSuite

      public MlsCipherSuite(short id, MlsSigner signer, MlsKdf kdf, MlsAead aead, org.bouncycastle.crypto.hpke.HPKE hpke)
  • Method Details

    • getSuite

      public static MlsCipherSuite getSuite(short id) throws Exception
      Throws:
      Exception
    • getSuiteID

      public short getSuiteID()
    • generateSignatureKeyPair

      public org.bouncycastle.crypto.AsymmetricCipherKeyPair generateSignatureKeyPair()
    • serializeSignaturePublicKey

      public byte[] serializeSignaturePublicKey(org.bouncycastle.crypto.params.AsymmetricKeyParameter key)
    • serializeSignaturePrivateKey

      public byte[] serializeSignaturePrivateKey(org.bouncycastle.crypto.params.AsymmetricKeyParameter key)
    • deserializeSignaturePrivateKey

      public org.bouncycastle.crypto.AsymmetricCipherKeyPair deserializeSignaturePrivateKey(byte[] priv)
    • signWithLabel

      public byte[] signWithLabel(byte[] priv, String label, byte[] content) throws IOException, org.bouncycastle.crypto.CryptoException
      Throws:
      IOException
      org.bouncycastle.crypto.CryptoException
    • verifyWithLabel

      public boolean verifyWithLabel(byte[] pub, String label, byte[] content, byte[] signature) throws IOException
      Throws:
      IOException
    • refHash

      public byte[] refHash(byte[] value, String label) throws IOException
      Throws:
      IOException
    • hash

      public byte[] hash(byte[] value) throws IOException
      Throws:
      IOException
    • decryptWithLabel

      public byte[] decryptWithLabel(byte[] priv, String label, byte[] context, byte[] kem_output, byte[] ciphertext) throws IOException, org.bouncycastle.crypto.InvalidCipherTextException
      Throws:
      IOException
      org.bouncycastle.crypto.InvalidCipherTextException
    • encryptWithLabel

      public byte[][] encryptWithLabel(byte[] pub, String label, byte[] context, byte[] plaintext) throws IOException, org.bouncycastle.crypto.InvalidCipherTextException
      Throws:
      IOException
      org.bouncycastle.crypto.InvalidCipherTextException
    • getHPKE

      public org.bouncycastle.crypto.hpke.HPKE getHPKE()
    • getKDF

      public MlsKdf getKDF()
    • getAEAD

      public MlsAead getAEAD()