With this factory, you will be able to create the JWEBuilder you need:
1
$jweBuilder=$jweBuilderFactory->create(
2
['A256GCMKW'],
3
['A256CBC-HS256'],
4
['DEF']// Compression methods
5
);
Copied!
Available compression methods are:
DEF: deflate (recommended)
GZ: gzip
ZLIB: zlib
You can now use the JWEBuilder as explained in the JWE Creation section.
JWE Builder As Service
There is also another way to create a JWEBuilder object: using the bundle configuration.
1
jose:
2
jwe:
3
builders:
4
builder1:
5
key_encryption_algorithms:['A256GCMKW']
6
content_encryption_algorithms:['A256CBC-HS256']
7
compression_methods:['DEF']
8
is_public:true
Copied!
With the previous configuration, the bundle will create a public JWE Builder service named jose.jwe_builder.builder1 with selected encryption algorithms.