Skip to content

Commit 71d9a11

Browse files
authored
document PKCS12Certificate's constructor, rename a variable (#12797)
1 parent b8a9789 commit 71d9a11

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

docs/hazmat/primitives/asymmetric/serialization.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ file suffix.
946946
... b"friendlyname", key, cert, None, encryption
947947
... )
948948

949-
.. function:: serialize_java_truststore(certs, encryption_algorithm)
949+
.. function:: serialize_java_truststore(pkcs12_certs, encryption_algorithm)
950950

951951
.. versionadded:: 45.0.0
952952

@@ -982,12 +982,18 @@ file suffix.
982982
... [pkcs12.PKCS12Certificate(cert, b"friendlyname")], BestAvailableEncryption(b"password")
983983
... )
984984

985-
.. class:: PKCS12Certificate
985+
.. class:: PKCS12Certificate(cert, friendly_name=None)
986986

987987
.. versionadded:: 36.0.0
988988

989989
Represents additional data provided for a certificate in a PKCS12 file.
990990

991+
:param cert: The certificate to associate with the additional data.
992+
:type cert: :class:`~cryptography.x509.Certificate`
993+
994+
:param friendly_name: An optional friendly name for the certificate.
995+
:type friendly_name: bytes or None
996+
991997
.. attribute:: certificate
992998

993999
A :class:`~cryptography.x509.Certificate` instance.

src/rust/src/pkcs12.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -536,16 +536,16 @@ fn serialize_safebags<'p>(
536536
}
537537

538538
#[pyo3::pyfunction]
539-
#[pyo3(signature = (certs, encryption_algorithm))]
539+
#[pyo3(signature = (pkcs12_certs, encryption_algorithm))]
540540
fn serialize_java_truststore<'p>(
541541
py: pyo3::Python<'p>,
542-
certs: Vec<pyo3::Py<PKCS12Certificate>>,
542+
pkcs12_certs: Vec<pyo3::Py<PKCS12Certificate>>,
543543
encryption_algorithm: pyo3::Bound<'_, pyo3::PyAny>,
544544
) -> CryptographyResult<pyo3::Bound<'p, pyo3::types::PyBytes>> {
545545
let encryption_details = decode_encryption_algorithm(py, encryption_algorithm)?;
546546
let mut safebags = vec![];
547547

548-
for cert in &certs {
548+
for cert in &pkcs12_certs {
549549
safebags.push(cert_to_bag(
550550
cert.get().certificate.get(),
551551
cert.get().friendly_name.as_ref().map(|v| v.as_bytes(py)),

0 commit comments

Comments
 (0)