Package edu.iu.crypt

Interface WebEncryption.Builder

All Known Implementing Classes:
JweBuilder
Enclosing interface:
WebEncryption

public static interface WebEncryption.Builder
Prepares a new encrypted message.
  • Method Details

    • compact

      Protects all header parameters except jwk and verifies inputs are valid for JWE compact serialization.
      Returns:
      this
    • protect

      Defines standard protected header parameters.
      Parameters:
      params - protected header parameters
      Returns:
      this
    • protect

      WebEncryption.Builder protect(String... params)
      Defines extended protected header parameters.
      Parameters:
      params - protected header parameter names
      Returns:
      this
    • aad

      WebEncryption.Builder aad(byte[] additionalData)
      Provides additional authentication data for protecting the encrypted content.
      Parameters:
      additionalData - additional authentication data
      Returns:
      this
    • addRecipient

      Adds a new recipient.
      Parameters:
      algorithm - key encryption algorithm
      Returns:
      WebEncryptionRecipient.Builder
    • encrypt

      default WebEncryption encrypt(String text)
      Encrypts data for sending to all recipients.
      Parameters:
      text - data to encrypt
      Returns:
      encrypted message
    • encrypt

      default WebEncryption encrypt(byte[] data)
      Encrypts data for sending to all recipients.
      Parameters:
      data - data to encrypt
      Returns:
      encrypted message
    • encrypt

      Encrypts data for sending to all recipients.
      Parameters:
      in - stream of data to encrypt
      Returns:
      encrypted message