From 5a5c626437c7b812639f0e946cc371eaf914a398 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 9 Jun 2009 14:42:30 +0000 Subject: [PATCH] dos2unix --- geni/util/cert.py | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/geni/util/cert.py b/geni/util/cert.py index 24b6d895..2ebad5cc 100644 --- a/geni/util/cert.py +++ b/geni/util/cert.py @@ -48,7 +48,7 @@ class Keypair: ## # Create a RSA public/private key pair and store it inside the keypair object - def create(self): + def create(self): self.key = crypto.PKey() self.key.generate_key(crypto.TYPE_RSA, 1024) @@ -155,11 +155,11 @@ class Keypair: # several addition features, such as the ability to maintain a chain of # parent certificates, and storage of application-specific data. # -# Certificates include the ability to maintain a chain of parents. Each -# certificate includes a pointer to it's parent certificate. When loaded -# from a file or a string, the parent chain will be automatically loaded. -# When saving a certificate to a file or a string, the caller can choose -# whether to save the parent certificates as well. +# Certificates include the ability to maintain a chain of parents. Each +# certificate includes a pointer to it's parent certificate. When loaded +# from a file or a string, the parent chain will be automatically loaded. +# When saving a certificate to a file or a string, the caller can choose +# whether to save the parent certificates as well. class Certificate: digest = "md5" @@ -172,12 +172,12 @@ class Certificate: ## # Create a certificate object. - # - # @param create If create==True, then also create a blank X509 certificate. - # @param subject If subject!=None, then create a blank certificate and set - # it's subject name. - # @param string If string!=None, load the certficate from the string. - # @param filename If filename!=None, load the certficiate from the file. + # + # @param create If create==True, then also create a blank X509 certificate. + # @param subject If subject!=None, then create a blank certificate and set + # it's subject name. + # @param string If string!=None, load the certficate from the string. + # @param filename If filename!=None, load the certficiate from the file. def __init__(self, create=False, subject=None, string=None, filename=None): if create or subject: @@ -387,7 +387,7 @@ class Certificate: # Verify the authenticity of a certificate. # @param pkey is a Keypair object representing a public key. If Pkey # did not sign the certificate, then an exception will be thrown. - + def verify(self, pkey): # pyOpenSSL does not have a way to verify signatures m2x509 = X509.load_cert_string(self.save_to_string()) @@ -440,18 +440,18 @@ class Certificate: # trusted certificate. # # Verification is a basic recursion:
-   #     if this_certificate was signed by trusted_certs:
-   #         return
-   #     else
-   #         return verify_chain(parent, trusted_certs)
-   # 
- # + # if this_certificate was signed by trusted_certs: + # return + # else + # return verify_chain(parent, trusted_certs) + # + # # At each recursion, the parent is tested to ensure that it did sign the # child. If a parent did not sign a child, then an exception is thrown. If # the bottom of the recursion is reached and the certificate does not match # a trusted root, then an exception is thrown. # - # @param Trusted_certs is a list of certificates that are trusted. + # @param Trusted_certs is a list of certificates that are trusted. # def verify_chain(self, trusted_certs = None): -- 2.43.0