6
6
7
7
import org .apache .commons .codec .DecoderException ;
8
8
import picocli .CommandLine ;
9
+ import picocli .CommandLine .HelpCommand ;
9
10
import picocli .CommandLine .Option ;
10
11
11
12
import javax .crypto .BadPaddingException ;
36
37
37
38
import javax .net .ssl .TrustManager ;
38
39
39
- @ CommandLine .Command (name = "tdf" )
40
+ @ CommandLine .Command (name = "tdf" , subcommands = { HelpCommand . class } )
40
41
class Command {
41
42
42
43
@ Option (names = { "--client-secret" }, required = true )
@@ -137,7 +138,8 @@ void createNanoTDF(
137
138
@ Option (names = { "-f" , "--file" }, defaultValue = Option .NULL_VALUE ) Optional <File > file ,
138
139
@ Option (names = { "-k" , "--kas-url" }, required = true ) List <String > kas ,
139
140
@ Option (names = { "-m" , "--metadata" }, defaultValue = Option .NULL_VALUE ) Optional <String > metadata ,
140
- @ Option (names = { "-a" , "--attr" }, defaultValue = Option .NULL_VALUE ) Optional <String > attributes )
141
+ @ Option (names = { "-a" , "--attr" }, defaultValue = Option .NULL_VALUE ) Optional <String > attributes ,
142
+ @ Option (names = { "--ecdsa-binding" }, defaultValue = Option .NULL_VALUE ) Optional <Boolean > ecdsaBinding )
141
143
throws Exception {
142
144
143
145
var sdk = buildSDK ();
@@ -152,6 +154,9 @@ void createNanoTDF(
152
154
attributes .ifPresent (attr -> {
153
155
configs .add (Config .witDataAttributes (attr .split ("," )));
154
156
});
157
+ if (ecdsaBinding .orElse (false )) {
158
+ configs .add (Config .WithECDSAPolicyBinding ());
159
+ };
155
160
156
161
var nanoTDFConfig = Config .newNanoTDFConfig (configs .toArray (Consumer []::new ));
157
162
try (var in = file .isEmpty () ? new BufferedInputStream (System .in ) : new FileInputStream (file .get ())) {
0 commit comments