Package edu.iu.crypt

Interface WebKey.Builder<B extends WebKey.Builder<B>>

Type Parameters:
B - builder type
All Superinterfaces:
WebCertificateReference.Builder<B>, WebKeyReference.Builder<B>
All Known Implementing Classes:
JwkBuilder
Enclosing interface:
WebKey

public static interface WebKey.Builder<B extends WebKey.Builder<B>> extends WebKeyReference.Builder<B>
Builder interface for creating WebKey instances.
  • Method Details

    • type

      B type(WebKey.Type type)
      Sets the key type.
      Parameters:
      type - key type
      Returns:
      this
    • use

      B use(WebKey.Use use)
      Sets the public key use.
      Parameters:
      use - public key use
      Returns:
      this
    • ops

      B ops(WebKey.Operation... ops)
      Sets the key operations.
      Parameters:
      ops - key operations
      Returns:
      this
    • ephemeral

      B ephemeral()
      Generates a public/private key pair for the algorithm specified by WebKeyReference.Builder.algorithm(Algorithm) using the default size.
      Returns:
      this
    • ephemeral

      B ephemeral(WebKey.Algorithm algorithm)
      Generates a public/private key pair or secret key without setting WebKeyReference.Builder.algorithm(edu.iu.crypt.WebKey.Algorithm).
      Parameters:
      algorithm - algorithm the key will be used with
      Returns:
      this
    • ephemeral

      B ephemeral(WebEncryption.Encryption encryption)
      Generates an ephemeral content encryption key.
      Parameters:
      encryption - content encryption algorithm
      Returns:
      this
    • key

      B key(byte[] key)
      Adds raw key data.
      Parameters:
      key - raw key data
      Returns:
      this
    • key

      B key(PublicKey publicKey)
      Adds public key parameters.
      Parameters:
      publicKey - public key
      Returns:
      this
    • key

      B key(PrivateKey privateKey)
      Adds private key parameters.
      Parameters:
      privateKey - private key
      Returns:
      this
    • key

      B key(KeyPair keyPair)
      Sets both public and private keys from a KeyPair.
      Parameters:
      keyPair - key pair;
      Returns:
      this
    • build

      WebKey build()
      Builds the web key.
      Returns:
      WebKey