diff --git a/Cargo.toml b/Cargo.toml index 79e1d2228..621c32090 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssi" -version = "0.14.0" +version = "0.15.0" authors = ["Spruce Systems, Inc."] edition = "2021" license = "Apache-2.0" @@ -26,46 +26,46 @@ members = [ ssi-core = { path = "./crates/core", version = "0.3.0", default-features = false } ssi-multicodec = { path = "./crates/multicodec", version = "0.2", default-features = false } ssi-crypto = { path = "./crates/crypto", version = "0.2.1", default-features = false } -ssi-verification-methods-core = { path = "./crates/verification-methods/core", version = "0.2", default-features = false } -ssi-verification-methods = { path = "./crates/verification-methods", version = "0.2", default-features = false } +ssi-verification-methods-core = { path = "./crates/verification-methods/core", version = "0.3", default-features = false } +ssi-verification-methods = { path = "./crates/verification-methods", version = "0.3", default-features = false } ssi-jwk = { path = "./crates/jwk", version = "0.4", default-features = false } -ssi-tzkey = { path = "./crates/tzkey", version = "0.3", default-features = false } +ssi-tzkey = { path = "./crates/tzkey", version = "0.4", default-features = false } ssi-eip712 = { path = "./crates/eip712", version = "0.1", default-features = false } ssi-rdf = { path = "./crates/rdf", version = "0.1", default-features = false } ssi-contexts = { path = "./crates/contexts", version = "0.1.10", default-features = false } -ssi-json-ld = { path = "./crates/json-ld", version = "0.3.1", default-features = false } +ssi-json-ld = { path = "./crates/json-ld", version = "0.3.3", default-features = false } ssi-security = { path = "./crates/security", version = "0.1", default-features = false } ssi-caips = { path = "./crates/caips", version = "0.3", default-features = false } -ssi-ucan = { path = "./crates/ucan", version = "0.3", default-features = false } -ssi-zcap-ld = { path = "./crates/zcap-ld", version = "0.7", default-features = false } +ssi-ucan = { path = "./crates/ucan", version = "0.4", default-features = false } +ssi-zcap-ld = { path = "./crates/zcap-ld", version = "0.8", default-features = false } ssi-ssh = { path = "./crates/ssh", version = "0.3", default-features = false } -ssi-status = { path = "./crates/status", version = "0.7", default-features = false } +ssi-status = { path = "./crates/status", version = "0.8", default-features = false } ssi-bbs = { path = "./crates/bbs", version = "0.2", default-features = false } # Verifiable Claims ssi-claims-core = { path = "./crates/claims/core", version = "0.2.0", default-features = false } -ssi-jws = { path = "./crates/claims/crates/jws", version = "0.4", default-features = false } -ssi-jwt = { path = "./crates/claims/crates/jwt", version = "0.5", default-features = false } -ssi-sd-jwt = { path = "./crates/claims/crates/sd-jwt", version = "0.5", default-features = false } +ssi-jws = { path = "./crates/claims/crates/jws", version = "0.5", default-features = false } +ssi-jwt = { path = "./crates/claims/crates/jwt", version = "0.6", default-features = false } +ssi-sd-jwt = { path = "./crates/claims/crates/sd-jwt", version = "0.6", default-features = false } ssi-cose = { path = "./crates/claims/crates/cose", version = "0.2", default-features = false } -ssi-vc = { path = "./crates/claims/crates/vc", version = "0.8", default-features = false } -ssi-vc-jose-cose = { path = "./crates/claims/crates/vc-jose-cose", version = "0.6", default-features = false } -ssi-data-integrity-core = { path = "./crates/claims/crates/data-integrity/core", version = "0.4", default-features = false } +ssi-vc = { path = "./crates/claims/crates/vc", version = "0.9", default-features = false } +ssi-vc-jose-cose = { path = "./crates/claims/crates/vc-jose-cose", version = "0.7", default-features = false } +ssi-data-integrity-core = { path = "./crates/claims/crates/data-integrity/core", version = "0.5", default-features = false } ssi-di-sd-primitives = { path = "./crates/claims/crates/data-integrity/sd-primitives", version = "0.3", default-features = false } -ssi-data-integrity-suites = { path = "./crates/claims/crates/data-integrity/suites", version = "0.3", default-features = false } -ssi-data-integrity = { path = "./crates/claims/crates/data-integrity", version = "0.3", default-features = false } -ssi-claims = { path = "./crates/claims", version = "0.6", default-features = false } +ssi-data-integrity-suites = { path = "./crates/claims/crates/data-integrity/suites", version = "0.4", default-features = false } +ssi-data-integrity = { path = "./crates/claims/crates/data-integrity", version = "0.4", default-features = false } +ssi-claims = { path = "./crates/claims", version = "0.7", default-features = false } # DID methods -ssi-dids-core = { path = "./crates/dids/core", version = "0.2", default-features = false } -did-ethr = { path = "./crates/dids/methods/ethr", version = "0.4", default-features = false } -did-ion = { path = "./crates/dids/methods/ion", version = "0.5", default-features = false } -did-jwk = { path = "./crates/dids/methods/jwk", version = "0.3", default-features = false } -did-method-key = { path = "./crates/dids/methods/key", version = "0.4", default-features = false } -did-pkh = { path = "./crates/dids/methods/pkh", version = "0.4", default-features = false } -did-tz = { path = "./crates/dids/methods/tz", version = "0.4", default-features = false } -did-web = { path = "./crates/dids/methods/web", version = "0.4", default-features = false } -ssi-dids = { path = "./crates/dids", version = "0.4", default-features = false } +ssi-dids-core = { path = "./crates/dids/core", version = "0.3", default-features = false } +did-ethr = { path = "./crates/dids/methods/ethr", version = "0.5", default-features = false } +did-ion = { path = "./crates/dids/methods/ion", version = "0.6", default-features = false } +did-jwk = { path = "./crates/dids/methods/jwk", version = "0.4", default-features = false } +did-method-key = { path = "./crates/dids/methods/key", version = "0.5", default-features = false } +did-pkh = { path = "./crates/dids/methods/pkh", version = "0.5", default-features = false } +did-tz = { path = "./crates/dids/methods/tz", version = "0.5", default-features = false } +did-web = { path = "./crates/dids/methods/web", version = "0.5", default-features = false } +ssi-dids = { path = "./crates/dids", version = "0.5", default-features = false } # crypto digest = "0.10" diff --git a/crates/claims/Cargo.toml b/crates/claims/Cargo.toml index 3d1ee9439..d713e2b2b 100644 --- a/crates/claims/Cargo.toml +++ b/crates/claims/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssi-claims" -version = "0.6.0" +version = "0.7.0" edition = "2021" authors = ["Spruce Systems, Inc."] license = "Apache-2.0" diff --git a/crates/claims/crates/data-integrity/Cargo.toml b/crates/claims/crates/data-integrity/Cargo.toml index c04189be2..54274a156 100644 --- a/crates/claims/crates/data-integrity/Cargo.toml +++ b/crates/claims/crates/data-integrity/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssi-data-integrity" -version = "0.3.0" +version = "0.4.0" edition = "2021" authors = ["Spruce Systems, Inc."] license = "Apache-2.0" diff --git a/crates/claims/crates/data-integrity/core/Cargo.toml b/crates/claims/crates/data-integrity/core/Cargo.toml index f52876199..76b28af6c 100644 --- a/crates/claims/crates/data-integrity/core/Cargo.toml +++ b/crates/claims/crates/data-integrity/core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssi-data-integrity-core" -version = "0.4.0" +version = "0.5.0" edition = "2021" authors = ["Spruce Systems, Inc."] license = "Apache-2.0" diff --git a/crates/claims/crates/data-integrity/suites/Cargo.toml b/crates/claims/crates/data-integrity/suites/Cargo.toml index a259088e0..9b1a4cee4 100644 --- a/crates/claims/crates/data-integrity/suites/Cargo.toml +++ b/crates/claims/crates/data-integrity/suites/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssi-data-integrity-suites" -version = "0.3.0" +version = "0.4.0" edition = "2021" authors = ["Spruce Systems, Inc."] license = "Apache-2.0" diff --git a/crates/claims/crates/jws/Cargo.toml b/crates/claims/crates/jws/Cargo.toml index a2c228aff..71b17b544 100644 --- a/crates/claims/crates/jws/Cargo.toml +++ b/crates/claims/crates/jws/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssi-jws" -version = "0.4.0" +version = "0.5.0" edition = "2021" authors = ["Spruce Systems, Inc."] license = "Apache-2.0" diff --git a/crates/claims/crates/jws/src/signature.rs b/crates/claims/crates/jws/src/signature.rs index a21bab5f9..92db8f362 100644 --- a/crates/claims/crates/jws/src/signature.rs +++ b/crates/claims/crates/jws/src/signature.rs @@ -77,9 +77,54 @@ impl JwsPayload for serde_json::Value { } } +/// JWS Signer Information. +/// +/// This corresponds to all the JWS header fields related to the signer. +/// +/// The fields in this `struct` are marked as `non_exhaustive`, meaning you +/// won't be able to construct it directly without using [`JwsSignerInfo::new`]. +/// This is to allow us to progressively add support for new fields without +/// having to do a major release of `ssi`. +/// +/// See: +#[derive(Default, Clone)] +#[non_exhaustive] pub struct JwsSignerInfo { - pub key_id: Option, - pub algorithm: Algorithm, + /// JSON Web Key. + /// + /// Public key that corresponds to the key used to digitally sign the JWS. + /// + /// See: + pub jwk: Option, + + /// Key ID. + /// + /// Hint indicating which key was used to secure the JWS. + /// + /// See: + pub kid: Option, + + /// Cryptographic algorithm used to secure the JWS. + /// + /// See: + pub alg: Algorithm, + + /// X.509 Certificate Chain. + /// + /// Each string in the array is a base64-encoded DER PKIX certificate value. + /// + /// See: + pub x5c: Option>, +} + +impl JwsSignerInfo { + pub fn new(key_id: Option, algorithm: Algorithm) -> Self { + Self { + kid: key_id, + alg: algorithm, + ..Default::default() + } + } } /// JWS Signer. @@ -102,8 +147,10 @@ pub trait JwsSigner { let payload_bytes = payload.payload_bytes(); let header = Header { - algorithm: info.algorithm, - key_id: info.key_id, + algorithm: info.alg, + key_id: info.kid, + jwk: info.jwk, + x509_certificate_chain: info.x5c, content_type: payload.cty().map(ToOwned::to_owned), type_: payload.typ().map(ToOwned::to_owned), ..Default::default() @@ -207,10 +254,12 @@ impl JwsSigner for Cow<'_, T> { impl JwsSigner for JWK { async fn fetch_info(&self) -> Result { Ok(JwsSignerInfo { - key_id: self.key_id.clone(), - algorithm: self + jwk: None, // Intentionally not copying the JWK here, it is rarely wanted. + kid: self.key_id.clone(), + alg: self .get_algorithm() .ok_or(SignatureError::MissingAlgorithm)?, + x5c: self.x509_certificate_chain.clone(), }) } @@ -236,8 +285,8 @@ impl<'a> JwkWithAlgorithm<'a> { impl JwsSigner for JwkWithAlgorithm<'_> { async fn fetch_info(&self) -> Result { Ok(JwsSignerInfo { - key_id: self.jwk.key_id.clone(), - algorithm: self.algorithm, + alg: self.algorithm, + ..self.jwk.fetch_info().await? }) } diff --git a/crates/claims/crates/jwt/Cargo.toml b/crates/claims/crates/jwt/Cargo.toml index 03ccbab1a..e1b448d41 100644 --- a/crates/claims/crates/jwt/Cargo.toml +++ b/crates/claims/crates/jwt/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssi-jwt" -version = "0.5.0" +version = "0.6.0" edition = "2021" authors = ["Spruce Systems, Inc."] license = "Apache-2.0" diff --git a/crates/claims/crates/sd-jwt/Cargo.toml b/crates/claims/crates/sd-jwt/Cargo.toml index 532935770..16d815fa8 100644 --- a/crates/claims/crates/sd-jwt/Cargo.toml +++ b/crates/claims/crates/sd-jwt/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssi-sd-jwt" -version = "0.5.0" +version = "0.6.0" edition = "2021" authors = ["Spruce Systems, Inc."] license = "Apache-2.0" diff --git a/crates/claims/crates/vc-jose-cose/Cargo.toml b/crates/claims/crates/vc-jose-cose/Cargo.toml index 28855f042..036a92060 100644 --- a/crates/claims/crates/vc-jose-cose/Cargo.toml +++ b/crates/claims/crates/vc-jose-cose/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssi-vc-jose-cose" -version = "0.6.0" +version = "0.7.0" edition = "2021" authors = ["Spruce Systems, Inc."] license = "Apache-2.0" diff --git a/crates/claims/crates/vc/Cargo.toml b/crates/claims/crates/vc/Cargo.toml index d26e0d5a3..f5b692a70 100644 --- a/crates/claims/crates/vc/Cargo.toml +++ b/crates/claims/crates/vc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssi-vc" -version = "0.8.0" +version = "0.9.0" edition = "2021" authors = ["Spruce Systems, Inc."] license = "Apache-2.0" diff --git a/crates/dids/Cargo.toml b/crates/dids/Cargo.toml index 64bb99d27..f10ec8749 100644 --- a/crates/dids/Cargo.toml +++ b/crates/dids/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssi-dids" -version = "0.4.0" +version = "0.5.0" edition = "2021" authors = ["Spruce Systems, Inc."] license = "Apache-2.0" diff --git a/crates/dids/core/Cargo.toml b/crates/dids/core/Cargo.toml index 9134eaa60..1e7e20139 100644 --- a/crates/dids/core/Cargo.toml +++ b/crates/dids/core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssi-dids-core" -version = "0.2.0" +version = "0.3.0" edition = "2021" authors = ["Spruce Systems, Inc."] license = "Apache-2.0" diff --git a/crates/dids/methods/ethr/Cargo.toml b/crates/dids/methods/ethr/Cargo.toml index 1eb359db8..2f19f5b0c 100644 --- a/crates/dids/methods/ethr/Cargo.toml +++ b/crates/dids/methods/ethr/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "did-ethr" -version = "0.4.0" +version = "0.5.0" authors = ["Spruce Systems, Inc."] edition = "2021" license = "Apache-2.0" diff --git a/crates/dids/methods/ion/Cargo.toml b/crates/dids/methods/ion/Cargo.toml index d9c1b3773..3f080fbb0 100644 --- a/crates/dids/methods/ion/Cargo.toml +++ b/crates/dids/methods/ion/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "did-ion" -version = "0.5.0" +version = "0.6.0" authors = ["Spruce Systems, Inc."] edition = "2021" license = "Apache-2.0" diff --git a/crates/dids/methods/jwk/Cargo.toml b/crates/dids/methods/jwk/Cargo.toml index 681cd40d0..6a479a7a2 100644 --- a/crates/dids/methods/jwk/Cargo.toml +++ b/crates/dids/methods/jwk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "did-jwk" -version = "0.3.0" +version = "0.4.0" authors = ["Spruce Systems, Inc."] edition = "2021" license = "Apache-2.0" diff --git a/crates/dids/methods/key/Cargo.toml b/crates/dids/methods/key/Cargo.toml index 061334419..3f9ab966e 100644 --- a/crates/dids/methods/key/Cargo.toml +++ b/crates/dids/methods/key/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "did-method-key" -version = "0.4.0" +version = "0.5.0" authors = ["Spruce Systems, Inc."] edition = "2021" license = "Apache-2.0" diff --git a/crates/dids/methods/pkh/Cargo.toml b/crates/dids/methods/pkh/Cargo.toml index 3fd204543..d9cef174f 100644 --- a/crates/dids/methods/pkh/Cargo.toml +++ b/crates/dids/methods/pkh/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "did-pkh" -version = "0.4.0" +version = "0.5.0" authors = ["Spruce Systems, Inc."] edition = "2021" license = "Apache-2.0" diff --git a/crates/dids/methods/test/Cargo.toml b/crates/dids/methods/test/Cargo.toml index 11a97592c..a15496e9d 100644 --- a/crates/dids/methods/test/Cargo.toml +++ b/crates/dids/methods/test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssi-did-test" -version = "0.2.0" +version = "0.3.0" authors = ["Spruce Systems, Inc."] edition = "2021" license = "Apache-2.0" diff --git a/crates/dids/methods/tz/Cargo.toml b/crates/dids/methods/tz/Cargo.toml index cf979248c..46970f9fd 100644 --- a/crates/dids/methods/tz/Cargo.toml +++ b/crates/dids/methods/tz/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "did-tz" -version = "0.4.0" +version = "0.5.0" authors = ["Spruce Systems, Inc."] edition = "2021" license = "Apache-2.0" diff --git a/crates/dids/methods/web/Cargo.toml b/crates/dids/methods/web/Cargo.toml index 157bbaff3..541bd2bfe 100644 --- a/crates/dids/methods/web/Cargo.toml +++ b/crates/dids/methods/web/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "did-web" -version = "0.4.0" +version = "0.5.0" authors = ["Spruce Systems, Inc."] edition = "2021" license = "Apache-2.0" diff --git a/crates/json-ld/Cargo.toml b/crates/json-ld/Cargo.toml index d2a693b69..17fc301da 100644 --- a/crates/json-ld/Cargo.toml +++ b/crates/json-ld/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssi-json-ld" -version = "0.3.2" +version = "0.3.3" edition = "2021" authors = ["Spruce Systems, Inc."] license = "Apache-2.0" @@ -10,7 +10,7 @@ documentation = "https://docs.rs/ssi-json-ld/" [dependencies] thiserror.workspace = true -json-ld = { version = "0.21.2", features = ["serde"] } +json-ld = { version = "0.21.3", features = ["serde"] } iref.workspace = true static-iref.workspace = true json-syntax = { workspace = true, features = ["serde"] } diff --git a/crates/status/Cargo.toml b/crates/status/Cargo.toml index c33f6830f..777498394 100644 --- a/crates/status/Cargo.toml +++ b/crates/status/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssi-status" -version = "0.7.0" +version = "0.8.0" edition = "2021" authors = ["Spruce Systems, Inc."] license = "Apache-2.0" diff --git a/crates/tzkey/Cargo.toml b/crates/tzkey/Cargo.toml index 5404aa9a9..ef29aa9b2 100644 --- a/crates/tzkey/Cargo.toml +++ b/crates/tzkey/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssi-tzkey" -version = "0.3.0" +version = "0.4.0" edition = "2021" authors = ["Spruce Systems, Inc."] license = "Apache-2.0" diff --git a/crates/ucan/Cargo.toml b/crates/ucan/Cargo.toml index bb9f0ab06..7fb1e01b9 100644 --- a/crates/ucan/Cargo.toml +++ b/crates/ucan/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssi-ucan" -version = "0.3.0" +version = "0.4.0" edition = "2021" authors = ["Spruce Systems, Inc."] license = "Apache-2.0" diff --git a/crates/verification-methods/Cargo.toml b/crates/verification-methods/Cargo.toml index 08e8e1e4f..cdcebbccc 100644 --- a/crates/verification-methods/Cargo.toml +++ b/crates/verification-methods/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssi-verification-methods" -version = "0.2.0" +version = "0.3.0" edition = "2021" authors = ["Spruce Systems, Inc."] license = "Apache-2.0" diff --git a/crates/verification-methods/core/Cargo.toml b/crates/verification-methods/core/Cargo.toml index 093b651b0..b2426844e 100644 --- a/crates/verification-methods/core/Cargo.toml +++ b/crates/verification-methods/core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssi-verification-methods-core" -version = "0.2.0" +version = "0.3.0" edition = "2021" authors = ["Spruce Systems, Inc."] license = "Apache-2.0" diff --git a/crates/zcap-ld/Cargo.toml b/crates/zcap-ld/Cargo.toml index 48333210a..4164d0f67 100644 --- a/crates/zcap-ld/Cargo.toml +++ b/crates/zcap-ld/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssi-zcap-ld" -version = "0.7.0" +version = "0.8.0" edition = "2021" authors = ["Spruce Systems, Inc."] license = "Apache-2.0"