Skip to content

Commit

Permalink
ecdsa: pkcs8 API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
baloo committed Sep 5, 2024
1 parent 0133af9 commit c813a76
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
17 changes: 7 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ members = [

[profile.dev]
opt-level = 2

[patch.crates-io]
sec1 = { git = "https://github.com/RustCrypto/formats.git" }
pkcs8 = { git = "https://github.com/RustCrypto/formats.git" }
# https://github.com/RustCrypto/traits/pull/1650
elliptic-curve = { git = "https://github.com/baloo/traits.git", branch = "baloo/elliptic-curve/pkcs8-API-break" }
2 changes: 1 addition & 1 deletion ecdsa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ elliptic-curve = { version = "=0.14.0-pre.6", default-features = false, features
signature = { version = "=2.3.0-pre.4", default-features = false, features = ["rand_core"] }

# optional dependencies
der = { version = "0.8.0-rc.0", optional = true }
der = { version = "0.8.0-rc.1", optional = true }
digest = { version = "=0.11.0-pre.9", optional = true, default-features = false, features = ["oid"] }
rfc6979 = { version = "=0.5.0-pre.4", optional = true, path = "../rfc6979" }
serdect = { version = "0.2", optional = true, default-features = false, features = ["alloc"] }
Expand Down
4 changes: 2 additions & 2 deletions ecdsa/src/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ where
}

#[cfg(feature = "pkcs8")]
impl<C> TryFrom<pkcs8::PrivateKeyInfo<'_>> for SigningKey<C>
impl<C> TryFrom<pkcs8::PrivateKeyInfoRef<'_>> for SigningKey<C>
where
C: EcdsaCurve + AssociatedOid + CurveArithmetic,
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
Expand All @@ -555,7 +555,7 @@ where
{
type Error = pkcs8::Error;

fn try_from(private_key_info: pkcs8::PrivateKeyInfo<'_>) -> pkcs8::Result<Self> {
fn try_from(private_key_info: pkcs8::PrivateKeyInfoRef<'_>) -> pkcs8::Result<Self> {
SecretKey::try_from(private_key_info).map(Into::into)
}
}
Expand Down

0 comments on commit c813a76

Please sign in to comment.