Class Keyring.Builder

java.lang.Object
org.acemq.amqp.crypto.Keyring.Builder
Enclosing interface:
Keyring

public static final class Keyring.Builder extends Object
Collects keys for a Keyring that does not change while the process runs.
  • Method Details

    • add

      public Keyring.Builder add(String id, SecretKey key)
      Adds a key that can be read with but not written with.
      Parameters:
      id - the identifier messages carry
      key - the key
      Returns:
      this builder
    • current

      public Keyring.Builder current(String id, SecretKey key)
      Adds a key and makes it the one to write with.
      Parameters:
      id - the identifier messages will carry
      key - the key
      Returns:
      this builder
    • build

      public Keyring build()
      Returns:
      the keyring
      Throws:
      IllegalStateException - if no key was made current, because a keyring that cannot say what to write with is only half a keyring and the half that is missing would not be noticed until the first publish