Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 61a42455

Přidáno uživatelem Stanislav Král před asi 4 roky(ů)

Re #8472 - Renamed `verify_ca` method to `verify_cert` and improved its documentation

Zobrazit rozdíly:

proj/services/cryptography.py
174 174
                   extensions="",
175 175
                   days=30):
176 176
        """
177
        Creates a certificate by using the given subject, subject's key, issuer and it's key.
177
        Creates a certificate by using the given subject, subject's key, issuer and its key.
178 178

  
179 179
        :param subject: subject to be added to the created certificate
180 180
        :param subject_key: string containing the private key to be used when creating the certificate in PEM format
......
195 195
                             days=days)
196 196

  
197 197
    @staticmethod
198
    def verify_ca(certificate):
199
        # TODO could be renamed to "verify_certificate"? This method can verify all certificates, not just CAs.
198
    def verify_cert(certificate):
199
        """
200
        Verifies whether the given certificate is not expired.
201

  
202
        :param certificate: certificate to be verified in PEM format
203
        :return: Returns `true` if the certificate is not expired, `false` when expired.
204
        """
200 205
        # call openssl to check whether the certificate is valid to this date
201 206
        args = [OPENSSL_EXECUTABLE, "x509", "-checkend", "0", "-noout", "-text", "-in", "-"]
202 207

  

Také k dispozici: Unified diff