@@ -36,31 +36,24 @@ pub struct SDJWTIssuer {
36
36
pub serialized_sd_jwt : String ,
37
37
}
38
38
39
+ /// SDJWTClaimsStrategy is used to determine which claims can be selectively disclosed later by the holder.
39
40
pub enum SDJWTClaimsStrategy < ' a > {
40
- // Full disclosure
41
+ /// No claims can be selectively disclosed. Full disclosure.
41
42
No ,
42
- // Top-level selective disclosure , nested objects as full disclosure
43
+ /// Top-level claims can be selectively disclosed , nested objects are fully disclosed.
43
44
Flat ,
44
- // Full recursive selective disclosure
45
+ /// All claims can be selectively disclosed (recursively including nested objects).
45
46
Full ,
46
- //TODO gather JSONPaths to point the claims to be SD
47
+ /// Claims can be selectively disclosed based on the provided JSONPaths. Other claims are fully disclosed.
48
+ /// # Examples
49
+ /// ```
50
+ /// use sd_jwt_rs::issuer::SDJWTClaimsStrategy;
51
+ ///
52
+ /// let strategy = SDJWTClaimsStrategy::Partial(vec!["$.address", "$.address.street_address"]);
53
+ /// ```
47
54
Partial ( Vec < & ' a str > ) ,
48
55
}
49
56
50
- /// SDJWTClaimsStrategy is used to determine which claims can be selectively disclosed later by the holder.
51
- ///
52
- /// The following strategies are supported:
53
- /// * No: No claims can be selectively disclosed.
54
- /// * Flat: Top-level claims can be selectively disclosed, nested objects are fully disclosed.
55
- /// * Full: All claims can be selectively disclosed.
56
- /// * Partial: Claims can be selectively disclosed based on the provided JSONPaths.
57
- ///
58
- /// # Examples
59
- /// ```
60
- /// use sd_jwt_rs::issuer::SDJWTClaimsStrategy;
61
- ///
62
- /// let strategy = SDJWTClaimsStrategy::Partial(vec!["$.address", "$.address.street_address"]);
63
- /// ```
64
57
impl < ' a > SDJWTClaimsStrategy < ' a > {
65
58
fn finalize_input ( & mut self ) -> Result < ( ) > {
66
59
match self {
@@ -156,7 +149,7 @@ impl SDJWTIssuer {
156
149
///
157
150
/// # Arguments
158
151
/// * `user_claims` - The claims to be included in the SD-JWT.
159
- /// * `sd_strategy` - The strategy to be used to determine which claims to be selectively disclosed. See SDJWTClaimsStrategy for more details.
152
+ /// * `sd_strategy` - The strategy to be used to determine which claims to be selectively disclosed. See [ SDJWTClaimsStrategy] for more details.
160
153
/// * `holder_key` - The key used to sign the SD-JWT. If not provided, no key binding is added to the SD-JWT.
161
154
/// * `add_decoy_claims` - If true, decoy claims are added to the SD-JWT.
162
155
/// * `serialization_format` - The serialization format to be used for the SD-JWT. Only "compact" and "json" formats are supported.
0 commit comments