#NEWLINE# def makeCert( cn ) : #NEWLINE# #INDENT# '\n    Create a self-signed certificate with the given common name.\n\n    @param cn: Common Name to use in certificate.\n    @type cn: L{bytes}\n\n    @return: Self-signed certificate.\n    @rtype: L{Certificate<twisted.internet.ssl.Certificate>}\n    ' #NEWLINE# sharedDN = DN ( CN = cn ) #NEWLINE# key = KeyPair . generate ( ) #NEWLINE# cr = key . certificateRequest ( sharedDN ) #NEWLINE# sscrd = key . signCertificateRequest ( sharedDN , cr , ( lambda dn : True ) , 1 ) #NEWLINE# return key . newCertificate ( sscrd )