Skip to content

Commit 08a37f5

Browse files
committed
Rename RemoteKeyPair to SigningKey
1 parent ef250b5 commit 08a37f5

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

rcgen/src/crl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use crate::{
2424
/// #[cfg(not(feature = "crypto"))]
2525
/// struct MyKeyPair { public_key: Vec<u8> }
2626
/// #[cfg(not(feature = "crypto"))]
27-
/// impl RemoteKeyPair for MyKeyPair {
27+
/// impl SigningKey for MyKeyPair {
2828
/// fn public_key(&self) -> &[u8] { &self.public_key }
2929
/// fn sign(&self, _: &[u8]) -> Result<Vec<u8>, rcgen::Error> { Ok(vec![]) }
3030
/// fn algorithm(&self) -> &'static SignatureAlgorithm { &PKCS_ED25519 }

rcgen/src/key_pair.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub(crate) enum KeyPairKind {
4040
#[cfg(feature = "crypto")]
4141
Rsa(RsaKeyPair, &'static dyn RsaEncoding),
4242
/// A remote key pair
43-
Remote(Box<dyn RemoteKeyPair + Send + Sync>),
43+
Remote(Box<dyn SigningKey + Send + Sync>),
4444
}
4545

4646
impl fmt::Debug for KeyPairKind {
@@ -188,7 +188,7 @@ impl KeyPair {
188188
}
189189

190190
/// Obtains the key pair from a raw public key and a remote private key
191-
pub fn from_remote(key_pair: Box<dyn RemoteKeyPair + Send + Sync>) -> Result<Self, Error> {
191+
pub fn from_remote(key_pair: Box<dyn SigningKey + Send + Sync>) -> Result<Self, Error> {
192192
Ok(Self {
193193
alg: key_pair.algorithm(),
194194
kind: KeyPairKind::Remote(key_pair),
@@ -496,7 +496,7 @@ impl KeyPair {
496496
}
497497

498498
/// Access the remote key pair if it is a remote one
499-
pub fn as_remote(&self) -> Option<&(dyn RemoteKeyPair + Send + Sync)> {
499+
pub fn as_remote(&self) -> Option<&(dyn SigningKey + Send + Sync)> {
500500
#[cfg_attr(not(feature = "crypto"), allow(irrefutable_let_patterns))]
501501
if let KeyPairKind::Remote(remote) = &self.kind {
502502
Some(remote.as_ref())
@@ -654,11 +654,11 @@ impl PublicKeyData for KeyPair {
654654
}
655655
}
656656

657-
/// A private key that is not directly accessible, but can be used to sign messages
657+
/// A key that can be used to sign messages
658658
///
659659
/// Trait objects based on this trait can be passed to the [`KeyPair::from_remote`] function for generating certificates
660660
/// from a remote and raw private key, for example an HSM.
661-
pub trait RemoteKeyPair {
661+
pub trait SigningKey {
662662
/// Returns the public key of this key pair in the binary format as in [`KeyPair::public_key_raw`]
663663
fn public_key(&self) -> &[u8];
664664

rcgen/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub use error::{Error, InvalidAsn1String};
6262
pub use key_pair::PublicKeyData;
6363
#[cfg(all(feature = "crypto", feature = "aws_lc_rs"))]
6464
pub use key_pair::RsaKeySize;
65-
pub use key_pair::{KeyPair, RemoteKeyPair, SubjectPublicKeyInfo};
65+
pub use key_pair::{KeyPair, SigningKey, SubjectPublicKeyInfo};
6666
#[cfg(feature = "crypto")]
6767
use ring_like::digest;
6868
pub use sign_algo::algo::*;

rcgen/tests/webpki.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use webpki::{
1414
};
1515

1616
use rcgen::{
17-
BasicConstraints, Certificate, CertificateParams, DnType, Error, IsCa, KeyPair, RemoteKeyPair,
17+
BasicConstraints, Certificate, CertificateParams, DnType, Error, IsCa, KeyPair, SigningKey,
1818
};
1919
use rcgen::{CertificateRevocationListParams, RevocationReason, RevokedCertParams};
2020
#[cfg(feature = "x509-parser")]
@@ -317,7 +317,7 @@ fn test_webpki_separate_ca_with_other_signing_alg() {
317317
fn from_remote() {
318318
struct Remote(EcdsaKeyPair);
319319

320-
impl RemoteKeyPair for Remote {
320+
impl SigningKey for Remote {
321321
fn public_key(&self) -> &[u8] {
322322
self.0.public_key().as_ref()
323323
}

0 commit comments

Comments
 (0)