Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/claims/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/claims/crates/data-integrity/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/claims/crates/data-integrity/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/claims/crates/data-integrity/suites/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/claims/crates/jws/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
65 changes: 57 additions & 8 deletions crates/claims/crates/jws/src/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: <https://datatracker.ietf.org/doc/html/rfc7515#section-4.1>
#[derive(Default, Clone)]
#[non_exhaustive]
pub struct JwsSignerInfo {
pub key_id: Option<String>,
pub algorithm: Algorithm,
/// JSON Web Key.
///
/// Public key that corresponds to the key used to digitally sign the JWS.
///
/// See: <https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.3>
pub jwk: Option<JWK>,

/// Key ID.
///
/// Hint indicating which key was used to secure the JWS.
///
/// See: <https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.4>
pub kid: Option<String>,

/// Cryptographic algorithm used to secure the JWS.
///
/// See: <https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.1>
pub alg: Algorithm,

/// X.509 Certificate Chain.
///
/// Each string in the array is a base64-encoded DER PKIX certificate value.
///
/// See: <https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.6>
pub x5c: Option<Vec<String>>,
}

impl JwsSignerInfo {
pub fn new(key_id: Option<String>, algorithm: Algorithm) -> Self {
Self {
kid: key_id,
alg: algorithm,
..Default::default()
}
}
}

/// JWS Signer.
Expand All @@ -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()
Expand Down Expand Up @@ -207,10 +254,12 @@ impl<T: JwsSigner + Clone> JwsSigner for Cow<'_, T> {
impl JwsSigner for JWK {
async fn fetch_info(&self) -> Result<JwsSignerInfo, SignatureError> {
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(),
})
}

Expand All @@ -236,8 +285,8 @@ impl<'a> JwkWithAlgorithm<'a> {
impl JwsSigner for JwkWithAlgorithm<'_> {
async fn fetch_info(&self) -> Result<JwsSignerInfo, SignatureError> {
Ok(JwsSignerInfo {
key_id: self.jwk.key_id.clone(),
algorithm: self.algorithm,
alg: self.algorithm,
..self.jwk.fetch_info().await?
})
}

Expand Down
2 changes: 1 addition & 1 deletion crates/claims/crates/jwt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/claims/crates/sd-jwt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/claims/crates/vc-jose-cose/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/claims/crates/vc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/dids/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/dids/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/dids/methods/ethr/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/dids/methods/ion/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/dids/methods/jwk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/dids/methods/key/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/dids/methods/pkh/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/dids/methods/test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/dids/methods/tz/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/dids/methods/web/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 2 additions & 2 deletions crates/json-ld/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/status/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/tzkey/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/ucan/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/verification-methods/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/verification-methods/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion crates/zcap-ld/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down