Skip to content

Commit d01e231

Browse files
committed
Require PublicKeyData::algorithm() values to be 'static
1 parent 1646a71 commit d01e231

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

rcgen/src/csr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl PublicKeyData for PublicKey {
3131
&self.raw
3232
}
3333

34-
fn algorithm(&self) -> &SignatureAlgorithm {
34+
fn algorithm(&self) -> &'static SignatureAlgorithm {
3535
self.alg
3636
}
3737
}

rcgen/src/key_pair.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ impl PublicKeyData for KeyPair {
527527
}
528528
}
529529

530-
fn algorithm(&self) -> &SignatureAlgorithm {
530+
fn algorithm(&self) -> &'static SignatureAlgorithm {
531531
self.alg
532532
}
533533
}
@@ -747,7 +747,7 @@ impl PublicKeyData for SubjectPublicKeyInfo {
747747
&self.subject_public_key
748748
}
749749

750-
fn algorithm(&self) -> &SignatureAlgorithm {
750+
fn algorithm(&self) -> &'static SignatureAlgorithm {
751751
self.alg
752752
}
753753
}
@@ -766,7 +766,7 @@ pub trait PublicKeyData {
766766
fn der_bytes(&self) -> &[u8];
767767

768768
/// The algorithm used by the key pair
769-
fn algorithm(&self) -> &SignatureAlgorithm;
769+
fn algorithm(&self) -> &'static SignatureAlgorithm;
770770
}
771771

772772
pub(crate) fn serialize_public_key_der(key: &(impl PublicKeyData + ?Sized), writer: DERWriter) {

0 commit comments

Comments
 (0)