def encrypt(jwk, jwe = nil)
      plain_text = to_binary
      if jwe.nil?
        jwk = JOSE::JWK.from(jwk)
        jwe = (jwk.is_a?(Array) ? jwk.last : jwk).block_encryptor
      end
      if jwe.is_a?(Hash)
        jwe = JOSE::Map.new(jwe)
      end
      if jwe.is_a?(JOSE::Map) and not jwe.has_key?('typ')
        jwe = jwe.put('typ', 'JWT')
      end
      return JOSE::JWK.block_encrypt(jwk, plain_text, jwe)
    end
def encrypt(jwk, jwe = nil)
      plain_text = to_binary
      if jwe.nil?
        jwk = JOSE::JWK.from(jwk)
        jwe = (jwk.is_a?(Array) ? jwk.last : jwk).block_encryptor
      end
      if jwe.is_a?(Hash)
        jwe = JOSE::Map.new(jwe)
      end
      if jwe.is_a?(JOSE::Map) and not jwe.has_key?('typ')
        jwe = jwe.put('typ', 'JWT')
      end
      return JOSE::JWK.block_encrypt(jwk, plain_text, jwe)
    end
Encrypts a {JOSE::JWT JOSE::JWT} using the `jwk` and the `jwe` algorithm.

 If `"typ"` is not specified in the `jwe`, `{ "typ" => "JWT" }` will be added.
 @see JOSE::JWK.block_encrypt
 @param [JOSE::JWK] jwk
 @param [JOSE::JWE] jwe
 @return [JOSE::EncryptedMap]