Beispiel #1
0
def set_serial(cert, serial_number=0):
    """Set certificate serial number
    
    :param cert: certificate
    :type cert: X509.X509
    :param serial_number: certificate serial number
    :type serial_number: string

    """
    serial=m2.asn1_integer_new()
    m2.asn1_integer_set(serial,serial_number)
    m2.x509_set_serial_number(cert.x509,serial)
Beispiel #2
0
def set_serial(cert, serial_number=0):
    """Set certificate serial number
    
    :param cert: certificate
    :type cert: X509.X509
    :param serial_number: certificate serial number
    :type serial_number: string

    """
    serial = m2.asn1_integer_new()
    m2.asn1_integer_set(serial, serial_number)
    m2.x509_set_serial_number(cert.x509, serial)
Beispiel #3
0
def set_serial(cert, serial_path='/tmp/xmpp_foaf_cert_serial.txt'):
    """
    Set certificate serial number
    
    @param cert: certificate
    @type cert: X509
    @param serial_path: serial file path
    @type serial_path: string
    """
    serial_number = get_serial_from_file(serial_path)
    serial=m2.asn1_integer_new()
    m2.asn1_integer_set(serial,serial_number)
    m2.x509_set_serial_number(cert.x509,serial)