You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a key package there are several options that can be set:
LeafNode extensions
KeyPackage extensions
NotBefore time
NotAfter time
These options should be configured via a new KeyPackageBuilder instead of the current combination of client configuration + properties passed directly to the generate_key_package_message function
Before (0.x)
Creating Key Packages
// Make a key package store that conforms to the KeyPackageStorage traitlet key_package_store = MyKeyPackageStore::new();let client = Client::builder().key_package_repo(key_package_store)// Transfer the ownership of the key package repo to a client via the ClientBuilder.key_package_lifetime(1000)// All generated key packages are valid for 1000 seconds
.....build();// Generate the key package and provide extensions as Defaultlet key_package = client.generate_key_package_message(Default::default(),Default::default()).unwrap();
After (1.x)
Creating Key Packages
// MyKeyPackageStore no longer needs to conform to KeyPackageStorage (trait no longer exists)let key_package_store = MyKeyPackageStore::new();let client = Client::builder()
....// No key package specific configuration .build();// Generate a key package and private datalet(kp_message, private_kp_data) = client.key_package_builder().valid_for_sec(1000)// Key package is valid for 1000 seconds.with_package_extension(ext1)// Add first extension.with_package_extension(ext2)// Add second extension.with_leaf_extension(some_leaf_extension)// Add leaf node extension.build().unwrap();// Independently store the generated secret keys in MyKeyPackageStore
key_package_store.write(private_kp_data).unwrap();
The text was updated successfully, but these errors were encountered:
tomleavy
changed the title
[WIP] [1.x] Externalize KeyPackageStorage and update key package generation API
[1.x] Externalize KeyPackageStorage and update key package generation API
Nov 11, 2024
Background:
Part of #211
Key Package Generation API
When creating a key package there are several options that can be set:
These options should be configured via a new KeyPackageBuilder instead of the current combination of client configuration + properties passed directly to the
generate_key_package_message
functionBefore (0.x)
Creating Key Packages
After (1.x)
Creating Key Packages
The text was updated successfully, but these errors were encountered: