Search in sources :

Example 1 with KeyGenerator

use of com.hedera.services.bdd.spec.keys.KeyGenerator in project hedera-services by hashgraph.

the class HapiFileCreate method generateWaclKey.

private void generateWaclKey(HapiApiSpec spec) {
    KeyGenerator generator = effectiveKeyGen();
    if (keyName.isPresent()) {
        waclKey = spec.registry().getKey(keyName.get());
        return;
    }
    if (waclControl.isPresent()) {
        SigControl control = waclControl.get();
        Assertions.assertEquals(SigControl.Nature.LIST, control.getNature(), "WACL must be a KeyList!");
        waclKey = spec.keys().generateSubjectTo(spec, control, generator);
    } else {
        waclKey = spec.keys().generate(spec, KeyFactory.KeyType.LIST, generator);
    }
}
Also used : SigControl(com.hedera.services.bdd.spec.keys.SigControl) KeyGenerator(com.hedera.services.bdd.spec.keys.KeyGenerator)

Aggregations

KeyGenerator (com.hedera.services.bdd.spec.keys.KeyGenerator)1 SigControl (com.hedera.services.bdd.spec.keys.SigControl)1