tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

index.rst (2821B)


      1 .. _mozilla_projects_nss_cert_findcertbyissuerandsn:
      2 
      3 CERT_FindCertByIssuerAndSN
      4 ==========================
      5 
      6 .. container::
      7 
      8   Find a certificate in the database with the given issuer and serial number.
      9 
     10 `Syntax <#syntax>`__
     11 ~~~~~~~~~~~~~~~~~~~~
     12 
     13 .. container::
     14 
     15   .. code::
     16 
     17      #include <cert.h>
     18      CERTCertificate *CERT_FindCertByIssuerAndSN (
     19 
     20          CERTCertDBHandle *handle,
     21          CERTIssuerAndSN *issuerAndSN            );
     22 
     23 `Parameters <#parameters>`__
     24 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     25 
     26 .. container::
     27 
     28   +-----------------+-------------------------------------------------------------------------------+
     29   | ``handle``      | *in* pointer to a `CERTCertDBHandle </en-US/NSS/CERTCertDBHandle>`__          |
     30   |                 | representing the certificate database to look in                              |
     31   +-----------------+-------------------------------------------------------------------------------+
     32   | ``issuerAndSN`` | *in* pointer to a `CERTIssuerAndSN </en-US/NSS/CERTIssuerAndSN>`__ that must  |
     33   |                 | be properly formed to contain the issuer name and the serial number (see      |
     34   |                 | [Example])                                                                    |
     35   +-----------------+-------------------------------------------------------------------------------+
     36 
     37 `Description <#description>`__
     38 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     39 
     40 .. container::
     41 
     42   This function creates a certificate key using the ``issuerAndSN`` and it then uses the key to
     43   find the matching certificate in the database.
     44 
     45 `Returns <#returns>`__
     46 ~~~~~~~~~~~~~~~~~~~~~~
     47 
     48 .. container::
     49 
     50   A pointer to a `CERTCertificate </en-US/NSS/CERTCertificate>`__ representing the certificate in
     51   the database that matched the issuer and serial number, or ``NULL`` if none was found. The
     52   certificate is a shallow copy, use
     53   `CERT_DestroyCertificate </en-US/NSS/CERT_DestroyCertificate>`__ to decrement the reference count
     54   on the certificate instance.
     55 
     56 `Example <#example>`__
     57 ~~~~~~~~~~~~~~~~~~~~~~
     58 
     59 .. container::
     60 
     61   .. code::
     62 
     63      CERTIssuerAndSN issuerSN;
     64      issuerSN.derIssuer.data = caName->data;
     65      issuerSN.derIssuer.len = caName->len;
     66      issuerSN.serialNumber.data = authorityKeyID->authCertSerialNumber.data;
     67      issuerSN.serialNumber.len = authorityKeyID->authCertSerialNumber.len;
     68      issuerCert = CERT_FindCertByIssuerAndSN(cert->dbhandle, &issuerSN);
     69      if ( issuerCert == NULL ) {
     70          PORT_SetError (SEC_ERROR_UNKNOWN_ISSUER);
     71      }
     72 
     73 .. _see_also:
     74 
     75 `See Also <#see_also>`__
     76 ~~~~~~~~~~~~~~~~~~~~~~~~
     77 
     78 .. container::
     79 
     80   Occurrences of
     81   ```CERT_FindCertByIssuerAndSN`` <http://lxr.mozilla.org/security/ident?i=CERT_FindCertByIssuerAndSN>`__
     82   in the current NSS source code (generated by `LXR <http://lxr.mozilla.org/security/>`__).