Skip to content

Commit

Permalink
docs: remove redundant doc comments about feature reqs.
Browse files Browse the repository at this point in the history
Now that we've enabled `doc_auto_cfg` these comments are redundant with
the auto-generated `docs.rs` notes about required features.
  • Loading branch information
cpu committed Sep 9, 2023
1 parent 07f948d commit eeccb43
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 26 deletions.
2 changes: 0 additions & 2 deletions src/crl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, RcgenError> {
let contents = self.serialize_der_with_signer(ca)?;
Expand Down
2 changes: 0 additions & 2 deletions src/csr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, RcgenError> {
let contents = self
Expand Down
2 changes: 0 additions & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 0 additions & 8 deletions src/key_pair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self, RcgenError> {
let private_key = pem::parse(pem_str)?;
Expand All @@ -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,
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
12 changes: 0 additions & 12 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self, RcgenError> {
let certificate = pem::parse(pem_str).or(Err(RcgenError::CouldNotParseCertificate))?;
Expand All @@ -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<Self, RcgenError> {
let (_remainder, x509) = x509_parser::parse_x509_certificate(ca_cert)
Expand Down Expand Up @@ -1566,26 +1562,20 @@ 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<String, RcgenError> {
let contents = self.serialize_der()?;
let p = Pem::new("CERTIFICATE", contents);
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<String, RcgenError> {
let contents = self.serialize_der_with_signer(ca)?;
let p = Pem::new("CERTIFICATE", contents);
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<String, RcgenError> {
let contents = self.serialize_request_der()?;
Expand All @@ -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()
Expand Down

0 comments on commit eeccb43

Please sign in to comment.