예제 #1
0
def load_crl(file):
    # type: (AnyStr) -> CRL
    """
    Load CRL from file.

    :param file: Name of file containing CRL in PEM format.

    :return: M2Crypto.X509.CRL object.
    """
    with BIO.openfile(file) as f:
        cptr = m2.x509_crl_read_pem(f.bio_ptr())

    return CRL(cptr, 1)
예제 #2
0
파일: X509.py 프로젝트: mcepl/M2Crypto
def load_crl(file):
    # type: (AnyStr) -> CRL
    """
    Load CRL from file.

    :param file: Name of file containing CRL in PEM format.

    :return: M2Crypto.X509.CRL object.
    """
    with BIO.openfile(file) as f:
        cptr = m2.x509_crl_read_pem(f.bio_ptr())

    return CRL(cptr, 1)
예제 #3
0
def load_crl(file):
    # type: (AnyStr) -> CRL
    """
    Load CRL from file.

    @param file: Name of file containing CRL in PEM format.

    @return: M2Crypto.X509.CRL object.
    """
    with BIO.openfile(file) as f:
        cptr = m2.x509_crl_read_pem(f.bio_ptr())

    if cptr is None:
        raise X509Error(Err.get_error())
    return CRL(cptr, 1)
예제 #4
0
def load_crl(file):
    """
    Load CRL from file.

    @type file: string
    @param file: Name of file containing CRL in PEM format.

    @rtype: M2Crypto.X509.CRL
    @return: M2Crypto.X509.CRL object.
    """
    f = BIO.openfile(file)
    cptr = m2.x509_crl_read_pem(f.bio_ptr())
    f.close()
    if cptr is None:
        raise X509Error(Err.get_error())
    return CRL(cptr, 1)
예제 #5
0
파일: X509.py 프로젝트: rodrigc/m2crypto
def load_crl(file):
    """
    Load CRL from file.

    @type file: string
    @param file: Name of file containing CRL in PEM format.

    @rtype: M2Crypto.X509.CRL
    @return: M2Crypto.X509.CRL object.
    """
    f = BIO.openfile(file)
    cptr = m2.x509_crl_read_pem(f.bio_ptr())
    f.close()
    if cptr is None:
        raise X509Error(Err.get_error())
    return CRL(cptr, 1)