Skip to content

Commit

Permalink
added serde feature imports
Browse files Browse the repository at this point in the history
  • Loading branch information
LWEdslev committed Mar 19, 2024
1 parent 122deed commit ab19b3a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
10 changes: 7 additions & 3 deletions src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ use num_bigint::{BigInt, BigUint};
use num_integer::Integer;
use num_traits::{FromPrimitive, One, ToPrimitive};
use rand_core::CryptoRngCore;
#[cfg(feature = "serde")]
use serdect::serde::{de, ser, Deserialize, Serialize};
use zeroize::{Zeroize, ZeroizeOnDrop};
#[cfg(feature = "serde")]
use {
serdect::serde::{de, ser, Deserialize, Serialize},
spki::{EncodePublicKey, DecodePublicKey},
pkcs8::{EncodePrivateKey, DecodePrivateKey}
};

use crate::algorithms::generate::generate_multi_prime_key_with_exp;
use crate::algorithms::rsa::{
Expand Down Expand Up @@ -578,8 +582,8 @@ mod tests {
use crate::algorithms::rsa::{rsa_decrypt_and_check, rsa_encrypt};

use hex_literal::hex;
use pkcs8::DecodePrivateKey;
use num_traits::{FromPrimitive, ToPrimitive};
use pkcs8::DecodePrivateKey;
use rand_chacha::{rand_core::SeedableRng, ChaCha8Rng};

#[test]
Expand Down
10 changes: 8 additions & 2 deletions src/pkcs1v15/signing_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ use pkcs8::{
spki::{
der::AnyRef, AlgorithmIdentifierRef, AssociatedAlgorithmIdentifier,
SignatureAlgorithmIdentifier,
}, AssociatedOid, EncodePrivateKey, SecretDocument
},
AssociatedOid, EncodePrivateKey, SecretDocument,
};
use rand_core::CryptoRngCore;
#[cfg(feature = "serde")]
use serdect::serde::{de, ser, Deserialize, Serialize};
use {
pkcs8::PrivateKeyInfo,
serdect::serde::{de, ser, Deserialize, Serialize},
spki::der::Decode,
};

use signature::{
hazmat::PrehashSigner, DigestSigner, Keypair, RandomizedDigestSigner, RandomizedSigner, Signer,
};
Expand Down
10 changes: 8 additions & 2 deletions src/pkcs1v15/verifying_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ use pkcs8::{
spki::{
der::AnyRef, AlgorithmIdentifierRef, AssociatedAlgorithmIdentifier,
SignatureAlgorithmIdentifier,
}, AssociatedOid
},
AssociatedOid,
};

#[cfg(feature = "serde")]
use serdect::serde::{ser, de, Deserialize, Serialize};
use {
pkcs8::SubjectPublicKeyInfo,
serdect::serde::{de, ser, Deserialize, Serialize},
spki::der::Decode,
};

use signature::{hazmat::PrehashVerifier, DigestVerifier, Verifier};
use spki::{Document, EncodePublicKey};

Expand Down

0 comments on commit ab19b3a

Please sign in to comment.