def box_encrypt(plain_text, jwk_secret = nil, jwe = nil)
      epk_secret = nil
      jwk_public = self
      if jwk_secret.nil?
        epk_secret = jwk_secret = jwk_public.generate_key
      end
      if not jwk_secret.is_a?(JOSE::JWK)
        jwk_secret = JOSE::JWK.from(jwk_secret)
      end
      if jwe.nil?
        jwe = jwk_public.block_encryptor
      end
      if jwe.is_a?(Hash)
        jwe = JOSE::Map.new(jwe)
      end
      if jwe.is_a?(JOSE::Map)
        if jwe['apu'].nil?
          jwe = jwe.put('apu', jwk_secret.fields['kid'] || jwk_secret.thumbprint)
        end
        if jwe['apv'].nil?
          jwe = jwe.put('apv', jwk_public.fields['kid'] || jwk_public.thumbprint)
        end
        if jwe['epk'].nil?
          jwe = jwe.put('epk', jwk_secret.to_public_map)
        end
      end
      if epk_secret
        return JOSE::JWE.block_encrypt([jwk_public, jwk_secret], plain_text, jwe), epk_secret
      else
        return JOSE::JWE.block_encrypt([jwk_public, jwk_secret], plain_text, jwe)
      end
    end
def box_encrypt(plain_text, jwk_secret = nil, jwe = nil)
      epk_secret = nil
      jwk_public = self
      if jwk_secret.nil?
        epk_secret = jwk_secret = jwk_public.generate_key
      end
      if not jwk_secret.is_a?(JOSE::JWK)
        jwk_secret = JOSE::JWK.from(jwk_secret)
      end
      if jwe.nil?
        jwe = jwk_public.block_encryptor
      end
      if jwe.is_a?(Hash)
        jwe = JOSE::Map.new(jwe)
      end
      if jwe.is_a?(JOSE::Map)
        if jwe['apu'].nil?
          jwe = jwe.put('apu', jwk_secret.fields['kid'] || jwk_secret.thumbprint)
        end
        if jwe['apv'].nil?
          jwe = jwe.put('apv', jwk_public.fields['kid'] || jwk_public.thumbprint)
        end
        if jwe['epk'].nil?
          jwe = jwe.put('epk', jwk_secret.to_public_map)
        end
      end
      if epk_secret
        return JOSE::JWE.block_encrypt([jwk_public, jwk_secret], plain_text, jwe), epk_secret
      else
        return JOSE::JWE.block_encrypt([jwk_public, jwk_secret], plain_text, jwe)
      end
    end
Key Agreement encryption of `plain_text` by generating an ephemeral private key based on `other_public_jwk` curve.

 If no private key has been specified in `my_private_key`, it generates an ephemeral private key based on other public key curve.

 @see JOSE::JWK.box_decrypt
 @see JOSE::JWE.block_encrypt
 @param [String] plain_text
 @param [JOSE::JWK] jwk_secret
 @param [JOSE::JWE] jwe
 @return [JOSE::EncryptedMap, [JOSE::EncryptedMap, JOSE::JWK]]