Skip to content

Commit

Permalink
Fix formatting & clippy warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
timothee-haudebourg committed Jun 27, 2024
1 parent 626d8ce commit 4658715
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
//! Data Integrity BBS Cryptosuite 2023 (v1.0) implementation.
//!
//! See: <https://www.w3.org/TR/vc-di-bbs/#bbs-2023>
use ssi_claims_core::DefaultEnvironment;
use ssi_data_integrity_core::{
suite::{ConfigurationAlgorithm, ConfigurationError, InputProofOptions},
CryptosuiteStr, ProofConfiguration, StandardCryptographicSuite, Type, TypeRef,
UnsupportedProofSuite,
};
use ssi_di_sd_primitives::JsonPointerBuf;
use ssi_json_ld::JsonLdEnvironment;
use ssi_verification_methods::Multikey;

pub(crate) mod transformation;
Expand Down Expand Up @@ -61,10 +59,6 @@ impl TryFrom<Type> for Bbs2023 {
}
}

impl DefaultEnvironment for Bbs2023 {
type Environment = JsonLdEnvironment;
}

#[derive(Clone)]
pub struct Bbs2023InputOptions {
pub mandatory_pointers: Vec<JsonPointerBuf>,
Expand Down
2 changes: 1 addition & 1 deletion crates/dids/methods/key/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl DIDKey {

multibase::encode(
multibase::Base::Base58Btc,
MultiEncodedBuf::encode(ssi_multicodec::P384_PUB, &pk_bytes)
MultiEncodedBuf::encode_bytes(ssi_multicodec::P384_PUB, &pk_bytes)
.into_bytes(),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,9 @@ impl Eip712Method2021 {

// Check the signing key.
let jwk = JWK {
params: ssi_jwk::Params::EC(
ssi_jwk::ECParams::try_from(
&k256::PublicKey::from_sec1_bytes(&recovered_key.to_sec1_bytes()).unwrap(),
)
.unwrap(),
),
params: ssi_jwk::Params::EC(ssi_jwk::ECParams::from(
&k256::PublicKey::from_sec1_bytes(&recovered_key.to_sec1_bytes()).unwrap(),
)),
public_key_use: None,
key_operations: None,
algorithm: None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,17 +281,7 @@ impl PublicKeyHex {
}

pub fn to_jwk(&self) -> JWK {
JWK {
params: ssi_jwk::Params::EC(ssi_jwk::ECParams::try_from(&self.decoded).unwrap()),
public_key_use: None,
key_operations: None,
algorithm: None,
key_id: None,
x509_url: None,
x509_certificate_chain: None,
x509_thumbprint_sha1: None,
x509_thumbprint_sha256: None,
}
self.decoded.into()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,17 +248,7 @@ impl PublicKeyHex {
}

pub fn to_jwk(&self) -> JWK {
JWK {
params: ssi_jwk::Params::EC(ssi_jwk::ECParams::try_from(&self.decoded).unwrap()),
public_key_use: None,
key_operations: None,
algorithm: None,
key_id: None,
x509_url: None,
x509_certificate_chain: None,
x509_thumbprint_sha1: None,
x509_thumbprint_sha256: None,
}
self.decoded.into()
}
}

Expand Down

0 comments on commit 4658715

Please sign in to comment.