示例#1
0
文件: X509.py 项目: daubers/M2Crypto
def load_crl_string(crl_string):
    """
    Load CRL from a string.

    @type string: string
    @param string: String containing a CRL in PEM format.

    @rtype: M2Crypto.X509.X509_CRL
    @return: M2Crypto.X509.X509_CRL object.
    """
    bio = BIO.MemoryBuffer(crl_string)
    cptr=m2.x509_crl_read_pem(bio._ptr())
    if cptr is None:
        raise X509Error(Err.get_error())
    return CRL(cptr, 1)
示例#2
0
文件: X509.py 项目: 0xkag/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)
示例#3
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 Err.get_error()
    return CRL(cptr, 1)