def fromobj(obj):
        """
        Creates an OID object from the pointer to ASN1_OBJECT c structure.
        This method intended for internal use for submodules which deal
        with libcrypto ASN1 parsing functions, such as x509 or CMS
        """
        nid = libcrypto.OBJ_obj2nid(obj)
        if nid == 0:
            buf = create_string_buffer(80)
            dotted_len = libcrypto.OBJ_obj2txt(buf, 80, obj, 1)
            dotted = buf[:dotted_len]
            oid = create(dotted, dotted, dotted)
        else:
            oid = Oid(nid)
        return oid