Skip to content

Rsa suite6 tests#79

Open
ValentinVaninetti wants to merge 1 commit intodevfrom
rsa_suite6_tests
Open

Rsa suite6 tests#79
ValentinVaninetti wants to merge 1 commit intodevfrom
rsa_suite6_tests

Conversation

@ValentinVaninetti
Copy link

##Summary
Adds 6 integration tests for RSA sign/verify, encrypt/decrypt, and error handling.

##Changes
New Tests (6)

Sign and verify with correct key
Signature rejection on tampered message (edge case)
Signature rejection with a different key (edge case)
Encrypt/decrypt round-trip
Sign with unknown key returns RsaKeyNotFound
Decrypt with unknown key returns RsaKeyNotFound

##New file: src/tests/rsa_test.rs Modified: src/tests/mod.rs (registered new module)

@ValentinVaninetti ValentinVaninetti changed the base branch from main to dev February 25, 2026 14:34
#[test]
fn test_sign_and_verify() {
let key_manager = create_key_manager("test_output/rsa_sign_verify", None).unwrap();
let pem = key_manager.generate_rsa_keypair(&mut thread_rng()).unwrap();
Copy link
Contributor

@danielemiliogarcia danielemiliogarcia Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’d suggest renaming pem ((Privacy-Enhanced Mail)) to pubkey_pem for readability.
The method name generate_rsa_keypair suggests it returns a full keypair, so calling the result pem can be misleading to readers who aren’t familiar with the KeyManager API. Using pubkey_pem makes the intent explicit when verifying the signature.

the same apply for all the tests

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! will do the changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants