Skip to content

der: add impl OwnedToRef for UintRef and IntRef - #2416

Closed
dishmaker wants to merge 1 commit into
RustCrypto:masterfrom
dishmaker:dishmaker/der_uint_int_ownedtoref
Closed

der: add impl OwnedToRef for UintRef and IntRef#2416
dishmaker wants to merge 1 commit into
RustCrypto:masterfrom
dishmaker:dishmaker/der_uint_int_ownedtoref

Conversation

@dishmaker

@dishmaker dishmaker commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Edit: This might be useful. But looks like AsUintRef solves the problem.

impl<U> RsaPrivateKey<U>
where
    U: AsUintRef,
{
    pub fn public_key(&'u self) -> RsaPublicKeyRef<'u> {
        RsaPublicKeyRef {
            modulus: self.modulus.as_uint_ref(),
            public_exponent: self.public_exponent.as_uint_ref(),
        }
    }
}

5d46ec0#diff-65c869a52db3faff4591aacf0874b552096a0ac7ad0bd4b0908c7fb82ada6c98R90

This is needed for `pkcs1` fn RsaPrivateKey::public_key() -> RsaPublicKeyRef
@dishmaker
dishmaker force-pushed the dishmaker/der_uint_int_ownedtoref branch from fe0eb21 to 857ee81 Compare August 29, 2026 16:49
@dishmaker

dishmaker commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

Ah, ok, AsUintRef solves the problem

@dishmaker dishmaker closed this Aug 29, 2026
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.

1 participant