def get_certificate(self, filename):
pkcs7message = self.get_file(filename)<EOL>message, _ = decode(pkcs7message)<EOL>cert = encode(message[<NUM_LIT:1>][<NUM_LIT:3>])<EOL>cert = cert[<NUM_LIT:2> + (cert[<NUM_LIT:1>] & <NUM_LIT>) if cert[<NUM_LIT:1>] & <NUM_LIT> > <NUM_LIT:1> else <NUM_LIT:2>:]<EOL>certificate = x509.load_der_x509_certificate(cert, default_backend())<EOL>return certificate<EOL>
Return a certificate object by giving the name in the apk file