From eeccb435be9cd2069322437aa73066d04e85542a Mon Sep 17 00:00:00 2001 From: Daniel McCarney Date: Sat, 9 Sep 2023 14:30:37 -0400 Subject: [PATCH] docs: remove redundant doc comments about feature reqs. Now that we've enabled `doc_auto_cfg` these comments are redundant with the auto-generated `docs.rs` notes about required features. --- src/crl.rs | 2 -- src/csr.rs | 2 -- src/error.rs | 2 -- src/key_pair.rs | 8 -------- src/lib.rs | 12 ------------ 5 files changed, 26 deletions(-) diff --git a/src/crl.rs b/src/crl.rs index d62bf084..3caaf53e 100644 --- a/src/crl.rs +++ b/src/crl.rs @@ -76,8 +76,6 @@ impl CertificateRevocationList { } /// Serializes the certificate revocation list (CRL) in ASCII PEM format, signed with /// the issuing certificate authority's key. - /// - /// *This function is only available if rcgen is built with the "pem" feature* #[cfg(feature = "pem")] pub fn serialize_pem_with_signer(&self, ca: &Certificate) -> Result { let contents = self.serialize_der_with_signer(ca)?; diff --git a/src/csr.rs b/src/csr.rs index 77a17f0e..62ad99f4 100644 --- a/src/csr.rs +++ b/src/csr.rs @@ -98,8 +98,6 @@ impl CertificateSigningRequest { self.params.serialize_der_with_signer(&self.public_key, ca) } /// Serializes the requested certificate, signed with another certificate's key, to the ASCII PEM format - /// - /// *This function is only available if rcgen is built with the "pem" feature* #[cfg(feature = "pem")] pub fn serialize_pem_with_signer(&self, ca: &Certificate) -> Result { let contents = self diff --git a/src/error.rs b/src/error.rs index 8623c919..40982430 100644 --- a/src/error.rs +++ b/src/error.rs @@ -35,8 +35,6 @@ pub enum RcgenError { Time, #[cfg(feature = "pem")] /// Error from the pem crate - /// - /// *This variant is only available if rcgen is built with the "pem" feature* PemError(pem::PemError), /// Error generated by a remote key operation RemoteKeyError, diff --git a/src/key_pair.rs b/src/key_pair.rs index b94426f3..61433b75 100644 --- a/src/key_pair.rs +++ b/src/key_pair.rs @@ -57,8 +57,6 @@ impl KeyPair { Ok(der.try_into()?) } /// Parses the key pair from the ASCII PEM format - /// - /// *This constructor is only available if rcgen is built with the "pem" feature* #[cfg(feature = "pem")] pub fn from_pem(pem_str: &str) -> Result { let private_key = pem::parse(pem_str)?; @@ -79,8 +77,6 @@ impl KeyPair { /// using the specified [`SignatureAlgorithm`] /// /// Same as [from_pem_and_sign_algo](Self::from_pem_and_sign_algo). - /// - /// *This constructor is only available if rcgen is built with the "pem" feature* #[cfg(feature = "pem")] pub fn from_pem_and_sign_algo( pem_str: &str, @@ -296,8 +292,6 @@ impl KeyPair { /// Return the key pair's public key in PEM format /// /// The returned string can be interpreted with `openssl pkey --inform PEM -pubout -pubin -text` - /// - /// *This function is only available if rcgen is built with the "pem" feature* #[cfg(feature = "pem")] pub fn public_key_pem(&self) -> String { let contents = self.public_key_der(); @@ -337,8 +331,6 @@ impl KeyPair { } /// Serializes the key pair (including the private key) in PKCS#8 format in PEM - /// - /// *This function is only available if rcgen is built with the "pem" feature* #[cfg(feature = "pem")] pub fn serialize_pem(&self) -> String { let contents = self.serialize_der(); diff --git a/src/lib.rs b/src/lib.rs index 127a5eb8..ca798a62 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -564,8 +564,6 @@ impl CertificateParams { /// Parses a ca certificate from the ASCII PEM format for signing /// /// See [`from_ca_cert_der`](Self::from_ca_cert_der) for more details. - /// - /// *This constructor is only available if rcgen is built with the "pem" and "x509-parser" features* #[cfg(all(feature = "pem", feature = "x509-parser"))] pub fn from_ca_cert_pem(pem_str: &str, key_pair: KeyPair) -> Result { let certificate = pem::parse(pem_str).or(Err(RcgenError::CouldNotParseCertificate))?; @@ -585,8 +583,6 @@ impl CertificateParams { /// and left to defaults. /// /// Will not check if certificate is a ca certificate! - /// - /// *This constructor is only available if rcgen is built with the "x509-parser" feature* #[cfg(feature = "x509-parser")] pub fn from_ca_cert_der(ca_cert: &[u8], key_pair: KeyPair) -> Result { let (_remainder, x509) = x509_parser::parse_x509_certificate(ca_cert) @@ -1566,8 +1562,6 @@ impl Certificate { &self.key_pair } /// Serializes the certificate to the ASCII PEM format - /// - /// *This function is only available if rcgen is built with the "pem" feature* #[cfg(feature = "pem")] pub fn serialize_pem(&self) -> Result { let contents = self.serialize_der()?; @@ -1575,8 +1569,6 @@ impl Certificate { Ok(pem::encode_config(&p, ENCODE_CONFIG)) } /// Serializes the certificate, signed with another certificate's key, to the ASCII PEM format - /// - /// *This function is only available if rcgen is built with the "pem" feature* #[cfg(feature = "pem")] pub fn serialize_pem_with_signer(&self, ca: &Certificate) -> Result { let contents = self.serialize_der_with_signer(ca)?; @@ -1584,8 +1576,6 @@ impl Certificate { Ok(pem::encode_config(&p, ENCODE_CONFIG)) } /// Serializes the certificate signing request to the ASCII PEM format - /// - /// *This function is only available if rcgen is built with the "pem" feature* #[cfg(feature = "pem")] pub fn serialize_request_pem(&self) -> Result { let contents = self.serialize_request_der()?; @@ -1601,8 +1591,6 @@ impl Certificate { /// Serializes the private key in PEM format /// /// Panics if called on a remote key pair. - /// - /// *This function is only available if rcgen is built with the "pem" feature* #[cfg(feature = "pem")] pub fn serialize_private_key_pem(&self) -> String { self.key_pair.serialize_pem()